Use Google Tag Manager to manager third-party codes
such as
- Google Analytics
- Google Ads
- Google Optimize
How it works
- first google tagmanager need to install some codes in your side
- it will generate a variable called
dataLayer
in browser - you can use
dataLayer.push()
to put data in this variable - use
event
orpageview
to trigger some tags in google tagmanager - tag is been triggered, which means data in dataLayer will been carried by the third-party codes APIs
- then you can double check API’s params and see if it’s been send successfully