Server2Server Integration V2.0

From TyrooLabs



Server2Server integration is used in scenarios where implementing client end pixel (Standard JS or Image Pixel implemented on html pages) is not possible, due to unavailability of cookie access (mostly in mobile campaigns) and/or inability to place standard pixel.


Tracking workflow.png

Campaign Types

  • Cost Per Lead
  • Cost Per Sale
  • Cost Per Acquisition/Engagement
  • Cost Per Download
  • Cost Per Install
  • Cost Per Action

Tyroo URL To Call{aff_sub}&deviceIp={ip}&eventId={goal_id}&eventName={eventName}&actionkey={eventName}&transactionId={transaction_id};{ran}&idfa={ios_ifa}&gaId={google_aid}&androidId={android_id}&isAttr=1&tyrooAttributionPartnerId=33&cartvalue={sale_amount}&currencyCode={currency}&type=s


Once the events like install, conversion, launch, login, registration occurs advertiser needs to inform us through s2S pixels. Through post back URL’s an Advertiser can send us more information regarding the event, user identifiers, and device details along with the tracking parameters that we would have sent during the users click.List of placeholders available with us is shown below , which can be used for mapping the macros of Attribution and Tracking Partners (ATB)

Placeholder name Data Type Description Mandatory
Advertiser Info Placeholders
cac alphaNumWithSpclChars cac will be forwarded by Tyroo during click which is unique against each click.Example cac=%%trackerId%%%3B%%affiliateId%%%3B_TCX_%%cookieId%%%3B%%subId1%%%3B%%subId2%%%3B%%subId3%%%3B%%subId4%%%3B%%subId5%%%3B Yes
advertiserId alphaNum Advertiser id in Tyroo Central Platform
advertiserAppName alphaNum App Name
tyrooAttributionPartnerId alphaNum Attribution partner Id in Tyroo Central. While creating the post back template, Operations team should fill the Attribution partner id name in the Postback URL. This field is important for identifying the mapping of event names and id’s with Tyroo standard event name and id.For ATB Mapping please click on the below link Yes
campaignId alphaNum Campaign Id as given in the attribution and tracking tags by the Advertisers.
Click Tracking Macros
cac alphaNumWithSpclChars "cac will be forwarded by Tyroo during click which is unique against each click.Example Decoded:cac=%%trackerId%%;%%affiliateId%%;_TCX_%%cookieId%%;%%subId1%%;%%subId2%%;%%subId3%%;%%subId4%%;%%subId5%%; Encoded:cac=%%trackerId%%%3B%%affiliateId%%%3B_TCX_%%cookieId%%%3B%%subId1%%%3B%%subId2%%%3B%%subId3%%%3B%%subId4%%%3B%%subId5%%%3B Yes in case attribution is to Tyroo
type alphaNum Identifier for a lead or sale. For sale in the postback URL type = s .For lead URL type = l Yes
Device/App specific placeholders
deviceCountryCode alphaNum country code that user is located in
deviceBrand alphaNum Brand or make of user device (such as "Apple" or "Samsung").
deviceCarrier alphaNum Carrier (service provider) for the device (such as "Verizon Wireless").
deviceIp alphaNum IP address of the user device, recorded on click.
deviceType alphaNum Type of device used by user (such as desktop, android phone, android tablet, iOS phone, iOS tablet, windows phone, windows tablet, other, unknown).
deviceUserAgent alphaNum User-agent for the device that created the conversion.
lang alphaNum Name of the language used on the user device.
mobAppType alphaNum Type of mobile app (such as 'web', 'ios', or 'android').
OSVersion alphaNum Version of operating system on the user device.
pkgName alphaNum Name of the package for Android or Bundle ID on iOS (such as "com.zynga.words").
pkgAppVersion alphaNum Version of the application defined in the package (such as "2.1").
In App Event Placeholders
eventName alphaNum Name of the event of Attribution and Tracking partners
eventId alphaNum ID of the event of Attribution and Tracking Partners
attribSubid1 alphaNum Value of a particular event attribute 
attribSubid2 alphaNum Value of a particular event attribute 
attribSubid3 alphaNum Value of a particular event attribute 
attribSubid4 alphaNum Value of a particular event attribute 
attribSubid5 alphaNum Value of a particular event attribute 
contentId alphaNum ID of the content interacted with during an in-app event.
contentType alphaNum The type of content interacted with during an in-app event.
level alphaNum The event level achieved
rating alphaNum The rating related to an in-app event; e.g. a 4 star rating.
searchStr alphaNum Search terms, keywords or query formatted as a string.
viewMax alphaNum Length of ad content in seconds, set on first impression request.
viewPercent alphaNum Highest percent complete of the ad that user reached prior to an attribution.
checkInDate alphaNum Time of check-in for the in-app event "reservation".
checkOutDate alphaNum Time of check-out for the in-app event "reservation".
actionkey alphaNum Action keyword as defined in the platform if any, this identifies the conversion for different payouts (e.g. it/nonit for jobs campaign or books/electronics for ecommerce campaigns or it might contain the event ID/name for even based payout)
quantity alphaNum The count related to an in-app event; e.g. number of guests or credits spent.
optionalAdver alphaNum Extra placeholder for getting more values for campaign optimization
transactionId alphaNum UniqueTransaction ID value, which could be used for attribution and validation purposes. Passed by the advertiser
leadid alphaNum Unique id for CPL campaigns which identifies the conversion, and can be used for validation later
Event item Macros
eventItemJson alphaNum JSON display payload of site event items.
Revenue Related Placeholders
cartvalue alphaNum Revenue generated from the conversion as a floating point number.
amount alphaNum Revenue generated from the conversion as a floating point number.
currencyCode alphaNum Currency code of revenue using ISO 4217 currency codes.
Device Identifiers
deviceId alphaNum The DEVICE ID of the Android device (IMEI for GSM phones, MEID for CDMA phones, Serial ID for tablets without a cell radio).
gaId alphaNum The Google AID.
androidId alphaNum A 64-bit number (as a hex string) that is randomly generated on the first boot of a device and typically remains constant for the lifetime of the device.
idfa alphaNum iOS advertising identifier of device
odin alphaNum SHA1 of raw byte array of MAC address - iOS only
macAdd alphaNum The MAC address of the WiFi adapter on the device,
windowsAid alphaNum The Windows AID
User Identifiers
userId alphaNum Userid of the user
username alphaNum Name of the User
age alphaNum Age of the user
gender alphaNum Gender of the user
fbUid alphaNum The ID of the user defined by Facebook.
twitterUid alphaNum The ID of the user defined by Twitter.
googleUid alphaNum The ID of the user defined by Google.
userEmail alphaNum Other email id of the user
Date Time Macros
clickDatetime alphaNum Date of click formatted as YYYY-MM-DD.
conversionDatetime alphaNum Conversion date and time
imprsnDatetime alphaNum Impression date formatted 
installDatetime alphaNum Conversion date and time of originating install
dateTime alphaNum Date and time formatted
time alphaNum Time formatted
Yes or No Placeholders
isFirstEvent alphaNum the event logged is the user's first log for that specific event;
isFirstPurchase alphaNum the user's first log for that specific event
isInstallAttr alphaNum Partner of install for event same as postback partner.
isReengagement alphaNum  event is with re-engagement;
isAttr alphaNum Install or event attributed to the same partner as the postback partner.
isViewThrough alphaNum if the conversion attributed is through viewthrough attribution

Sample URL

LP URL:;211;_TCX_51423172612;12;;;;;

Conversion URL(CPS):;211;_TCX_51423172612;12;;;;;&actionKeyword=idea&trans=464564&amount=700&qty=1&advOptInfo=s2s_test18july


<Text>Tracked/Duplicate TransactionID/Missing TransactionID/Missing CookieID/Invalid CookieID</Text>


100 - Tracked 101 - Duplicate TransactionID 102 - Missing TransactionID 103 - Missing CookieID 104 - Invalid CookieID 105 - Others (Error msg should be displayed)

NOTE: This is a sample url, this will not work as is. Please follow the steps mentioned in next section to do the testing.

Sequence of Actions for implementation

Step1: Provide an LP URL to tyroo. We would pass trackerid, cookieId and typeand we those to be passed back with same values for proper tracking to be done.

Step2: We would share a test link with you, this can be used to test theapplication as well as to generate a sample click url.

Step3: You integrate the application, and run a test. This needs to be acomplete flow test to ensure confirmation.

Step4: If it returns ‘Conversion Succeeded’, you can share the variables youhit and we can confirm. Once done, campaign goes live.

Step5: If it returns an error, please share the exact URL you are hitting, andwe would check our logs and can recommend reasons for the same.

Possible reasons for error

  • Variable names mismatch. Ensure you are using the following exactly, as these are case sensitive
    • cookieId
    • transactionid
    • cartvalue
    • optionaladver
    • actionkey
  • Required variables missing in case "isAttr" is "True" or "Yes" or "1"
    • For CPS campaigns, cookieId,trackerid, transactionid and type are required.
    • For other campaigns, cookieId, trackerid, type is required
  • Incorrect trackerid or tracker id missing.
  • cookieId missing / Expired or duplicate transactionid.


Why is S2S implementation required?

As the name suggests, S2S or Server-to-Server pixel is called where client side integration is not possible. Normally, a pixel is fired on client browser,and is dependent on the cookies stored on the browser to track user and for attribution. For example, mobile applications do not have any support for the same.

Does this call needs to be from Server only?

Not necessarily, it’s just a nomenclature for Cookie-less tracking.

How is this URL called?

This url is normally called from the server, once a conversion has happened and is expected to be called real time, from the advertiser application. cURL is one common way of doing the same. There is no restriction on this being called using any other methodology as long as all variables are passed as GET parameters. Check a sample code below.

$url =";a5re33553f34fg35ggg36663g3;_TCX_2362382d;232;;;;&actionKeyword=airtel&trans=4664646&amount=500&advOptInfo=test_optinfo";
function ListSale($URL){
                        //Initiate the REST call via curl
                        $ch= curl_init($URL);
                        //Set the HTTP method to GET
                        curl_setopt($ch,CURLOPT_CUSTOMREQUEST, 'GET');
                        //Don't return headers
                        curl_setopt($ch,CURLOPT_HEADER, false);
                        //Return data after call is made
                        curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
                        curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);
                        curl_setopt($ch,CURLOPT_FRESH_CONNECT, 1);
                        $response= curl_exec ($ch);
                        if(empty($response) !== true) 
                                                $list_lead_data =simplexml_load_string($response, 'SimpleXMLElement', LIBXML_NOCDATA);
                                                return  "";

Why cookieId, trackerId,affiliateId is coming blank through Post Back URL?

Check the value in the placeholder "isAttr". If the value contains "False" or "0" or "No", in that case we will not get values in our own variables. An advertiser might want us to track all in App events , even though it is not attributed to us. This is generally done for re targeting campaigns, or in cases where they want to know the quality of users or LTV of the user.

If the "isAttr" is "True" or "1" or "Yes", in that case these variables should be filled, else we will not record the conversion/event.

How can I configure Postback for re targeting campaigns ?

For re-targeting campaigns or campaigns where Advertiser will send post backs for events which are not attributed to us in that case , placeholders is attributed will be filled with 1 , yes or true in case of attribution and no in case of non attribution

Can I see an example of Postback URL for clients using MAT?{trackerId};{affiliateId};_TCX_{cookieId};{subId1};{subId2};{subId3};{subId4};{subId5}&tyrooAttributionPartnerId=10&deviceCountryCode={country_code}&deviceBrand={device_brand}&deviceCarrier={device_carrier}&deviceIp={device_ip}&deviceType={device_type}&deviceUserAgent={conversion_user_agent}&lang={language}&mobAppType={mobile_app_type}&OSVersion={os_version}&pkgName={package_app_name}&pkgAppVersion={package_app_version}&eventName={event_name}&contentId={content_id}&contentType={content_type}&level={level}&rating={rating}&searchStr={search_string}&viewMax={view_max}&viewPercent={view_percent}&checkInDate={date1}&checkOutDate={date2}&actionkey={event_name}&quantity={quantity}&transactionId={tracking_id}&eventItemJson={event_items_json}&cartvalue={amount}&currencyCode={currency_code}&deviceId={device_id}&gaId={google_aid}&androidId={android_id}&idfa={ios_ifa}&macAdd={mac_address}&windowsAid={windows_aid}&fbUid={facebook_user_id}&twitterUid={twitter_user_id}&googleUid={google_user_id}&clickDatetime={click_datetime}&conversionDatetime={conversion_datetime}&imprsnDatetime={impression_datetime}&installDatetime={install_datetime}&dateTime={datetime}&time={time}&isFirstEvent={is_first_event}&isFirstPurchase={is_first_purchase}&isInstallAttr={is_install_attributed}&isReengagement={is_reengagement}&isAttr={is_attributed}&type=s

In order to see the various Macros available with MAT- click on below link:-

Can I see an example of Postback URL for clients using Adjust ?

Only Install{gps_adid}&idfa={idfa}&{event}%26actionkey%3D{event}%26transactionId%3D%7Badid%7D%3B%7Bidfa%7D%3B%7Bwin_udid%7D%3B%7Bcreated_at%7D%26gaId%3D%7Bgps_adid%7D%26androidId%3D%7Bandroid_id%7D%26idfa%3D%7Bidfa%7D%26macAdd%3D%7Bmac_sha1%7D%26windowsAid%3D%7Bwin_udid%7D%26clickDatetime%3D%7Bcreated_at_hour%7D%26conversionDatetime%3D%7Bcreated_at_hour%7D%26imprsnDatetime%3D%7Bcreated_at_hour%7D%26installDatetime%3D%7Binstalled_at_hour%7D%26isAttr%3D1%26type%3Ds

Install and other events in single post back{gps_adid}&deep_link=Jabong%3A%2F%2Fin%2Fd%2F%%productId%%&

Install and other events in multiple postbacks

In order to see the various Macros available with Adjust- click on below link:-

In order to generate the Postback URL, follow this link-

For testing the postback, follow this link-

Can I see an example of Postback URL for clients using Apsalar?

Android custom event{trackerid?Tyroo}%3B{affiliateid?Tyroo}%3B_TCX_{cookieid?Tyroo}%3B{subid1?Tyroo}%3B{subid2?Tyroo}%3B{subid3?Tyroo}%3B{subid4?Tyroo}%3B{subid5?Tyroo}&tyrooAttributionPartnerId=19&deviceCountryCode={COUNTRY}&deviceIp={IP}&mobAppType={PLATFORM}&pkgName={LONGNAME}&eventName={EVTNAME}&actionkey={EVTNAME}&contentId={EVTATTR:Attribute_Name}&contentType={EVTATTR:Attribute_Name}&level={EVTATTR:Attribute_Name}&rating={EVTATTR:Attribute_Name}&searchStr={EVTATTR:Attribute_Name}&checkInDate={EVTATTR:Attribute_Name}&checkOutDate{EVTATTR:Attribute_Name}&eventItemJson=[{"Product_id":"{EVTATTR:Attribute_Name}","Product_name":"{EVTATTR:Attribute_Name}","Product_category":"{EVTATTR:Attribute_Name}","Product_sub_category":"{EVTATTR:Attribute_Name}","Product_sub_sub_category":"{EVTATTR:Attribute_Name}","Quantity":"{EVTATTR:Attribute_Name}","Value":{AMOUNT},"Unit_price":{EVTATTR:Attribute_Name},"Unit_price_code":"{EVTATTR:Attribute_Name}","Currency_code":"{CURRENCY}","Attribute_sub1":"{EVTATTR:Attribute_Name}","Attribute_sub2":"{EVTATTR:Attribute_Name}","Attribute_sub3":"{EVTATTR:Attribute_Name}","Attribute_sub4":"{EVTATTR:Attribute_Name}","Attribute_sub5":"{EVTATTR:Attribute_Name}"}]&transactionId={TIME}%3B{AIFA}%3B{ANDI}&cartvalue={AMOUNT}&currencyCode={CURRENCY}&optionalAdver={ANDI}&attribSubid1={NETWORK}&gaId={AIFA}&androidId={ANDI}&odin={odin}&userid={USERID|user.key}&clickDatetime={CLICK_TIME}&conversionDatetime={TIME}&installDatetime={INSTALL_TIME}&dateTime={TIME}&isReengagement={IS_RE_ENG}&isAttr={NETWORK=Tyroo}&type=s

{EVTATTR:Attribute_Name} is the Macro of Apsalar and needs to be replaced with actual values.For e.g. order id could be {EVTATTR:orderid}

For more information on macros avaialble for postbacks, please see the link-

Can I see an example of Postback URL for clients using Apsflyer?

Android Install{clickid}&tyrooAttributionPartnerId=24&deviceCountryCode={country_code}&deviceBrand={device_brand}&deviceIp={ip}&lang={language}&mobAppType={platform}&OSVersion={os_version}&pkgName={app_id}&pkgAppVersion={app_version}&eventName=install&transactionId={appsflyer_transaction_id}&gaId={advertising_id}&androidId={android_id}&deviceId={imei}&userId={customer_user_id}&clickDatetime={click_time}&installDatetime={install_time}&optionalAdver={android_id}&isAttr=1&type=s

IoS install{clickid}&tyrooAttributionPartnerId=24&deviceCountryCode={country_code}&deviceBrand={device_brand}&deviceIp={ip}&lang={language}&mobAppType={platform}&OSVersion={os_version}&pkgName={app_id}&pkgAppVersion={app_version}&eventName=install&transactionId={appsflyer_transaction_id}&idfa={idfa}&macAdd={mac}&userId={customer_user_id}&clickDatetime={click_time}&installDatetime={install_time}&optionalAdver={idfa}&isAttr=1&type=s

Android in App events{clickid}&tyrooAttributionPartnerId=24&deviceCountryCode={country_code}&deviceBrand={device_brand}&deviceIp={ip}&lang={language}&mobAppType={platform}&OSVersion={os_version}&pkgName={app_id}&pkgAppVersion={app_version}&eventName={event_name}&actionkey={event_name}&transactionId={event_time}%3B{advertising_id}%3B{android_id}&cartvalue={event_value}&currencyCode={currency}&gaId={advertising_id}&androidId={android_id}&deviceId={imei}&userId={customer_user_id}&clickDatetime={click_time}&conversionDatetime={event_time}&optionalAdver={android_id}&isAttr=1&type=s

iOS in App events{clickid}&tyrooAttributionPartnerId=24&deviceCountryCode={country_code}&deviceBrand={device_brand}&deviceIp={ip}&lang={language}&mobAppType={platform}&OSVersion={os_version}&pkgName={app_id}&pkgAppVersion={app_version}&eventName={event_name}&actionkey={event_name}&transactionId={event_time}%3B{idfa}&cartvalue={event_value}&currencyCode={currency}&idfa={idfa}&macAdd={mac}&userId={customer_user_id}&clickDatetime={click_time}&conversionDatetime={event_time}&optionalAdver={idfa}&isAttr=1&type=s

For more information on the macros available for postbacks.Please see the link below.

For in App- event macros

I want to track events other than Install, what should I do ?

Post backs needs to be set up for multiple events. Event names or tokens will be provided by the Attribution & Tracking Partners and appropriate macros of ATB's should be mapped with Tyroo's Placeholders. For example see the postback templates defined for various ATB's.

What is the importance of placeholder isAttr?

isAttr needs to be mapped with Advertisers macro for re-targeting campaigns. In re-targeting campaigns Advertisers can send post backs even when the attribution is not to Tyroo. This is done majorly to record in App user behavior. For non-re targeting campaigns where the client has agreed to fire postbacks irrespective of attribution, the placeholder isAttr needs to be mapped with Advertisers appropriate macros. See postback URL of MAT for example.

In all other cases isAttr= 1 should be present in postback URL. if isAttr is empty, it will be considered that it is equal to "1".

Why Attribution & Partner ID is required to be filled in postback URL ?

Attribution and Tracking Partner ID is required for mapping the event ids of ATB with Tyroo's standard event names and event attributes, so that while seeing the event level reporting, we can see which event is what . Just looking at the event id's which are alphanumerical, it is difficult to identify to which actual event it is referring to.

How can I get the Attribution & Tracking Partner ID?

You can get the Attribution and Tracking Partner ID from the "Attribution Partners " tab in TC. You can select the ATB and see the "ID" in bracket beside the name.This ID has to be used in the postback URL . For example, if ATB ID = 12, then in postback URL &tyrooAttributionPartnerId=12 needs to be filled.

For more information on ATP- click on this link-Tracking_Attribution_Partners

How to configure postback URL, in case the payout is based on certain events?

While setting up the postback template, eventName or eventId is mapped with event macros like {event} for Adjust, {event_name} for MAT. For the event based payout, placeholder "actionkey" should also be mapped to the event name or id macro of the Attribution and Tracking Partners. Also these event names or Id's should be also be used for setting up the Action key based payout at campaign level.

Example-&actionkey= {event} or &actionkey={event_name}

What is trackerid?

Tracker id is unique id against each campaign. In order to fire the S2S pixel we need trackerid in the call back when advertiser’s sends it back to us.If trackerid is not available our pixel won’t work and nothing would be tracked.

How to handle variable name mismatch?

Variable name for sending information to advertiser can be anything, but we expect it back in variables we specified with the similar value that we sent to advertiser including tyroo cookie id.