Skip to main content
All CollectionsSetting Up AppSamurai on the MMP
Server-to-Server (S2S) - For Agencies
Server-to-Server (S2S) - For Agencies

S2S Integration with AppSamurai

Updated this week

S2S Integration with AppSamurai

AppSamurai supports S2S integration with various attribution and tracking providers. Even if your specific partner isn't listed or you use a custom tracking solution, our S2S tracking mechanism can accommodate your needs.

Integration Steps

S2S integration involves three key steps:

  1. Setting up the Tracking URL/Measurement URL: This involves incorporating AppSamurai's macros into your tracking URL to capture essential campaign data.

  2. Setting up Install Postbacks: This enables AppSamurai to receive real-time notifications when installs occur.

  3. Setting up Event Postbacks (Optional): This allows you to track specific in-app events, providing deeper insights into user behavior.

Setting Up the Tracking URL/Measurement URL

AppSamurai utilizes macros within your tracking URL to measure various parameters. These macros are placeholders that are replaced with actual data when a user clicks on your ad.

Required Macros

  • {ref_id}: This represents the unique click ID assigned by AppSamurai and is mandatory for all tracking URLs.

Advanced Macros

  • {sub_id}: This identifies the sub-publisher responsible for the click.

  • {ios_ifa} or {device_id}: This captures the iOS Identifier for Advertisers (IDFA).

  • {google_aid} or {device_id}: This captures the Google Advertising ID (GAID).

  • {app_name}: This represents the name of the app being advertised.

Tracking URL Examples

  • iOS: https://URL.com/clicks?ref={ref_id}&ifa={device_id}&pub={sub_id}

  • Android: https://URL.com/clicks?ref={ref_id}&google_id={device_id}&pub={sub_id}

Setting Up Install Postbacks

Install postbacks notify AppSamurai when a user installs your app after clicking on an ad.

Required Parameters

  • ref_id: The unique click ID provided by AppSamurai.

Advanced Parameters

You can include additional parameters in your postback URL to provide more context about the install.

*If you're using a global postback, the Android postback example below includes all the necessary parameters for both iOS and Android campaigns. 

Sample iOS Install Postback:

https://postback.appsamurai.com/api/callbacks/postback?ref_id={YOUR CLICK ID MACRO}&device_id={YOUR iOS IFA MACRO}&conversion_timestamp={YOUR CONVERSION TIME MACRO}&country_code={YOUR CONVERSION COUNTRY MACRO}&region={YOUR REGION MACRO}&carrier={YOUR CARRIER MACRO}&ip={YOUR IP MACRO}&language={YOUR LANGUAGE MACRO}&app_version={YOUR APP VERSION MACRO}&attribution_type={YOUR ATTRIBUTION TYPE MACRO}&user_agent={YOUR USER AGENT MACRO}

Sample Android Install Postback:

https://postback.appsamurai.com/api/callbacks/postback?ref_id={YOUR CLICK ID MACRO}&device_id={YOUR GOOGLE AD ID MACRO}&android_id={YOUR ANDROID ID MACRO}&conversion_timestamp={YOUR CONVERSION TIME MACRO}&country_code={YOUR CONVERSION COUNTRY MACRO}&region={YOUR REGION MACRO}&carrier={YOUR CARRIER MACRO}&ip={YOUR IP MACRO}&language={YOUR LANGUAGE MACRO}&app_version={YOUR APP VERSION MACRO}&attribution_type={YOUR ATTRIBUTION TYPE MACRO}&user_agent={YOUR USER AGENT MACRO}

Setting Up Event Postbacks

Setting Up Event Postbacks

Event postbacks allow you to track specific actions users take within your app, such as completing a tutorial or making a purchase.

Required Parameters

  • ref_id: The unique click ID provided by AppSamurai.

Advanced Parameters

Similar to install postbacks, you can include additional parameters in your event postback URLs. The Android postback example below covers all parameters for both iOS and Android.

*If you are going to use a Global Postback, please feel free to use the second one (Sample Android event postback). It includes every parameter required for iOS campaigns. 

Sample iOS Event Postback:

https://postback.appsamurai.com/api/callbacks/in_app_event_postback?ref_id={YOUR CLICK ID MACRO}&device_id={YOUR iOS IFA MACRO}&event_name={YOUR EVENT NAME MACRO}&event_timestamp={YOUR EVENT TIME MACRO}&ip={YOUR IP MACRO}&user_agent={YOUR USER AGENT MACRO}

Sample Android Event Postback:

https://postback.appsamurai.com/api/callbacks/in_app_event_postback?ref_id={YOUR CLICK ID MACRO}&device_id={YOUR GOOGLE AD ID MACRO}&android_id={YOUR GOOGLE AD ID MACRO}&event_name={YOUR EVENT NAME MACRO}&event_timestamp={YOUR EVENT TIME MACRO}&ip={YOUR IP MACRO}&user_agent={YOUR USER AGENT MACRO}

Important Notes

  • Remember to replace {YOUR CLICK ID MACRO} with the actual macro your system uses for the unique click ID.

  • For any technical questions regarding S2S integration, please contact AppSamurai's support team at 'adops@appsamurai.com'.

Did this answer your question?