Created
August 5, 2022 10:09
-
-
Save prabapro/3c1a28b9164c04c5b3a2fdb822adea57 to your computer and use it in GitHub Desktop.
GA4 Ecommerce Boilerplate - GTM Recipe by MeasureSchool
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"exportFormatVersion": 2, | |
"exportTime": "2022-08-05 10:09:11", | |
"containerVersion": { | |
"path": "accounts/6006227429/containers/90922809/versions/2", | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"containerVersionId": "2", | |
"name": "[Praba] GA4 Ecommerce Events Boilerplate by MeasureSchool - v1.0", | |
"description": "GA4 Ecommerce Events Boilerplate by MeasureSchool.\n\nFor queries, write to praba@measureschool.com", | |
"container": { | |
"path": "accounts/6006227429/containers/90922809", | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"name": "GA4 Ecommerce Boilerplate", | |
"publicId": "GTM-P56VK8B", | |
"usageContext": [ | |
"WEB" | |
], | |
"fingerprint": "1659693079569", | |
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/6006227429/containers/90922809/workspaces?apiLink=container" | |
}, | |
"tag": [ | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"tagId": "27", | |
"name": "GA4 - Ecommerce Purchase", | |
"type": "gaawe", | |
"notes": "Update GA4 Measurement ID", | |
"parameter": [ | |
{ | |
"type": "TEMPLATE", | |
"key": "eventName", | |
"value": "purchase" | |
}, | |
{ | |
"type": "LIST", | |
"key": "eventParameters", | |
"list": [ | |
{ | |
"type": "MAP", | |
"map": [ | |
{ | |
"type": "TEMPLATE", | |
"key": "name", | |
"value": "items" | |
}, | |
{ | |
"type": "TEMPLATE", | |
"key": "value", | |
"value": "{{cjs - ecommerce.items - from v1 dataLayer}}" | |
} | |
] | |
}, | |
{ | |
"type": "MAP", | |
"map": [ | |
{ | |
"type": "TEMPLATE", | |
"key": "name", | |
"value": "transaction_id" | |
}, | |
{ | |
"type": "TEMPLATE", | |
"key": "value", | |
"value": "{{dlv - ecommerce.transaction_id}}" | |
} | |
] | |
}, | |
{ | |
"type": "MAP", | |
"map": [ | |
{ | |
"type": "TEMPLATE", | |
"key": "name", | |
"value": "currency" | |
}, | |
{ | |
"type": "TEMPLATE", | |
"key": "value", | |
"value": "{{dlv - ecommerce.currency}}" | |
} | |
] | |
}, | |
{ | |
"type": "MAP", | |
"map": [ | |
{ | |
"type": "TEMPLATE", | |
"key": "name", | |
"value": "value" | |
}, | |
{ | |
"type": "TEMPLATE", | |
"key": "value", | |
"value": "{{dlv - ecommerce.value}}" | |
} | |
] | |
}, | |
{ | |
"type": "MAP", | |
"map": [ | |
{ | |
"type": "TEMPLATE", | |
"key": "name", | |
"value": "shipping" | |
}, | |
{ | |
"type": "TEMPLATE", | |
"key": "value", | |
"value": "{{dlv - ecommerce.shipping}}" | |
} | |
] | |
}, | |
{ | |
"type": "MAP", | |
"map": [ | |
{ | |
"type": "TEMPLATE", | |
"key": "name", | |
"value": "tax" | |
}, | |
{ | |
"type": "TEMPLATE", | |
"key": "value", | |
"value": "{{dlv - ecommerce.tax}}" | |
} | |
] | |
}, | |
{ | |
"type": "MAP", | |
"map": [ | |
{ | |
"type": "TEMPLATE", | |
"key": "name", | |
"value": "coupon" | |
}, | |
{ | |
"type": "TEMPLATE", | |
"key": "value", | |
"value": "{{dlv - ecommerce.coupon}}" | |
} | |
] | |
}, | |
{ | |
"type": "MAP", | |
"map": [ | |
{ | |
"type": "TEMPLATE", | |
"key": "name", | |
"value": "affiliation" | |
}, | |
{ | |
"type": "TEMPLATE", | |
"key": "value", | |
"value": "{{dlv - ecommerce.affiliation}}" | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"type": "TEMPLATE", | |
"key": "measurementId", | |
"value": "none" | |
}, | |
{ | |
"type": "TEMPLATE", | |
"key": "measurementIdOverride", | |
"value": "G-12345" | |
} | |
], | |
"fingerprint": "1659693678895", | |
"firingTriggerId": [ | |
"17" | |
], | |
"parentFolderId": "3", | |
"tagFiringOption": "ONCE_PER_EVENT", | |
"monitoringMetadata": { | |
"type": "MAP" | |
}, | |
"consentSettings": { | |
"consentStatus": "NOT_SET" | |
} | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"tagId": "30", | |
"name": "GA4 - Ecommerce Events", | |
"type": "gaawe", | |
"notes": "1. Added parameters \"shipping_tier\" & \"payment_type\" to send values when \"add_shipping_info\" & \"add_payment_info\" events are fired (where applicable). Since dataLayer returns undefined for other events (also data model clears on page refresh/load), said parameters will be ignored from the payload & won't be sent to GA4.\n\n2. Using DL version 2 for the items array (even though the site is not a SPA & page refreshes, using V2 to prevent any recursive mergers).", | |
"parameter": [ | |
{ | |
"type": "TEMPLATE", | |
"key": "eventName", | |
"value": "{{Event}}" | |
}, | |
{ | |
"type": "LIST", | |
"key": "eventParameters", | |
"list": [ | |
{ | |
"type": "MAP", | |
"map": [ | |
{ | |
"type": "TEMPLATE", | |
"key": "name", | |
"value": "items" | |
}, | |
{ | |
"type": "TEMPLATE", | |
"key": "value", | |
"value": "{{cjs - ecommerce.items - from v1 dataLayer}}" | |
} | |
] | |
}, | |
{ | |
"type": "MAP", | |
"map": [ | |
{ | |
"type": "TEMPLATE", | |
"key": "name", | |
"value": "shipping_tier" | |
}, | |
{ | |
"type": "TEMPLATE", | |
"key": "value", | |
"value": "{{dlv - ecommerce.shipping_tier}}" | |
} | |
] | |
}, | |
{ | |
"type": "MAP", | |
"map": [ | |
{ | |
"type": "TEMPLATE", | |
"key": "name", | |
"value": "payment_type" | |
}, | |
{ | |
"type": "TEMPLATE", | |
"key": "value", | |
"value": "{{dlv - ecommerce.payment_type}}" | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"type": "TEMPLATE", | |
"key": "measurementId", | |
"value": "none" | |
}, | |
{ | |
"type": "TEMPLATE", | |
"key": "measurementIdOverride", | |
"value": "G-123456" | |
} | |
], | |
"fingerprint": "1659693678902", | |
"firingTriggerId": [ | |
"13" | |
], | |
"parentFolderId": "3", | |
"tagFiringOption": "ONCE_PER_EVENT", | |
"monitoringMetadata": { | |
"type": "MAP" | |
}, | |
"consentSettings": { | |
"consentStatus": "NOT_SET" | |
} | |
} | |
], | |
"trigger": [ | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"triggerId": "13", | |
"name": "CE - Ecommerce Events", | |
"type": "CUSTOM_EVENT", | |
"customEventFilter": [ | |
{ | |
"type": "MATCH_REGEX", | |
"parameter": [ | |
{ | |
"type": "TEMPLATE", | |
"key": "arg0", | |
"value": "{{_event}}" | |
}, | |
{ | |
"type": "TEMPLATE", | |
"key": "arg1", | |
"value": "view_item_list|view_item|add_to_cart|begin_checkout|add_(payment|shipping)_info" | |
} | |
] | |
} | |
], | |
"fingerprint": "1659693668734", | |
"parentFolderId": "3" | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"triggerId": "17", | |
"name": "CE - Purchase", | |
"type": "CUSTOM_EVENT", | |
"customEventFilter": [ | |
{ | |
"type": "EQUALS", | |
"parameter": [ | |
{ | |
"type": "TEMPLATE", | |
"key": "arg0", | |
"value": "{{_event}}" | |
}, | |
{ | |
"type": "TEMPLATE", | |
"key": "arg1", | |
"value": "purchase" | |
} | |
] | |
} | |
], | |
"fingerprint": "1659693668735", | |
"parentFolderId": "3" | |
} | |
], | |
"variable": [ | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"variableId": "4", | |
"name": "dlv - ecommerce.transaction_id", | |
"type": "v", | |
"parameter": [ | |
{ | |
"type": "INTEGER", | |
"key": "dataLayerVersion", | |
"value": "2" | |
}, | |
{ | |
"type": "BOOLEAN", | |
"key": "setDefaultValue", | |
"value": "false" | |
}, | |
{ | |
"type": "TEMPLATE", | |
"key": "name", | |
"value": "ecommerce.transaction_id" | |
} | |
], | |
"fingerprint": "1659693103716", | |
"parentFolderId": "3", | |
"formatValue": {} | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"variableId": "14", | |
"name": "dlv - ecommerce - v1", | |
"type": "v", | |
"parameter": [ | |
{ | |
"type": "INTEGER", | |
"key": "dataLayerVersion", | |
"value": "1" | |
}, | |
{ | |
"type": "BOOLEAN", | |
"key": "setDefaultValue", | |
"value": "false" | |
}, | |
{ | |
"type": "TEMPLATE", | |
"key": "name", | |
"value": "ecommerce" | |
} | |
], | |
"fingerprint": "1659693103723", | |
"parentFolderId": "3", | |
"formatValue": {} | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"variableId": "15", | |
"name": "cjs - ecommerce.items - from v1 dataLayer", | |
"type": "jsm", | |
"parameter": [ | |
{ | |
"type": "TEMPLATE", | |
"key": "javascript", | |
"value": "function() {\n return {{dlv - ecommerce - v1}}.items;\n}" | |
} | |
], | |
"fingerprint": "1659693103731", | |
"parentFolderId": "3", | |
"formatValue": {} | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"variableId": "16", | |
"name": "dlv - ecommerce.shipping", | |
"type": "v", | |
"parameter": [ | |
{ | |
"type": "INTEGER", | |
"key": "dataLayerVersion", | |
"value": "2" | |
}, | |
{ | |
"type": "BOOLEAN", | |
"key": "setDefaultValue", | |
"value": "false" | |
}, | |
{ | |
"type": "TEMPLATE", | |
"key": "name", | |
"value": "ecommerce.shipping" | |
} | |
], | |
"fingerprint": "1659693103724", | |
"parentFolderId": "3", | |
"formatValue": {} | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"variableId": "20", | |
"name": "dlv - ecommerce.value", | |
"type": "v", | |
"parameter": [ | |
{ | |
"type": "INTEGER", | |
"key": "dataLayerVersion", | |
"value": "2" | |
}, | |
{ | |
"type": "BOOLEAN", | |
"key": "setDefaultValue", | |
"value": "false" | |
}, | |
{ | |
"type": "TEMPLATE", | |
"key": "name", | |
"value": "ecommerce.value" | |
} | |
], | |
"fingerprint": "1659693103726", | |
"parentFolderId": "3", | |
"formatValue": {} | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"variableId": "21", | |
"name": "dlv - ecommerce.payment_type", | |
"type": "v", | |
"parameter": [ | |
{ | |
"type": "INTEGER", | |
"key": "dataLayerVersion", | |
"value": "2" | |
}, | |
{ | |
"type": "BOOLEAN", | |
"key": "setDefaultValue", | |
"value": "false" | |
}, | |
{ | |
"type": "TEMPLATE", | |
"key": "name", | |
"value": "ecommerce.payment_type" | |
} | |
], | |
"fingerprint": "1659693103726", | |
"parentFolderId": "3", | |
"formatValue": {} | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"variableId": "22", | |
"name": "dlv - ecommerce.tax", | |
"type": "v", | |
"parameter": [ | |
{ | |
"type": "INTEGER", | |
"key": "dataLayerVersion", | |
"value": "2" | |
}, | |
{ | |
"type": "BOOLEAN", | |
"key": "setDefaultValue", | |
"value": "false" | |
}, | |
{ | |
"type": "TEMPLATE", | |
"key": "name", | |
"value": "ecommerce.tax" | |
} | |
], | |
"fingerprint": "1659693103726", | |
"parentFolderId": "3", | |
"formatValue": {} | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"variableId": "23", | |
"name": "dlv - ecommerce.shipping_tier", | |
"type": "v", | |
"parameter": [ | |
{ | |
"type": "INTEGER", | |
"key": "dataLayerVersion", | |
"value": "2" | |
}, | |
{ | |
"type": "BOOLEAN", | |
"key": "setDefaultValue", | |
"value": "false" | |
}, | |
{ | |
"type": "TEMPLATE", | |
"key": "name", | |
"value": "ecommerce.shipping_tier" | |
} | |
], | |
"fingerprint": "1659693103727", | |
"parentFolderId": "3", | |
"formatValue": {} | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"variableId": "26", | |
"name": "dlv - ecommerce.currency", | |
"type": "v", | |
"parameter": [ | |
{ | |
"type": "INTEGER", | |
"key": "dataLayerVersion", | |
"value": "2" | |
}, | |
{ | |
"type": "BOOLEAN", | |
"key": "setDefaultValue", | |
"value": "false" | |
}, | |
{ | |
"type": "TEMPLATE", | |
"key": "name", | |
"value": "ecommerce.currency" | |
} | |
], | |
"fingerprint": "1659693103728", | |
"parentFolderId": "3", | |
"formatValue": {} | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"variableId": "29", | |
"name": "dlv - ecommerce.items", | |
"type": "v", | |
"parameter": [ | |
{ | |
"type": "INTEGER", | |
"key": "dataLayerVersion", | |
"value": "2" | |
}, | |
{ | |
"type": "BOOLEAN", | |
"key": "setDefaultValue", | |
"value": "false" | |
}, | |
{ | |
"type": "TEMPLATE", | |
"key": "name", | |
"value": "ecommerce.items" | |
} | |
], | |
"fingerprint": "1659693103729", | |
"parentFolderId": "3", | |
"formatValue": {} | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"variableId": "32", | |
"name": "dlv - ecommerce.affiliation", | |
"type": "v", | |
"parameter": [ | |
{ | |
"type": "INTEGER", | |
"key": "dataLayerVersion", | |
"value": "2" | |
}, | |
{ | |
"type": "BOOLEAN", | |
"key": "setDefaultValue", | |
"value": "false" | |
}, | |
{ | |
"type": "TEMPLATE", | |
"key": "name", | |
"value": "ecommerce.affiliation" | |
} | |
], | |
"fingerprint": "1659693243830", | |
"parentFolderId": "3", | |
"formatValue": {} | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"variableId": "33", | |
"name": "dlv - ecommerce.coupon", | |
"type": "v", | |
"parameter": [ | |
{ | |
"type": "INTEGER", | |
"key": "dataLayerVersion", | |
"value": "2" | |
}, | |
{ | |
"type": "BOOLEAN", | |
"key": "setDefaultValue", | |
"value": "false" | |
}, | |
{ | |
"type": "TEMPLATE", | |
"key": "name", | |
"value": "ecommerce.coupon" | |
} | |
], | |
"fingerprint": "1659693293903", | |
"parentFolderId": "3", | |
"formatValue": {} | |
} | |
], | |
"folder": [ | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"folderId": "3", | |
"name": "MeasureSchool - GA4 Ecommece Boilerplate", | |
"fingerprint": "1659693662176" | |
} | |
], | |
"builtInVariable": [ | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"type": "PAGE_URL", | |
"name": "Page URL" | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"type": "PAGE_HOSTNAME", | |
"name": "Page Hostname" | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"type": "PAGE_PATH", | |
"name": "Page Path" | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"type": "REFERRER", | |
"name": "Referrer" | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"type": "EVENT", | |
"name": "Event" | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"type": "CLICK_ELEMENT", | |
"name": "Click Element" | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"type": "CLICK_CLASSES", | |
"name": "Click Classes" | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"type": "CLICK_ID", | |
"name": "Click ID" | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"type": "CLICK_TARGET", | |
"name": "Click Target" | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"type": "CLICK_URL", | |
"name": "Click URL" | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"type": "CLICK_TEXT", | |
"name": "Click Text" | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"type": "FORM_ELEMENT", | |
"name": "Form Element" | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"type": "FORM_CLASSES", | |
"name": "Form Classes" | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"type": "FORM_ID", | |
"name": "Form ID" | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"type": "FORM_TARGET", | |
"name": "Form Target" | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"type": "FORM_URL", | |
"name": "Form URL" | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"type": "FORM_TEXT", | |
"name": "Form Text" | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"type": "ERROR_MESSAGE", | |
"name": "Error Message" | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"type": "ERROR_URL", | |
"name": "Error URL" | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"type": "ERROR_LINE", | |
"name": "Error Line" | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"type": "CONTAINER_VERSION", | |
"name": "Container Version" | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"type": "DEBUG_MODE", | |
"name": "Debug Mode" | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"type": "RANDOM_NUMBER", | |
"name": "Random Number" | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"type": "CONTAINER_ID", | |
"name": "Container ID" | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"type": "HTML_ID", | |
"name": "HTML ID" | |
}, | |
{ | |
"accountId": "6006227429", | |
"containerId": "90922809", | |
"type": "ENVIRONMENT_NAME", | |
"name": "Environment Name" | |
} | |
], | |
"fingerprint": "1659693807964", | |
"tagManagerUrl": "https://tagmanager.google.com/#/versions/accounts/6006227429/containers/90922809/versions/2?apiLink=version" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment