Implementation Guide

When implementing Pixeleze, 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>
    function Pixeleze(pixelezeData)
    {
        var url = "https://pixeleze.com/run?PixelezeData=" + encodeURIComponent(JSON.stringify(pixelezeData));
        url += "&SourceUrl=" + encodeURIComponent(window.location.href);
        url += "&Cookies=" + encodeURIComponent(document.cookie.replace(/(\s|^)(?!Pixeleze).+?=.+?(;|$)/g, ""));
        var ref = document.getElementsByTagName("script")[0];
        var js = document.createElement("script");
        js.src = url;
        js.async = true;
        ref.parentNode.insertBefore(js, ref);
    }

    var pixelezeData = pixelezeData || {};
    pixelezeData.AccountId = "00000000-0000-0000-0000-000000000000";
    Pixeleze(pixelezeData);
    </script>

				

Confirmation Page Implementation

On the order confirmation page (aka "Thank You" or "Success" page) a few additional variables are required. The script on your order confirmation page should look something like this:


    <script>
    function Pixeleze(pixelezeData)
    {
        var url = "https://pixeleze.com/run?PixelezeData=" + encodeURIComponent(JSON.stringify(pixelezeData));
        url += "&SourceUrl=" + encodeURIComponent(window.location.href);
        url += "&Cookies=" + encodeURIComponent(document.cookie.replace(/(\s|^)(?!Pixeleze).+?=.+?(;|$)/g, ""));
        var ref = document.getElementsByTagName("script")[0];
        var js = document.createElement("script");
        js.src = url;
        js.async = true;
        ref.parentNode.insertBefore(js, ref);
    }

    var pixelezeData = pixelezeData || {};
    pixelezeData.AccountId = "00000000-0000-0000-0000-000000000000";
    pixelezeData.OrderId = "1234";
    pixelezeData.OrderTotal = 19.99;
    pixelezeData.PromoCode = "PROMO";
    pixelezeData.Discount = 10.50;
    pixelezeData.Products = [
        {
            ProductId: "1",
            ProductName: "Product 1",
            ProductPrice: 19.99,
            ProductQuantity: 2,
            ProductCategory: "misc",
        },
        {
            ProductId: "2",
            ProductName: "Product 2",
            ProductPrice: 600,
            ProductQuantity: 1,
            ProductCategory: "misc",
        },
    ];
    Pixeleze(pixelezeData);
    </script>

				

Your code will, of course, use your actual OrderId, OrderTotal, and Coupon Code values. Do not include taxes or shipping.









Updated June, 2020