Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Note

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.

...

Paste the below code into this box.

Info
Replace “XXXXX”

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.

Info

Replace the !!!!!! in the code below with your Master Tag ID (Line 53).

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.

Code Block
<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/19038!!!!!.js" type="text/javascript" defer="defer"></script>

...

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

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.

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

...

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.

...