Skip to content

Instantly share code, notes, and snippets.

@ceaksan
Last active July 15, 2023 11:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ceaksan/f0df7487e7e5e8c969c6d0ea9f2ce690 to your computer and use it in GitHub Desktop.
Save ceaksan/f0df7487e7e5e8c969c6d0ea9f2ce690 to your computer and use it in GitHub Desktop.
dataLayer.push({
event: "productImpression",
origin: "Stores",
event_category: "Enhanced Ecommerce - Stores",
ecommerce: {
impressions: [
{
id: "85b88ed8-d2bf-491c-bbd5-9ea60c2dc2b4",
name: "Bu bir ürün",
list: "Slider Gallery",
category: "All Products",
position: 0,
price: 80.75,
currency: "TRY",
dimension3: "in stock"
}, {
//...
}
]
}
});
dataLayer.push({
event: "productClick",
origin: "Stores",
event_label: "Bu bir ürün",
event_category: "Enhanced Ecommerce - Stores",
ecommerce: {
click: {
actionField: { list: "Grid Gallery" },
products: [
{
id: "73fe33fb-4a89-4b12-916d-83f0ef347bee",
name: "Bu bir ürün",
category: "All Products",
position: 1,
price: 20,
currency: "TRY",
type: "physical",
sku: "364215375135191"
}
]
}
}
});
dataLayer.push({
event: "viewContent",
origin: "Stores",
event_label: "Bu bir ürün",
event_category: "Enhanced Ecommerce - Stores",
ecommerce: {
detail: {
actionField: { list: "(not set)" },
products: [
{
category: "All Products",
id: "73fe33fb-4a89-4b12-916d-83f0ef347bee",
name: "Bu bir ürün",
price: 20,
currency: "TRY",
sku: "364215375135191",
type: "physical"
}
]
}
}
});
dataLayer.push({
event: "addToCart",
origin: "Stores",
event_label: "Bu bir ürün",
event_category: "Enhanced Ecommerce - Stores",
ecommerce: {
add: {
products: [
{
category: "All Products",
currency: "TRY",
id: "73fe33fb-4a89-4b12-916d-83f0ef347bee",
quantity: 1,
name: "Bu bir ürün",
sku: "364215375135191",
price: 20,
type: "physical"
}
]
}
}
});
dataLayer.push({
event: "removeFromCart",
origin: "Stores",
event_label: "Bu bir ürün",
event_category: "Enhanced Ecommerce - Stores",
ecommerce: {
remove: {
products: [
{ name: "Bu bir ürün", category: "All Products", price: 20, currency: "TRY", quantity: 1 }
]
}
}
})
dataLayer.push({
event: "checkout",
origin: "Stores",
event_category: "Enhanced Ecommerce - Stores",
ecommerce: {
checkout: {
actionField: {},
products: [
{
id: "73fe33fb-4a89-4b12-916d-83f0ef347bee",
name: "Bu bir ürün",
category: "All Products",
price: 20,
currency: "TRY",
quantity: 1
}
]
}
}
});
dataLayer.push({
event: "checkoutOption",
origin: "Stores",
event_category: "Enhanced Ecommerce - Stores",
ecommerce: { checkout_option: { actionField: { step: 1 } } }
});
dataLayer.push({
event: "checkoutOption",
origin: "Stores",
event_category: "Enhanced Ecommerce - Stores",
ecommerce: { checkout_option: { actionField: { step: 2, option: "offline" } } }
});
dataLayer.push({
event: "purchase",
origin: "Stores",
event_category: "Enhanced Ecommerce - Stores",
ecommerce: {
purchase: {
actionField: {
id: 10014,
revenue: 73.6,
tax: 3.6,
shipping: 50,
buyer_email: "d2f95860432291bc8cb1e10c95b56bbb"
},
products: [
{
id: "73fe33fb-4a89-4b12-916d-83f0ef347bee",
sku: "364215375135191",
name: "Bu bir ürün",
price: 20,
quantity: 1,
currency: "TRY",
category: "All Products"
}
]
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment