googleanalytics / ecommerce-migration-helper Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
Send following to the migration helper tool
{
event: "purchase",
ecommerce: {
transaction_id: "12345",
value: 25.42,
tax: 4.9,
shipping: 5.99,
**currency**: "USD",
coupon: "SUMMER_SALE",
items: [
{
item_id: "SKU_12345",
item_name: "Stan and Friends Tee",
affiliation: "Google Merchandise Store",
coupon: "SUMMER_FUN",
currency: "USD",
discount: 2.22,
index: 0,
item_brand: "Google",
item_category: "Apparel",
item_category2: "Adult",
item_category3: "Shirts",
item_category4: "Crew",
item_category5: "Short sleeve",
item_list_id: "related_products",
item_list_name: "Related Products",
item_variant: "green",
location_id: "ChIJIQBpAG2ahYAR_6128GcTUEo",
price: 9.99,
quantity: 1
},
{
item_id: "SKU_12346",
item_name: "Google Grey Women's Tee",
affiliation: "Google Merchandise Store",
coupon: "SUMMER_FUN",
currency: "USD",
discount: 3.33,
index: 1,
item_brand: "Google",
item_category: "Apparel",
item_category2: "Adult",
item_category3: "Shirts",
item_category4: "Crew",
item_category5: "Short sleeve",
item_list_id: "related_products",
item_list_name: "Related Products",
item_variant: "gray",
location_id: "ChIJIQBpAG2ahYAR_6128GcTUEo",
price: 20.99,
quantity: 1
}
]
}
}
"Google Analytcis 4" results is
Product 1
item_id: SKU_12345
item_name: Stan%20and%20Friends%20Tee
affiliation: Google%20Merchandise%20Store
coupon: SUMMER_FUN
undefined: USD
discount: 2.22
index: 0
item_brand: Google
item_cateogry: Apparel
item_category2: Adult
item_category3: Shirts
item_category4: Crew
item_category5: Short%20sleeve
item_list_id: related_products
item_list_name: Related%20Products
item_variant: green
Location ID: ChIJIQBpAG2ahYAR_6128GcTUEo
price: 9.99
quantity: 1
Product 2
item_id: SKU_12346
item_name: Google%20Grey%20Women%27s%20Tee
affiliation: Google%20Merchandise%20Store
coupon: SUMMER_FUN
undefined: USD
discount: 3.33
index: 1
item_brand: Google
item_cateogry: Apparel
item_category2: Adult
item_category3: Shirts
item_category4: Crew
item_category5: Short%20sleeve
item_list_id: related_products
item_list_name: Related%20Products
item_variant: gray
Location ID: ChIJIQBpAG2ahYAR_6128GcTUEo
price: 20.99
quantity: 1
Additional Parameters:
transaction_id: 12345
value: 25.42
tax: 4.9
shipping: 5.99
coupon: SUMMER_SALE
for Universal Analytics (with GA4 Support" the result is OK.
When I send this:
{
"transaction_id": "09erdxiojaoidw0e9",
"affiliation": "Frutacor",
"value": 78,
"currency": "BRL",
"shipping": 18,
"items": [{
"id": "product['_id']",
"name": "product.name",
"category": "product.category.name",
"quantity": 1,
"price": 60
}]
}
It suggests me this
gtag('event', 'purchase', {
'transaction_id': '09erdxiojaoidw0e9',
'affiliation': 'Frutacor',
'value': '78',
'shipping': '18',
'items': [
{
'item_id: 'product%5B%27_id%27%5D',
'item_name: 'product.name',
'item_cateogry: 'product.category.name',
'quantity: '1',
'price: '60',
},
],
});
item_category
is spelled as item_cateogry
.
Also, the documentation shows affiliation should be at item level, not purchase level
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.