Import events
Methods
To send events and their parameters, use the following methods:
registration
and registrationBatch
for registration events;
login
and loginBatch
for authorization events;
customEvent
and customEventBatch
for custom events.
registration
Use the registration
method to send data on the registration.
End-point: https://tracker-s2s.my.com/v1/registration/?idApp=XXX
Required parameters: customUserId
.
registrationBatch
Use the registrationBatch
method to send batch data on registrations.
This method is similar to registration
but allows you to send more than one event.
End-point: https://tracker-s2s.my.com/v1/registrationBatch/?idApp=XXX
Required parameters:
Name |
Description |
Type |
Example |
|
One parameter without a name.
It's an array,
through which you can pass parameters from the registration method.
If validation rules are broken in at least one set of parameters,
the server will return the error
|
Array. Maximum size 20 |
[
{"customUserId": "1111", "lvid":"00000000000000000000000000000000"},
{"customUserId": "2222", "lvid":"00000000000000000000000000000000"}
]
|
login
Use the login
method to send data on the authorization.
End-point: https://tracker-s2s.my.com/v1/login/?idApp=XXX
Required parameters: customUserId
.
loginBatch
Use the loginBatch
method to send batch data on authorizations.
This method is similar to login
but allows you to send more than one event.
End-point: https://tracker-s2s.my.com/v1/loginBatch/?idApp=XXX
Required parameters:
Name |
Description |
Type |
Example |
|
One parameter without a name.
It's an array,
through which you can pass parameters from the login method.
If validation rules are broken in at least one set of parameters,
the server will return the error
|
Array. Maximum size 20 |
[
{"customUserId": "1111", "lvid":"00000000000000000000000000000000"},
{"customUserId": "2222", "lvid":"00000000000000000000000000000000"}
]
|
customEvent
Use the customEvent
method to send data on the custom event
(for example, office visit, deliveries, etc.)
End-point: https://tracker-s2s.my.com/v1/customEvent/?idApp=XXX
Required parameters: a user identifier customUserId
and/or one of the device identifiers: instanceId
, lvid
, gaid
, androidId
, appSetId
, idfa
, iosVendorId
(the event will be related to the user and/or the device).
Specific parameters:
Name |
Description |
Type |
Example |
customEventName* |
Name of custom event |
String, minimum length 1, maximum length 255 |
"customEventName":"messageReceived" |
customEventParams |
Parameters of custom event |
array paramsName => paramValue
Array size is not limited
paramsName — string, minimum length 1, maximum length 255
paramValue — string, minimum length 1, maximum length 255
|
"customEventParams":{
"name1":"value1",
"name2":"value2"
}
|
* — required parameter.
customEventBatch
Use the customEventBatch
method to send batch data on custom events.
This method is similar to customEvent
but allows you to send more than one event.
End-point: https://tracker-s2s.my.com/v1/customEventBatch/?idApp=XXX
Required parameters:
Name |
Description |
Type |
Example |
|
One parameter without a name.
It's an array,
through which you can pass parameters from the customEvent method.
If validation rules are broken in at least one set of parameters,
the server will return the error
|
Array. Maximum size 20 |
[
{"customUserId": "1111", "lvid":"00000000000000000000000000000000", "customEventName": "messageReceived"},
{"customUserId": "2222", "lvid":"00000000000000000000000000000000", "customEventName": "messageReceived"}
]
|
Parameters
All parameters are passed in the request body in JSON format.
Limit on the maximum size of imported data — 10Kb.
Name |
Description |
Type |
Example |
Common |
eventTimestamp |
Event time |
Number, minimum value 946674000, maximum value 4294967295.
By default, timestamp of receiving the event
|
"eventTimestamp":"1577191920" |
customUserId |
User identifier in your app |
String, maximum size 1024 |
"customUserId":"1234" |
ipv4 |
ipv4 address |
String, maximum size 15 |
"ipv4":"125.125.125.125" |
ipv6 |
ipv6 address |
String, maximum size 45 |
"ipv6":"2001:0db8:85a3:0000:0000:8a2e:0370:7334" |
idGender |
Gender |
Number, possible values:
- 0 — unknown
- 1 — man
- 2 — woman
|
"idGender":"1" |
age |
Age |
Number, maximum value 128 |
"age":"38" |
connectionType |
Connection type |
Number, possible values:
- 0 — unknown
- 1 — mobile
- 2 — wi-fi
By default, 0 |
"connectionType":"1" |
bluetoothEnabled |
Bluetooth |
Number, possible values:
By default, 0 |
"bluetoothEnabled":"2" |
For mobile platform |
instanceId |
S2S device identifier |
String, number of symbols 36 |
"instanceId":"00000000-0000-0000-0000-000000000000" |
adTrackingEnabled |
Tracking permission |
Number, possible values:
By default, 1 |
"adTrackingEnabled":"0" |
iOS |
idfa |
iOS advertising identifier |
String, number of symbols 36 |
"idfa":"00000000-0000-0000-0000-000000000000" |
iosVendorId |
iOS vendor identifier |
String, number of symbols 36 |
"iosVendorId":"00000000-0000-0000-0000-000000000000" |
Android |
gaid |
Android advertising identifier |
String, number of symbols 36 |
"gaid":"00000000-0000-0000-0000-000000000000" |
appSetId |
Android identifier, unique within a Google Play developer account |
String, number of symbols 36 |
"appSetId":"00000000-0000-0000-0000-000000000000" |
androidId |
Android identifier |
String, number of symbols 16 |
"androidId":"000000000000000" |
For Web platform |
lvid |
S2S device identifier |
String, number of symbols 32 |
"lvid":"00000000000000000000000000000000" |
adBlocker |
Ad blocker |
Number, possible values:
By default, 0 |
"adBlocker":"0" |
userAgent |
User-Agent |
String, maximum size 2048 |
"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.87 Safari/537.36" |
For VK Mini Apps |
customPlatformUserId |
User identifier in the VK platform (vk id)
|
String
|
"customPlatformUserId":"12345"
|
vkPlatform |
Platform type on which the event occurred
|
String, possible values:
- desktop_web
- mobile_web
- mobile_android
- mobile_android_messenger
- mobile_ipad
- mobile_iphone
- mobile_iphone_messenger
|
"vkPlatform":"desktop_web"
|
Example query
HTTP POST request:
curl https://tracker-s2s.my.com/v1/customEvent/?idApp=666 \
–k –X POST --header "Authorization: skjdfASFasf03asdffar3asJHB32r" \
-d '{"customUserId": "1", "customEventName": "levelUp",
"customEventParams": {"level": "2"}, "idGender": "1",
"age": "25", "eventTimestamp": "1580213208",
"instanceId": "00000000-0000-0000-0000-000000000000"}'
PHP SDK:
$idApp = 666;
$token = 'skjdfASFasf03asdffar3asJHB32r';
$accountCredentials = new Credentials($token);
$customEventMethod = new CustomEventMethod($accountCredentials, $idApp);
$customEventMethod->params()
->setCustomUserId('1')
->setCustomEventName('levelUp')
->addCustomEventParam('level', '2')
->setIdGender(Gender::MALE)
->setAge(25)
->setEventTimestamp(1580213208)
->setInstanceId('00000000-0000-0000-0000-000000000000');
$client = Client::getDefault();
$client->request($customEventMethod);
Status codes
Code |
Text |
Description |
200 |
{"message": "ОK"} |
The request was successfully processed |
400 |
{"error": "Bad Request"} |
Request error, parameters not validated |
403 |
{"error": "Forbidden"} |
The token has not been validated or is not suitable for the application |
400 |
{"error": "Empty post data"} |
Empty request body |
400 |
{"error": "Bad json"} |
Passed an invalid JSON file in the request body |
400 |
{"error": "Bad api version"} |
Unsupported API version |
404 |
{"error": "Method not found"} |
API method not found |
500 |
{"error": "Internal Server Error"} |
Internal API error. Try to repeat the request later |