External ID as Click ID

Learn how you can leverage External ID parameters to track conversions in AnyTrack.

AnyTrack allows you to use an External ID instead of the AnyTrack Click ID to track server side conversions. This method enables you to stitch literally any third party data with the Anytrack dataset.

❗️

Caution

This guide requires javascript skills or the ability to use Google Tag Manager to capture variables, cookies or event data from the browser. If you're not comfortable with coding, please forward this article to a developer or contact us in order to be referred to a developer.

Why it matters:

Let's say that the platform where your conversions are triggered isn't natively integrated with AnyTrack, and that it does not accept any custom parameters (such as the AnyTrack clickid).

In such case, you need to find an identifier from the third party platform that will be both set on the browser (ex: a cookie, leadid, userid, email) and via the platform's webhook.

πŸ‘

Reminder about Server Side Tracking

Server-side tracking is only possible when AnyTrack has collected or passed an identifier that your platform can collect and return to AnyTrack via their webhook endpoint.

Example with AnyTrack Click ID:

During the AddToCart event AnyTrack passes click_id to the cart object, and during the purchase event, the platform returns the same click_id in the webhook payload.

<script>  
AnyTrack('trigger', 'AddToCart', {
	customId: 'e.clickId',
	cartId: '{{cartId}}',
	value: '{{cartValue}}',
	itemId: '{{skuId}}',
	itemPrice: '{{price}}',
	quantity: '{{quantity}}',
	itemName: '{{itemName}}',
	variantId: '{{variantId}}'
});
</script>

Example with an External ID:

During the AddToCart event AnyTrack records a click_id and alias it with the cartId using the parameter refId.

Logically, it works like this:

click_id=refId=cartId

So when the platform calls the anytrack webhook, AnyTrack can parse the cartId and tie it to the click_id that triggered the AddToCart event.

event click_id with the cartId, and during the Purchase event, the platform returns the cartId in the webhook payload.

<script>  
AnyTrack('trigger', 'AddToCart', {
  refId: '{{cartId}}', //a unique id generated by the cart provider.
	cartId: '{{cartId}}',
	value: '{{cartValue}}',
	itemId: '{{skuId}}',
	itemPrice: '{{price}}',
	quantity: '{{quantity}}',
	itemName: '{{itemName}}',
	variantId: '{{variantId}}'
});
</script>

Setup guide:

  1. Trigger an event via the AnyTrack Event Snippet

This step requires some javascript skills or the ability to use Google Tag Manager to capture variables, cookies or event data from the browser.

If you're not familiar with Javascript you should ask for a developer to implement this method for you.

<script>  //placeholders such as {{cartId}} are provided in your platform's docs.
AnyTrack("trigger", "AddToCart", {   
	refId: {{cartId}}, 
  cartId: {{cartId}},     
  value: {{cartValue}},
  itemId: {{skuId}},
  itemPrice: {{price}},
  quantity: {{quantity}},
  itemName: {{itemName}},
  variantId: {{variantId}}  
});  
</script>

When this event snippet loads, it will automatically Alias the Anytrack Click_id with the refId value (1929195592). The data is sent to the Anytrack server and will be used when the third party platform sends conversions via api / webhook.

You can send additional parameters with this event following the event parameters guide.

  1. Create a custom integration

Navigate to the integration catalog and create a custom integration.

Upon saving, the system will issue the webhook (also called postback url)

https://t1.anytrack.io/GqxV3nTo/collect/custom-test

Depending on how the third party system formats its webhook payload you will probably have to use zapier or integromat to remap the parameters to match the AnyTrack standard parameters.

Please follow the instructions: How to send Conversions from AnyTrack to Zapier to create your zap.

Eventually, you will want to fire the conversion following the format below, where the refid carries the parameter initially captured during the first step.

https://t1.anytrack.io/xxxxx/collect/custom-test

?ref_id=1929195592&event_name=Purchase&event_value=200&transaction_id=oid123-xyz