- Subscribe to RSS Feed
- Mark Thread as New
- Mark Thread as Read
- Float this Thread for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
I am attempting to set up a GTM datalayer on the checkout page for square.online. It gives me a list of variables that I can use on the "Tracking Tools" page in the admin. They are:
You can use the following variables to fill in order details:
- {txid} - Transaction id
- {orderid} - Square Order id or order token
- {storeName} - Store name
- {tax} - Tax value
- {shipping} - Shipping value
- {subtotal} - Order subtotal value
- {total} - Total order value
- {name} - Customer name
- {email} - Customer email
- {items} - Order items
But when I add them to my code the only one that gets populated is `storeName`. Here is the code I am attempting to add:
window.dataLayer = window.dataLayer || [];
dataLayer.push({
'event': 'purchase',
'storeName': '{storeName}',
'txid': {txid},
'orderid': {orderid},
'name': '{name}',
'email': '{email}',
'total': {total},
'subtotal': {subtotal},
'shipping': {shipping},
'tax': {tax},
'transactionProducts': {items}
});
Am I not adding them correctly? It seems like I am since the storeName does get correctly populated, but none of the other variables. Do I need to turn them on in some manner? Sorry the documentation is extremely spartan on this topic.
- Labels:
-
Square Online
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report
Bumping this up as I'm interested in know this, too.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report
Hello @CourageCalling and welcome to the Seller Community.
Wanted to reply here so your first post didn't fall through the cracks. Your best luck getting an answer to this complex question, will be at our Developer Forums. While some of our Sellers may know a bit of programming. Most of them are Sellers/Business Owners and not dedicated developers like you.
When you have a moment take a peek at our Developer Forums and ask away.
Community Moderator, Square
Sign in and click Mark as Best Answer if my reply answers your question.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report
Bumping again, this is a real issue and no one is clarifying it on the developer forums. Did you find the solution @farlandlee ?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report