Custom Cart Tracking Setup

ShareASale’s tracking involves two 'tags' or 'pixels' which are snippets of code installed specifically on the checkout 'thank-you' receipt page and in the header of every other site page. The first tag is for tracking conversions (i.e. sales) and the second for assisting with Affiliate click attribution accuracy in certain browsers, respectively.

ShareASale retrieves the following data about Affiliate-referred orders where possible:

  1. Amount – order subtotal after discounts but before taxes and shipping

  2. Tracking – order ID of the customer

  3. Coupon Code – the discount code used in the order, if any

  4. Skulist – a comma-separated list of SKUs for the products purchased

  5. Pricelist – a comma-separated list of item prices for the SKUs in the same order

  6. Quantitylist – a comma-separated list of the quantities of each SKU

  7. Newcustomer – whether the customer was new (1), old (0), or unknown (no value)

  8. Currency – the three letter ISO-4217 currency code for the currency used by the customer, e.g. EUR for Euros, GBP for British Pounds, USD for US Dollars, etc.

Conversion Tracking Pixel Installation

A sale event is a 'conversion' where any money changes hands. These can be any sort of purchase or account signup that results in a transfer of funds on your site.

This section covers the anatomy of the ShareASale sale tracking pixel. The location on your site to install the tracking pixel is discussed in the section below.

The most basic pixel configuration for tracking these events allows ShareASale to record each with a separate tracking ID and order amount. A basic sale tracking pixel will resemble the example code below (a 1x1 'pixel'-sized <img> and secondary <script> underneath):

<img id='_SHRSL_img_1' src='https://www.shareasale.com/sale.cfm?tracking=OrderID&amount=AA.BB&merchantID=XXXXX&v=dev1.5&transtype=sale' width='1' height='1'> <script src='https://www.dwin1.com/!!!!!.js' type='text/javascript' defer='defer'></script>

In the above pixel example, the following <img src='…'> tracking parameters are static and should be the same for all orders. The bold section (below) is the value.

merchantID=XXXXX

Your Merchant ID (XXXXX), which can be found in the top left corner of your ShareASale account.

transtype=sale

The transtype parameter is simply set to ‘sale’ for all sale tracking pixels. Tracking leads is covered in a different document.

‘!!!!!’

Where !!!!! is your Master Tag ID. Replace the !!!!!! in the code with your Master Tag ID.

For merchants in the Setup Wizard, you can find this within Step 4 (Tracking Code Installation).

For live merchants, you can find this by navigating to MY ACCOUNT > ACCOUNT DETAILS
Account Details: https://account.shareasale.com/m-account.cfm

If you cannot locate your Master Tag ID, or would like to verify that you have one, please submit a ticket to our ShareASale support staff.

In addition to the two static tracking parameters above, the pixel must include two dynamically populated tracking variables:

tracking=OrderID

The tracking parameter must always be populated with a unique record locator. The value reported here should be able to be used to locate records in your system if there is a discrepancy in the tracking data recorded by ShareASale or more likely, if you need to cancel or edit a sale commission (e.g. customer returns).

amount=AA.BB

The amount parameter must be passed with a non-zero amount formatted to two decimal places. This value should be the order subtotal after discounts, but before any taxes or shipping are added.

Note: Dynamically populating <img> tracking pixel parameters is accomplished through macros, variables, and/or data layer attributes your cart system or tag manager provide. They’re always delimited by an ampersand (&parameter1=value1&parameter2=value2).

Speak to your tech/dev team if you are unsure how to populate any of the documented tracking parameters.

Product Level Tracking

Product Level Tracking can be configured using the skulistpricelist, and quantitylist parameters as noted below. All three parameters must be passed together, and their values must be URL-encoded.

skulist=SKU1,SKU2

The skulist parameter passes a comma-delimited list of the SKUs of each line-item in the cart.

pricelist=PRICE1,PRICE2

The pricelist parameter passes a comma-delimited list of the Prices of each line-item in the cart.

quantitylist=Quantity1,Quantity2

The quantitylist parameter passes a comma-delimited list of the quantities of each line-item in the cart.

NOTE: Pricelist parameters should reflect each items price after discounts, before taxes and shipping. All pricelist values multiplied by their respective quantitylist values and summed should equal the amount parameter’s value.

Coupon Code Tracking

The ShareASale tracking pixel can be configured to track coupon codes for exclusive commission attribution to specific Affiliates and to control commission amounts based on coupon usage. To do so, append the couponcode parameter formatted as noted below.

couponcode= COUPON1,COUPON2

Replace COUPON1,COUPON2 with the comma-delimited list of coupon(s) used in an order by the customer. This example had two coupon codes used.

Customer Status Tracking

The ShareASale tracking pixel can be configured to track customer status using the newcustomer parameter. This is often used to award a higher commission for new customer referrals.

newcustomer= X

Replace X with either

1 – If the customer is a new customer

0 – If the customer is not a new customer

No Value – If the customer status is unknown (e.g. guest checkouts)

The newcustomer parameter should be set based on one or more common values, such as the customer’s email address, previous orders count, etc. and toggled based on whether a previous transaction has occurred with those same values.

Stores Connect

The ShareASale tracking pixel can be configured to track data from more than one store/site per account using our StoresConnect feature. In order to for additional stores to qualify for StoresConnect, we require the following:

  1. Each site must fall into the same ShareASale Category. The products or stores must be similar enough to each other that they would share the same affiliate base. For example, if you have a site that sells clothes and another that provides financial services, these would need to be separate accounts.

  2. A $200 fee for each additional store you add to your program.

  3. The sites must be distinct brands. Typically this means the domains should at least be different. For example, www.example.com and www.site.com would qualify. Regional sites for the same brand would not fall into this category: www.example.com, eu.example.com, and www.example.co.uk would be considered as one store. You can add ShareASale tracking to regional sites free of charge. If you’d like to add an identifier to these sites for reporting purposes, see the xtype= parameter below.

storeid= X

Replace X with the ID of the store that this pixel will be installed in.

If you have not already set up StoresConnect and would like to, please contact our support team at ShareASale@ShareASale.com

Situational Tracking Parameters

In addition to the parameters in the section above, it is also possible to pass additional data related to the order into the ShareASale system. Each of these parameters can be appended to the pixel string with standard query string ampersands (&).

currency=ABC

Replace ABC with the three letter ISO-4217 currency code for the currency used by the customer, i.e. EUR for Euros, GBP for British Pounds, USD for US Dollars.

xtype=type

The Merchant Defined Type can be used to pass a value for type which can then be accessed from Tools >> Commission Rules to create particular commission structures. This is useful if there is data ShareASale should receive that does not neatly fit into another parameter’s purpose.

persale=T

If necessary, a commission rate override for this sale transaction. This override can still be overridden by other higher commission arrangements such as Product-Level, or Commission Rules. Values of T should be numbers, and will be interpreted as either a percentage or flat amount based on your account's program default commission setting.

autovoid=V

The autovoid parameter can be appended and set to 1 in order to allow a record to be recorded in ShareASale but not pay any commission to the Affiliate. This should only be used in multi-network tracking situations. Please contact our support team for further information.

pendingdate=mm/dd/yyyy

The ShareASale pendingdate parameter allows you to set the minimum lock date for a transaction. The goal is to ensure that you can void or edit sales tracked within ShareASale up until the revenue from that sale is realized. Contact our support team to enable.

 Ex. &pendingdate=06/25/2018

 You will then be able to edit or void that transaction within ShareASale up until the 20th of the month following the date specified (i.e. 7/20/2018 above). The date specified must be in the future, or the parameter will be ignored.


Install the Tracking Code

Now that the ShareASale conversion tracking pixel’s various parameters are covered, we’ll need to install it in the right place on your site.

1. Find the file, template, or section of your cart admin that allows you to customize the site’s checkout 'thank-you' receipt page.

  • It should be the page immediately after finishing a sale purchase on your site.

  • Make sure to find the page or place that only displays content once after finishing an order, and not again later like the order status, order history, email confirmation, etc.

  • If you’re editing a file that is part of your site’s checkout, be sure to back it up beforehand.

2. Place the tracking pixel code within the HTML <body></body> of the checkout 'thank-you' receipt page.

  • Be careful not to accidentally place the code inside another existing section of code that might become broken.

  • Don’t place it within any <noscript> tags. These only execute if JavaScript is disabled in the browser (rare for users).

  • Some carts require you clear a cache or re-publish any changes you make to files. Double-check with your cart’s expert.

  • Make sure the secondary <script src='https://www.dwin1.com/!!!!!.js' type='text/javascript' defer='defer'></script> tag is underneath the pixel <img> tag being populated with order data.

Master Tag Installation

ShareASale requires a second tag that should be embedded on every page of your site. Usually this is accomplished by including the tag in a common global file, like the header or footer template. Alternatively, cart systems will often have a dedicated spot in their admin for including code like this, as it’s fairly commonly required for analytics platforms like Google Analytics.

This second tag (code provided below) watches for any ?sscid= query string parameter in the landing page URLs of your site, indicating ShareASale Affiliate traffic. If it’s present, it stores the parameter’s value as a cookie under your domain too. Later this cookie’s value is retrieved and passed to our tracking pixel. It enhances tracking in certain browsers like Safari or more restrictive user settings scenarios.

<script src='https://www.dwin1.com/!!!!!.js' type='text/javascript' defer='defer'></script>

Where !!!!! is your Master Tag ID. Replace the !!!!!! in the code with your Master Tag ID.

For merchants in the Setup Wizard, you can find this within Step 4 (Tracking Code Installation).

For live merchants, you can find this by navigating to MY ACCOUNT > ACCOUNT DETAILS
Account Details: https://account.shareasale.com/m-account.cfm

If you cannot locate your Master Tag ID, or would like to verify that you have one, please submit a ticket to our ShareASale support staff.

  1. Find the file, template, or section of your cart admin that allows you to place code that will be included on 

every page of the site.

  • The best place is the HTML <head></head> section, if possible.

  • Just install it once, not multiple times (i.e. not the header and footer by mistake).

  • If you’re editing a common global file for your site, make sure you’re editing the right one for your theme. Often carts can have multiple themes/skins, and if you change you will need to re-integrate the master tag on that new theme too.

  1. Place the master tag code so that it appears on every page of your site. Congratulations! Installation is now complete. 

Testing

Now that your tracking tags have been installed, we will need to test that everything is working as expected. To do this, we’ll simulate an Affiliate referred purchase by clicking a ShareASale test link and then running a purchase on your store. If the test is successful we’ll see a record appear in your ShareASale console, which we will VOID so that it doesn’t debit commissions from your account.

If you were emailed a link to this document, a test link may have been provided to you. If it wasn’t, you can obtain one from your account by clicking here.

NOTE: If you do not click the test link your order will not track.

The test link should direct you to your own store. Once there, please purchase any item in your store. Sometimes Merchants will have a test item worth $1.00 sale price, but above $0.00 minimum.

After the purchase is complete, navigate to www.shareasale.com in your browser and log into your account. Click Reports and then click Transaction Details from the drop-down menu.

Filter the report for Affiliate ID 178 using the panel on the left. The filtered view should now show your test purchase as an entry with today’s date.

If the order tracked successfully…

Your account is now ready to use ShareASale with your store. Please contact us at ShareASale@ShareASale.com for further information about:

  • Product specific commissions (offer different commissions by product)

  • New customer incentives (offer commission bonuses for new customers)

  • Exclusive coupon codes (used for tracking conversions without link clickthrough)

If the order does not show up in the Transaction Details Report…

Please verify that you have completed all of the steps as instructed. Common mistakes include not entering the correct Merchant ID in your tracking code and forgetting to click the test link.

If after verifying all of these steps your tracking still does not work please contact our support team at ShareASale@ShareASale.com.

 

Copyright ShareASale 2021