ReCharge Tracking Setup

This guide is for merchants who have installed ReCharge on their site before November 2, 2020. If you did, the ReCharge App should be titled “ReCharge Checkout.” If you’ve installed it more recently, you will have “Subscriptions by ReCharge.” For the newer version, you can use the standard code for your main e-commerce platform (Shopify, BigCommerce, etc.)

If you do have ReCharge Checkout, ShareASale highly recommends that you upgrade your plan to ReCharge Pro. The standard plan will not allow ShareASale to track orders in Safari or Firefox. ReCharge Pro allows you to host the checkout under your own domain.

Note: You will also need to install the ShareASale tracking for Shopify if you are taking individual item orders, and not only recurring.

From your ReCharge Dashboard, click the wrench icon and select Checkout. Find the section labeled Additional Scripts.

Paste the below code into this box.

Replace XXXXX in the script below with your ShareASale Merchant ID (Line 3). You can find this at the top-left of your ShareASale account when you are logged in.

<script> // Set the ShareASale Merchant ID var sas_merchantID = "XXXXX"; // Extract the data from liquid and save it in a SAS Object var _sasDataLayer = { 'sasOrderId': '{{order_number}}', 'sasOrderDiscount': {{ total_discounts }}, 'sasOrderAmount': {{subtotal_price}}, 'sasOrderProducts': [ {% for item in line_items %} { 'sku': '{{item.sku}}', 'price': {{item.price}}, 'quantity': {{item.quantity}} }, {% endfor %} ], 'sasOrderCoupons':'{% if discount_code %}{{ discount_code }}{% endif %}' } // Format the data and print the ShareASale Pixel var sas_orderID = _sasDataLayer.sasOrderId; var sas_amount = _sasDataLayer.sasOrderAmount; if(_sasDataLayer.sasOrderDiscount > 0){ var sas_q = _sasDataLayer.sasOrderAmount / (_sasDataLayer.sasOrderAmount + _sasDataLayer.sasOrderDiscount); } var sas_products = { "skulist" : "", "pricelist" : "", "quantitylist" : "" }; var sas_couponCodes = _sasDataLayer.sasOrderCoupons; // Loop through sasOrderProducts and create Skulist, Pricelist, and Quantitylist for ( var i = 0 in _sasDataLayer.sasOrderProducts) { if(i == 0){ sas_products.skulist = _sasDataLayer.sasOrderProducts[i].sku; if(typeof(sas_q) != "undefined"){ sas_products.pricelist = (sas_q * _sasDataLayer.sasOrderProducts[i].price).toFixed(2); }else{ sas_products.pricelist = sas_products.pricelist + "," + parseFloat(_sasDataLayer.sasOrderProducts[i].price).toFixed(2); } sas_products.quantitylist = _sasDataLayer.sasOrderProducts[i].quantity; }else{ sas_products.skulist = sas_products.skulist + "," + _sasDataLayer.sasOrderProducts[i].sku; if(typeof(sas_q) != "undefined"){ sas_products.pricelist = sas_products.pricelist + "," + (sas_q * _sasDataLayer.sasOrderProducts[i].price).toFixed(2); }else{ sas_products.pricelist = sas_products.pricelist + "," + _sasDataLayer.sasOrderProducts[i].price.toFixed(2); } sas_products.quantitylist = sas_products.quantitylist + "," + _sasDataLayer.sasOrderProducts[i].quantity; } } {% if first_time_load %} //Create and print the pixel var sas_src = "https://shareasale.com/sale.cfm?merchantID=" + sas_merchantID + "&amount=" + sas_amount + "&tracking=" + sas_orderID + "&transtype=sale&v=recharge1.0&skulist=" + sas_products.skulist + "&quantitylist=" + sas_products.quantitylist + "&pricelist=" + sas_products.pricelist + "&couponcode=" + sas_couponCodes; // Create the parameter string and append it to the pixel target. var sas_Pixel = new Image(); // Create a new image tag. sas_Pixel.src = sas_src; // Set the src parameter of the image tag to the target parameter string. document.body.appendChild(sas_Pixel); // Append the newly created pixel to the body of the page. {% endif %} </script> <script src="https://www.dwin1.com/!!!!!.js" type="text/javascript" defer="defer"></script>

Save your changes.

Master Tag Installation

Next you will need to install the Master Tag. In your Shopify store’s admin page, click the Online Store button in the sidebar. Under Themes in the side bar, find the Actions drop-down menu on the right. Choose Edit Code from the drop-down menu.

Find your Shopify theme’s theme.liquid template file, usually under the Layout section. Click its name to edit it.

Find the closing </head> HTML tag, place your cursor in front of it, and create a new line.

In the new line just created, copy and paste the following script code.

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

Make sure you click Save in the top right corner of the page.

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