Problem/Motivation
Was researching how to do this until I found this module, one difference I found from the docs was the structure of the transaction.
The docs point to doing it this way with an actionField:
https://developers.google.com/tag-manager/enhanced-ecommerce#purchases
dataLayer.push({
'ecommerce': {
'currencyCode': 'USD',
'purchase': {
'actionField': {
'id': 'ORDERNUMBER',
'revenue': '32.00',
'tax':'0',
'shipping': '0',
'coupon': 'FREESHIPPING'
},
'products': [
{
'name': 'Masque',
'id': 'SKU',
'price': '32.00',
'category': 'Masques',
'variant': 'Retail',
'quantity': 1
}
]
}
}
});
Proposed resolution
Wondering if it should change or maybe a checkbox to toggle between the two. FWIU it may be related to that "enhanced ecommerce" bit.
Remaining tasks
- Create patch
- Review patch
- Commit
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | interdiff.txt | 4.25 KB | joelpittet |
| #5 | administration.png | 103.41 KB | parisek |
| #5 | allow_enhanced-2529278-5.patch | 6.69 KB | parisek |
Comments
Comment #1
joelpittetOk it's actually a subtly different format:
http://www.simoahava.com/analytics/ecommerce-tips-google-tag-manager/#tip5
Comment #2
joelpittetHere's what I was thinking. Let me know if this is something you'd be keen on including in your module or not?
Comment #3
joelpittetWhoops a typo in that one, ; vs ,
Comment #4
joelpittetThis should be good now;)
Comment #5
parisekjoelpittet: Thank you for your contribution, I made few changes to better inform administration users about configuration possibilities, please review.
Comment #6
joelpittetHere is an interdiff between the two help review the changes.
@see https://www.drupal.org/documentation/git/interdiff
Comment #7
joelpittetPersonal preference?
These changes look good:) THanks
Comment #8
parisekSorry I forgot interdiff :)
I don't know this shorthand version of ternary operator, but it's PHP 5.3+ thing and Drupal 7 requirement is PHP 5.2.5 or higher so I keep it old way.
Comment #10
parisekComment #11
joelpittetOh yeah people still care about 5.2 :D