This document describes in detail the process for event tracking via Server-to-Server integration over mTraction platform.
Below are the prerequisites which are required for the integration, an API user need to request them from mTraction admin:-
– Username and password
– Source IP Whitelisting
Sample Event URL
https://s2s.mtraction.com/api/events2s.php?cid=1234567890
Parameter | Max Size | Mandatory | Description | Sample Value |
cid | 10 | Mandatory | Campaign ID | 0123456789 |
Request Body JSON Parameters
https://s2s.mtraction.com/api/events2s.php?cid=1234567890
Parameter | Max Size | Mandatory | Description | Sample Value |
sid | 10 | Optional | Session ID | 0123456789 |
evt | 50 | Mandatory | Event name | purchase |
remote_addr | 20 | Mandatory | Device IP address | 216.122.122.111 |
ua_agent | 255 | Mandatory | Device user agent | |
ver | 10 | Optional | App Version | 3.7 |
dev_token | 255 | Optional | Device Token i.e. Push GCM id | APA91bGcO… |
udid | Anrdoid – 16
Ios – 60 |
Mandatory | Device Id
Android – Android ID IOS – UUID |
frtg34rdftg654fr |
adv_id | 50 | Optional | Google Advertising ID
Only for Android |
fe95739a-c225-45aa-aef2-7196ba9d7e7e |
tz | 20 | Optional | Time-Zone of user
Default=Asia/Calcutta |
Asia/Calcutta |
user | Mandatory | User Name | test_user | |
pass | Mandatory | Password | test_pwd |
Error Descriptions
E100 – Incorrect campaign ID
E101 – Incorrect Username or Password
E102 – Invalid Device id length
E103 – Special Characters found in Device id
E104 – Incorrect Campaign Type Found
E105 – Event name can not be more than 50 Chars.
E106 – Mandatory Parameter Event Name(evt) not found
E107 – Invalid Remote Address.
E108 – Mandatory Parameter Remote Address not found.
E109 – Mandatory Parameter User Agent not found.
API Request Example
HTTP URL: https://s2s.mtraction.com/api/events2s.php?cid=1234567890
JSON:
{
“sid”: “8260c6a75768dba35d7ad5449acf03332134fd991503302016”,
“evt”: “purchase”,
“remote_addr”: “180.151.244.162”,
������� “ua_agent”:”Mozilla/5.0 (iPhone; CPU iPhone OS 10_3 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) CriOS/56.0.2924.75 Mobile/14E5239e Safari/602.1″,
“ver”: “3.7”,
“dev_token”: “APA91bGcO3GRZVD2vyqX1xeAz8b45VJTBvMyewrGvtDTgqpkIJTm0dvcAbBqkXb”,
“os_ver”: “6.0.1”,
“udid”: “2619955edba93fd1”,
“adv_id”: “2edf8343-59b5-4c61-a2f5-43d56b75e0b8”,
“tz”: “Asia/Calcutta”,
“user”:”test”,
“pass”:”test123″
}
API Response
{
“mt_tid”: “8260c6a75768dba35d7ad5449acf03332134fd991503302016”,
“mt_publisher”: “facebook|testcampaign15sep”,
“mt_guid”: “B4TNH68QFY”,
“mt_fingerprint”: “B4TNH68QFY”,
“mt_time”: 1505810138
}