Google Tag Manager for WordPress (Plugin)

From Growth Agency Wiki
Jump to navigation Jump to search

Google Tag Manager for WordPress is a plugin that allows easy installation and tracking for the GTM.

https://wordpress.org/plugins/duracelltomi-google-tag-manager/

Events

New Tracking

event:

purchase

Variables:

ecommerce.value
ecommerce.transaction_id

Due to the event being very generic, it is advised to put a trigger rule for ecommerce.transaction_id > 0

Classic tracking

event:
gtm4wp.orderCompleted

transactionProducts.sku

Example Data From GTM4WP Plugin:

dataLayer = [{
"event":"transaction",
"transactionId":"100002486",
"transactionDate":"2015-09-03",
"transactionTotal":295,
"transactionShipping":0,
"transactionTax":26.82,
"transactionPaymentType":"Rechnung",
"transactionCurrency":"EUR",
"transactionShippingMethod":"tablerate",
"transactionProducts":[
{
"name":"Handelsvertretergesetz",
"sku":"9783700760344",
"category":"Buch",
"price":113.64,
"quantity":1
},
{
"name":"Steuerrecht",
"sku":"9783700759294",
"category":"Kodex",
"price":77.27,
"quantity":2
}
]
}];

CF7 tracking

event:
gtm4wp.contactForm7Submitted

Analytics 4: Ecommerce Tracking

If Enhanced Ecommerce is enabled, then you can use the below Tag Manager template to setup Analytics 4 Ecommerce tracking for you.
Just make sure to test it in case it becomes outdated!

File:Gtm4wp-ga4-container-elements.json

Source: https://gtm4wp.com/how-to-articles/how-to-setup-enhanced-ecommerce-tracking-google-analytics-4-ga4-version

You will need to set the configuration tag to the Analytics account you want the information to be sent to, other than that it should all be done for you.