Order Data Layer attributes not loading on checkout_cart_index
willfrombrazil opened this issue · comments
Magento CE v2.1.7
magepal/magento2-googletagmanager v2.0.2
On /checkout/onepage/success/ the only data layer attributes I'm receiving are:
`<script type="text/javascript">
| window.dataLayer = window.dataLayer || [];
| dataLayer.push({"ecommerce":{"currencyCode":"BRL"},"pageType":"checkout_cart_index","list":"cart","customer":{"isLoggedIn":false},"cart":{"hasItems":false}});
| </script>`
Shouldn't this page list the following data layer attributes as well?
Order
transactionId
transactionAffiliation
transactionTotal
transactionShipping
transactionTax
transactionCouponCode
transactionDiscount
transactionSubTotal
transactionProducts[].sku
transactionProducts[].name
transactionProducts[].price
transactionProducts[].quantity
Take a look at #15
You are viewing the cart page and not the order success page
In our case an array in an array was made in MagePal\GoogleTagManager\Model\Order, I changed $result[] = $transaction; to $result = $transaction; which worked for us
$result[] = $transaction; should be correct ... for muliti-shipping orders
@srenon thanks for the info. I've confirmed I'm on pageType: checkout_onepage_success.
Do you know why the transaction data layer information shows up on Tag Assistant Plugin but not on the Google Tag Manager preview tab?
What I'm trying to accomplish is to pass data layer information as User-Defined Variables on GTM, so I can add this info on CustomTags (eg: add transaction value and products to Facebook Conversion Pixels). But GTM isn't getting the transaction data variables:
Here's a video of the steps I'm taking: https://youtu.be/k9nRURoyqSo
@willfrombrazil ...
Please upgrade to 2.0.3 and let me know if you are still having issues.
Thanks for the detailed debugging information...
@willfrombrazil are you looking under the wrong event? Do you have a shared instance - then I can help you debug?
@willfrombrazil ... Are you still having issues?