<img alt="" src="https://secure.gift2pair.com/211594.png" style="display:none;">
Download free guide | Navigating customer acquisition challenges in 2024 🛍

The purpose of this guide is to guide you through the correct way to implement the preezie Analytics Pixel code on your website. To accomplish that there are two necessary steps to take:

  • Plug in the initialisation code
  • Generate the properly formatted transaction tracking code

Initialising the pixel code

Initialisation is easy. Simply paste the following into the <head> section of your Thank You page

<script>
!function (e, t, n, p, r, s) { e.prz || ((p = e.prz = function () { p.process ? p.process.apply(p, arguments) : p.queue.push(arguments) }).queue = [], p.t = +new Date, (r = t.createElement(n)).async = 1, r.src = "https://preeziecdn.azureedge.net/production/prz_pixel.min.js?t=" + 864e5 * Math.ceil(new Date / 864e5), (s = t.getElementsByTagName(n)[0]).parentNode.insertBefore(r, s)) }(window, document, "script"),
prz("init", "YOUR_PREEZIE_ID");
</script>

You can find the code snippet with your preezie id by going to the workflow drop-down menu and selecting "Code snippet".

The pixel code utilises beacons where applicable or reverts to a standard pixel gif depending on the clients browser version.


Setting up transaction tracking

To properly track transactions a json payload containing the basic product info must be generated in the back end and appended to the <head> section of the thank you page. This part is platform specific and requires some development effort, but most e-Commerce platforms provide an easy way to get the data to the page by reserving variables with product data for use in template editing.
The final result should look like this:

<script>
prz("event", "transaction", '{"products": [{"productId": "SKU1", "productName":"product1", "quantity":1, "price":10.99},]}');
</script>

 

Field definitions:

Property Type Description
productId String The unique identifier of the product. Must be equal to the id sent to preezie via the import API
productName String Name of the purchased product
quantity Integer Quantity of the purchased product
price Decimal Single item price

 

 

 

 

 

Shopify specific implementation

Use the following code in the custom code section in checkout settings:

{% if first_time_accessed %}



{% endif %}