This is an example of an Offerpop tracking pixel that tracks product views and records the item name, sku and price for the pixel.


It looks for the value of the html inside the ID of the required variables.

 

<script type="text/javascript">
//
// Get Product ID   replace IDGOESHERE
//
var productIdElement = document.getElementById("IDGOESHERE"),
    productId = productIdElement.innerText;
//
//Get Description replace NAMEGOESHERE
//
var descriptionElement = document.getElementById("NAMEGOESHERE"),
    prodDescription = descriptionElement.innerText;
//
//Get Sales Price replace PRICEGOESHERE
//
var valueElement = document.getElementById("PRICEGOESHERE"),
    valueWithCurrency = valueElement.innerText,
    value = valueWithCurrency.replace("£", "");


OPPixelInfo = {
    hash: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    type: "product_view",
    product_id: "productId",
    product_description: "prodDescription",
    product_list_price: "value"
};
var e = document.createElement("script");
e.src = "https://offerpop.com/js/pixel.js";
e.async = true;
document.body.appendChild(e);

document.getElementById("demo").innerHTML = value;
</script>

 

NB: This is an example and may require modification to work