If you’re using WordPress and Google Tag Manager, chances are that gtm4wp plugin is in your stack. Although it’s really awesome, after installing the plugin and configuring it, you still have to configure your GTM container to use all the triggers and variables (which is time-consuming).
- Download Container File
Download the container JSON file (right-click on the link and click “Save Link As” or “Save Target As” to save the JSON file to your computer).
- Import JSON File into GTM
Log into your own Google Tag Manager container and head to the Admin section of the site. Under Container options, select Import Container. Read this blog post for more details about importing a container file.
- If you start from an empty container with no Google Analytics tags, here’s what you should do:
- Import the container into your workspace – and merge it. All tags come in one folder, neatly organized.
- Go to the variables section, find the Google Analytics Settings Variable, and configure it to suit your needs
- change the GA Tracking ID (UA-XXXXXXX-XX) and other tracking properties (like e-commerce tracking)
- add any custom dimensions you want to track, using the correct CD numbers
- If you’re starting from an existing container with Google Analytics tags already in place, consider:
- disabling the “Page View Tag” – you don’t want to track two pageviews per pageview.
- editing all 4 Google Analytics event tags to use your own GA Settings Variable.
- Preview & Publish
Use the Preview options to test this container on your own site. Try testing each of the events to make sure they’re working properly. If everything looks good, go ahead and publish!