Legacy Tracking Pixel

Overview

First party cookie tracking integration involves setting a server side first party affiliate cookie to track affiliate sales.

NOTE: Our first-party tracking javascript solution was changed recently to provide improved functionality. The changes made were 100% backwards-compatible, so all existing tracking will continue to work fine without modification. If you have questions about an older integration (one mentioning avant_rfpc.php) please contact support@avantlink.com.

There are two options for setting and reading first party cookies.

Using the AvantLink.com provided javascript to set and read first party cookies.

  • Extract the first party setting javascript code from the zip file referenced in your Account Setup, Tracking & Datafeed Integration welcome email.
  • Open the JavaScript file and change the 'avant_cookie_days' variable to the number of affiliate cookie days defined in your program terms if necessary.
  • Upload the resulting javascript to your e-commerce server(s).
  • Add a reference to the javascript in your site-wide html template. By site-wide we mean that this javascript should be included on all pages of your website, e.g.
<script type="text/javascript" src="/avant_sfpc_[MERCHANT_ID].js"></script>

* The javascript file we provide will contain your Merchant ID in the file name; the example above will need to be modified accordingly.

* If you do not have the AvantLink.com first party cookie setting javascript, and do not have a copy of your Account Setup, Tracking & Datafeed Integration welcome email, contact support@avantlink.com.

Add the following to your order confirmation page:

<script type="text/javascript">
	avant_track_order('[ORDERTOTAL]','[ORDERNUMBER]','[ORDERITEMS]','','','','cst=[BILLING_STATE]&ccy=[BILLING_COUNTRY]');
</script>
<noscript>
	<img src="https://tracking.avantlink.com/ptcfp.php?mi=[MERCHANT_ID]&amp;ot=[ORDERTOTAL]&amp;on=[ORDERNUMBER]&amp;ad=avant&amp;oi=[ORDERITEMS]&amp;ecc=&amp;ac=&amp;oid=&amp;cst=[BILLING_STATE]&amp;ccy=[BILLING_COUNTRY]&amp;new=[NEW_CUSTOMER]" alt="" style="height: 0px; width: 0px; border: 0px;" />
</noscript>

Important Note: The site-wide JavaScript code library must be referenced in the page HTML before the order confirmation page code because the order confirmation page code calls a function from that site-wide JavaScript code library

Replace:

[MERCHANT_ID] with the provided Merchant ID for your affiliate program

[ORDERTOTAL] with a variable that outputs the order total (without taxes, shipping)

[ORDERNUMBER] with a variable that outputs the order number so that we can match affiliate sales back to your internal order numbers.

[ORDERITEMS] Replace this with a delimited list of items that were part of the order. Each order item needs to contain the SKU, Item Price (for a single item) and quantity and be delimited by the pipe (|) character:

SKU|Price|Quantity

For orders that contain multiple items, each item should be delimited with the tilde (~) character. Example with multiple items:

SKU1|Price1|Quantity1~SKU2|Price2|Quantity2

Note: The SKUs passed to us in the tracking need to match the SKUs in the product datafeed you provide to us so that we can properly report on the sale item details.

[BILLING_STATE] The U.S. state associated with the order's billing address; preferably the standard (e.g. U.S. Postal Service) 2-letter abbreviation for the state.

[BILLING_COUNTRY] The country associated with the order's billing address; preferably the 2- or 3-letter ISO 3166 country code.

[NEW_CUSTOMER] (1 or 0) This optional field allows for specifying whether or not the order is from an existing or new customer. Input 1 for new customer and 0 for existing customer.

Here's a full example of what the javascript/HTML would look like for an order with 2 items:
<script type="text/javascript">
	avant_track_order('48.99','1234','TNF0123|19.99|1~TNF4567|29.00|1','','','','cst=UT&ccy=USA');
</script>
<noscript>
	<img src="https://tracking.avantlink.com/ptcfp.php?mi=11111&amp;ot=48.99&amp;on=1234&amp;ad=avant&amp;oi=TNF0123|19.99|1~TNF4567|29.00|1&amp;ecc=&amp;ac=&amp;oid=&amp;cst=UT&amp;ccy=USA" alt="" style="height: 0px; width: 0px; border: 0px;" />
</noscript>

Setting your own server side first party affiliate cookie.

Setting your own first party cookie involves having site-wide code that identifies the 'avad' url parameter we pass with every click through and setting an affiliate cookie that stores the string passed in the 'avad' parameter for the number of days you've defined for your affiliate program terms.

  • Add code to your e-commerce platform that looks for the 'avad' url parameter.
  • If the 'avad' parameter is detected, set an affiliate cookie that stores the value of the avad paramater for the number of cookie days defined in your program terms.
  • On the order confirmation page check to see if this cookie exists and if so output the following pixel tracking url:
<img src="https://tracking.avantlink.com/ptcfp.php?mi=[MERCHANT_ID]&amp;ot=[ORDERTOTAL]&amp;on=[ORDERNUMBER]&amp;ad=[COOKIEDATA]&amp;oi=[ORDERITEMS]&amp;cst=[BILLING_STATE]&amp;ccy=[BILLING_COUNTRY]&amp;new=[NEW_CUSTOMER]" alt="" style="width: 0px; height: 0px; border: 0px;" />

Replace:

[MERCHANT_ID] with the provided Merchant ID for your affiliate program

[ORDERTOTAL] with a variable that outputs the order total (without taxes, shipping)

[ORDERNUMBER] with a variable that outputs the order number so that we can match affiliate sales back to your internal order numbers.

[COOKIEDATA] with the Affiliate tracking string stored in the server side first party cookie.

[ORDERITEMS] Replace this with a delimited list of items that were part of the order. Each order item needs to contain the SKU, Item Price (for a single item) and quantity and be delimited by the pipe (|) character:

SKU|Price|Quantity

For orders that contain multiple items, each item should be delimited with the tilde (~) character. Example with multiple items:

SKU1|Price1|Quantity1~SKU2|Price2|Quantity2

Note: The SKUs passed to us in the tracking need to match the SKUs in the product datafeed you provide to us so that we can properly report on the sale item details.

[BILLING_STATE] The U.S. state associated with the order's billing address; preferably the standard (e.g. U.S. Postal Service) 2-letter abbreviation for the state.

[BILLING_COUNTRY] The country associated with the order's billing address; preferably the 2- or 3-letter ISO 3166 country code.

[NEW_CUSTOMER] (1 or 0) This optional field allows for specifying whether or not the order is from an existing or new customer. Input 1 for new customer and 0 for existing customer.

Here's a full example of what the HTML would look like for an order with 2 items:
<img src="https://tracking.avantlink.com/ptcfp.php?mi=11111&amp;ot=48.99&amp;on=1234&amp;ad=77_212_ml_0&amp;oi=TNF0123|19.99|1~TNF4567|29.00|1&amp;cst=UT&amp;ccy=USA&amp;new=0" alt="" style="width: 0px; height: 0px; border: 0px;" />

If you have any questions please contact integration@avantlink.com for help.

Have more questions? Submit a request
Powered by Zendesk