It's a common case that you use a third-party system to store data about the event (registration, purchase, deposit, etc.) happening within the application. These events are not automatically tracked by the MMP, since it tracks the channel from where the users come. All the events users do are tracked in your system.
To send the events to Affise MMP and to the services the MMP integrated with (Facebook, for example, to optimize ad campaigns), use the guide below.
Events sending logic
The events should be sent with the event ID to Affise MMP to further register it in the system.
Events sending method
You need an API key from the API access section to send the request below:
curl --request POST \
--header 'Authorization: Bearer <API-KEY>' \
--header 'Content-Type: application/json' \
--data '{
"affise_device_id": "3d973489-e784-4f5d-8e51-9bee0ac16b00",
"random_user_id": "7ea344d0-643d-4670-8e57-e3b9ecb53a00",
"event": {
"affise_event_id": "780df130-2302-4037-a628-ae087bcb2923",
"affise_event_name": "CustomId03",
"affise_event_timestamp": 1688046085325,
"affise_event_first_for_user": true,
"affise_event_user_data": "any_string",
"affise_event_data": {
"affise_event_custom_id_03": "any_name",
"affise_event_custom_id_{03}_timestamp": 1688046085325
}
}
}'
where:
affise_device_id & random_user_id - device identifiers.
affise_event_id - uuid new for each event.
affise_event_name - see valid values in other documentation, for example AddToCart Purchase.
affise_event_timestamp - timestamp send event (millisec or sec).
affise_event_first_for_user - default false.
affise_event_user_data - any user data as string.
affise_event_data - optional and depends on affise_event_name.
minimal works:
curl --request POST \
--header 'Authorization: Bearer <API-KEY>' \
--data '{
"affise_device_id": "3d973489-e784-4f5d-8e51-9bee0ac16b00",
"event": {
"affise_event_name": "CustomId03"
}
}'
curl --request GET \
--header 'Authorization: Bearer <API-KEY>'
🔎 If a user opts out of sharing GAID based on Google's policy, or you can't pass affse_device_id
or affise_random_id
, you can pass gaid_adid
or adid
as unique user identifiers.
For example:
curl --request POST \
--header 'Authorization: Bearer <API-KEY>' \
--header 'Content-Type: application/json' \
--data '{
"gaid_adid": "39ae1572-055b-41c9-ba50-87d9e45f47d9",
"event": {
"affise_event_id": "780df130-2302-4037-a628-ae087bcb2923",
"affise_event_name": "CustomId07",
"affise_event_timestamp": 1688046085325,
"affise_event_first_for_user": true,
"affise_event_user_data": "any_string",
"affise_event_data": {
"affise_event_custom_id_07": "any_name"
}
}
}'
or
curl --request POST \
--header 'Authorization: Bearer <API-KEY>' \
--header 'Content-Type: application/json' \
--data '{
"adid": "D8CA4CF9-B475-4FA1-ADEB-8921D2431756",
"event": {
"affise_event_id": "780df130-2302-4037-a628-ae087bcb2923",
"affise_event_name": "StartTrial",
"affise_event_timestamp": 1688046085325,
"affise_event_first_for_user": true
}
}'
Event examples
Purchase event
🔎 adid and gaid_adid are to be defined earlier in the install to deliver events correctly to Facebook (Meta), Google Ads (UAC), TikTok
Max event
curl --request POST \
--header 'Authorization: Bearer <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"affise_device_id": "eb4cfa97-5266-4dea-b807-6a345c3ab900",
"random_user_id": "bd1f6259-3521-45dc-ac48-651b649c1598",
"gaid_adid": "GAID",
"adid": "IDFA",
"event": {
"affise_event_name": "Purchase",
"affise_event_timestamp": 1688046085325,
"affise_parameters": {
"affise_p_content_ids": [123, 789],
"affise_p_content_id": "name",
"affise_p_content_type": "type",
"affise_p_content_list": [{"key": "name"}, {"value": "value"}],
"affise_p_currency": "USD",
"affise_p_quantity": 6,
"affise_p_price": 0.05,
"affise_p_revenue": 0.3
}
}
}'
Min event
curl --request POST \
--header 'Authorization: Bearer <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"affise_device_id": "eb4cfa97-5266-4dea-b807-6a345c3ab900",
"event": {
"affise_event_name": "Purchase",
"affise_parameters": {
"affise_p_currency": "USD",
"affise_p_quantity": 6,
"affise_p_price": 0.05,
"affise_p_revenue": 0.3
}
}
}'
Event with conversion ID
curl --request POST \
--header ‘Authorization: Bearer <api-key>’ \
--header ‘Content-Type: application/json’ \
--data ‘{
“affise_device_id”: “eb4cfa97-5266-4dea-b807-6a345c3ab900",
“event”: {
“affise_event_name”: “Loan”,
“affise_parameters”: {
“affise_p_conversion_id”: “123",
“affise_p_customer_type”: ———,
“affise_p_customer_user_id”: ———
}
}
}’
🔎 Use the correspondent macros in partner postback:
{p_conversion_id}
{p_customer_type}
{p_customer_user_id}
Please contact the Affise Customer Support team regarding all raised questions via the e-mail: [email protected].