Skip to content

Instantly share code, notes, and snippets.

View elephantsneverforget's full-sized avatar

Jonathan Cairo elephantsneverforget

View GitHub Profile
rD = false;
function edcTimeout() {
rD = true;
}
function cto_AI(u, n) {
if (rD) {
return;
}
var cto_ifr = document.getElementById('cto_sub_ifr_px');
var cto_ifr_doc = null;
{
"event": "dl_begin_checkout",
"event_id": "3a2be9ba-9b13-4dd7-b62c-75810a933e76",
"ecommerce": {
"currencyCode": "USD",
"checkout": {
"actionField": {
"step": "1",
"action": "checkout"
},
<!--- Elevar Base Data Layer ----!>
// Should fire on every page load event
{% if customer %}
window.dataLayer.push({
"event": "dl_user_data"
"event_id": {{ uuid }} // unique uuid for FB conversion API
"cart_total": "{{ cart.total_price }}",
"user_properties": {
"visitor_type": "logged_in",
usi_installed = 0; USI_installCode = function() { if (usi_installed == 0) { usi_installed = 1; var USI_headID = document.getElementsByTagName("head")[0]; var USI_installID = document.createElement('script'); USI_installID.type = 'text/javascript'; USI_installID.src = 'https://www.upsellit.com/active/beam.jsp'; USI_headID.appendChild(USI_installID); } }; if (typeof(document.readyState) != "undefined" && document.readyState === "complete") { USI_installCode(); } else if (window.addEventListener){ window.addEventListener('load', USI_installCode, true); } else if (window.attachEvent) { window.attachEvent('onload', USI_installCode); } else { USI_installCode(); } setTimeout("USI_installCode()", 10000);
note_attributes": [
{
"name": "_elevar__ga",
"value": "GA1.2.1267164758.1642003970"
},
{
"name": "_elevar__ga_MFQR8SPE64",
"value": "GS1.1.1642110563.5.1.1642111251.0"
},
{
// This object removes extraneous data being appended from the SSC. We will not have GA data to pull the information used in the existing tag
// We can use a UUID to identify customers when not logged in, and if the client logs in we can use the shopify id instead for the user_id variable
// You are currently sending client_id which relies on GA data and we don't have this
// ip_override assuming this is just the ip of the user
const sampleViewItem = {
page_location:
"https://www.dermalogica.com.au/collections/sensitive-skin-products/products/calm-water-gel",
page_title: "Calm Water Gel For Sensitive Skin | — Dermalogica AU",
event_name: "view_item",
items: [
successful,ss_client_id,web_client_id,channel,event_name,page_url,consent,timestamp,order_id,revenue,currency,error_code,error_message,attempted_request,request_url,utm_source,utm_medium,utm_campaign,utm_content,utm_term,gclid,fbclid,customer_order_count,customer_total_spent,ignored
false,pearlofmyheart,Event Listener,TikTok,ViewContent,https://pearlofmyheart.com/products/bestmemories?ttclid=E.C.P.CogBVrxO9fNR_QyuoJ2CbQ2in-aBm2maxgXfjVlEL6Cl3v1GBSjuugiW9XM9Lp-inpaOQW_K8R_TB78af01ZZ-gd06NEsjjsRaHJEIbQ6YVWAiTeLlLhhMkK6MhTX8Q1O5dtK8TKVIjyhRjHuF5PqQx2hamm2U_17FRDdKHKSFHtcK54XKcOCZz7qxIEdjIuMBog3A4P294_a-ya-trxMYkFRz7qyu1NWq2BemMUWZesk1Y,yes,2022-03-21T07:26:22.030Z,,,USD,50000,internal error,"{""pixel_code"":""C85O1JNV9S6R0CDU7VV0"",""event"":""ViewContent"",""event_id"":""0505e3fc-17f2-4b1a-829e-59d5068f61d6_0505e3fc-17f2-4b1a-829e-59d5068f61d6"",""timestamp"":""2022-03-21T07:26:20.555Z"",""context"":{""ad"":{},""page"":{""url"":""https://pearlofmyheart.com/products/bestmemories?ttclid=E.C.P.CogBVrxO9fNR_QyuoJ2C
successful,ss_client_id,web_client_id,channel,event_name,page_url,consent,timestamp,order_id,revenue,currency,error_code,error_message,attempted_request,request_url,utm_source,utm_medium,utm_campaign,utm_content,utm_term,gclid,fbclid,customer_order_count,customer_total_spent,ignored
false,pearlofmyheart,Event Listener,TikTok,ViewContent,https://pearlofmyheart.com/products/bestmemories?ttclid=E.C.P.CogBVrxO9fNR_QyuoJ2CbQ2in-aBm2maxgXfjVlEL6Cl3v1GBSjuugiW9XM9Lp-inpaOQW_K8R_TB78af01ZZ-gd06NEsjjsRaHJEIbQ6YVWAiTeLlLhhMkK6MhTX8Q1O5dtK8TKVIjyhRjHuF5PqQx2hamm2U_17FRDdKHKSFHtcK54XKcOCZz7qxIEdjIuMBog3A4P294_a-ya-trxMYkFRz7qyu1NWq2BemMUWZesk1Y,yes,2022-03-21T07:26:22.030Z,,,USD,50000,internal error,"{""pixel_code"":""C85O1JNV9S6R0CDU7VV0"",""event"":""ViewContent"",""event_id"":""0505e3fc-17f2-4b1a-829e-59d5068f61d6_0505e3fc-17f2-4b1a-829e-59d5068f61d6"",""timestamp"":""2022-03-21T07:26:20.555Z"",""context"":{""ad"":{},""page"":{""url"":""https://pearlofmyheart.com/products/bestmemories?ttclid=E.C.P.CogBVrxO9fNR_QyuoJ2C
{
"page_url": "https://www.dermalogica.com.au/43224826023/orders/78930ec53bc16fc05eeaa8570aca668a/authenticate?key=98981af2f8418e38cd384102347ef7d9",
"partner_id": "93743",
"mapping_key": "515",
"mapped_user_id": "0sdXcZHJL76leQWsoqAXrKzzm_FhruJ4",
"version": "criteo_sgtm_0.0.1",
"an": "com.dermalogica.sgtm",
"currency": "AUD",
"items": [
{
{
"Checkout": {
"Autocomplete": true,
"apiHost": "mommasshop1.myshopify.com",
"assetsPath": "//cdn.shopify.com/shopifycloud/shopify",
"DefaultAddressFormat": "{country}_{firstName}{lastName}_{company}_{address1}_{address2}_{city}{province}{zip}_{phone}",
"geolocatedAddress": {
"lat": 53.633399999999995,
"lng": -113.5239
},