Installation Guide

When implementing Click Attribution, you'll need to place a piece of JavaScript code on every page of your website.

Sitewide Implementation

The code should be placed in the HEAD tag of each page.

                    
<script>
    var clickAttributionData = clickAttributionData || {};
    clickAttributionData.MerchantId = "YOUR_MERCHANT_ID";
</script>
<script async src="https://clickattribution.com/scripts/v2/path-to-purchase.min.js"></script>
                    
				

Confirmation Page Implementation

On the order confirmation page (aka "Thank You" or "Success" page) a few additional variables are required. Put this code right before your closing </body> tag.

                    
<script>
    var clickAttributionSalesData = clickAttributionSalesData || {};
    clickAttributionSalesData.MerchantId =  "YOUR_MERCHANT_ID";
    clickAttributionSalesData.OrderId = "1114"; //a unique id for every order/sale
    clickAttributionSalesData.OrderTotal = "$123.45";
    clickAttributionSalesData.Products = [
        {
            ProductId: "1",
            ProductName: "Product 1",
            ProductPrice: 19.99,
            ProductQuantity: 2,
        },
        {
            ProductId: "2",
            ProductName: "Product 2",
            ProductPrice: 100,
            ProductQuantity: 1,
        },
    ];
</script>
<script src="https://clickattribution.com/scripts/v2/sale.min.js"></script>
                    
				

Your code will, of course, use your actual OrderId, OrderTotal.