Last active
September 8, 2021 15:28
-
-
Save kmclaugh/b7a367b62b02010906630d3676cbdd1c to your computer and use it in GitHub Desktop.
Pressed data layer changes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// just need to add products to the current setup | |
{ | |
event: "checkoutContactStep | checkoutPaymentStep | checkoutReviewStep", | |
ecommerce: { | |
checkout: { | |
actionField: { | |
step: "{{checkout.step}}", // 1 // The checkout step (starting at 1). | |
}, | |
products: [ | |
{ | |
id: "{{ product.id }}", | |
name: "{{product.title}}", | |
quantity: "{{product.quantity}}", | |
price: '{{product.price}}', | |
}, | |
], | |
}, | |
}, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
event: "membershipCancel", | |
membership: { | |
previousLevel: "{{previousLevel}}", | |
amount: "{{amount}}", | |
membershipId: "{{membershipId}}", // ? | |
}, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
event: "membershipSignup", | |
membership: { | |
level: "{{level}}", // vip or member | |
amount: "{{amount}}", // $0 or $10+ | |
membershipId: "{{membershipId}}", // ? | |
}, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
event: "membershipUpgrade", | |
membership: { | |
level: "vip", | |
amount: "{{amount}}", | |
membershipId: "{{membershipId}}", | |
}, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
event: "productDetail", | |
ecommerce: { | |
detail: { | |
products: [ | |
{ | |
id: "{{ product.id }}", | |
name: "{{product.title}}", | |
quantity: "{{product.quantity}}", | |
price: '{{product.price}}', | |
}, | |
], | |
}, | |
}, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
event: "purchase", | |
ecommerce: { | |
currencyCode: "USD", | |
fulfillmentMethod: "{{fullfilment_method}}", // pressed post, etc | |
fulfillmenttType: "{{fullfilment_type}}", // ? | |
visitorType: "{{visitorType}}", // guest, member, etc | |
loyaltyPoint: "{{loyaltyPoint}}", | |
purchase: { | |
actionField: { | |
id: "{{checkout.order_number}}", // 12345 // The order number or transaction id | |
revenue: '{{checkout.total_price}}', // 11.00 // the total transaction value | |
tax: '{{checkout.tax_price}}', // 1.0 // the tax paid | |
shipping: '{{checkout.shipping_price}}', // 2.0 // cost of shipping | |
coupon: "{{discount.code}}", // SUMMER2020 // the discount code used | |
}, | |
products: [ | |
{ | |
id: "{{ product.id }}", | |
name: "{{product.title}}", | |
quantity: "{{product.quantity}}", | |
price: '{{product.price}}', | |
upsell: true // this needs to persist all the way the checkout and purchase | |
}, | |
], | |
}, | |
}, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
event: "reloadLoyalty", | |
membership: { | |
level: "{{level}}", | |
amount: "{{amount}}", // amount reloaded | |
membershipId: "{{membershipId}}", // | |
}, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
event: "removeFromCart", | |
ecommerce: { | |
remove: { | |
products: [ | |
{ | |
id: "{{ product.id }}", // product that was removed | |
name: "{{product.title}}", | |
quantity: "{{product.quantity}}", // quantity that was removed | |
price: '{{product.price}}', | |
}, | |
], | |
}, | |
}, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
event: "addToCart", | |
ecommerce: { | |
add: { | |
actionField: { | |
list: "{{collection.title}} || cart", // 'fall collection' // Where the add to cart happened. use 'cart' if the removal happened on the cart page | |
}, | |
products: [ | |
{ | |
id: "{{ product.id }}", | |
name: "{{product.title}}", | |
quantity: "{{product.quantity}}", | |
price: '{{product.price}}', | |
upsell: true // this needs to persist all the way the checkout and purchase | |
}, | |
], | |
}, | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment