Google Tag Manager
Created: 2020-05-05 10:51:10 -0700 Modified: 2020-05-05 12:07:43 -0700
Basics
Section titled Basics- Google Analytics is actually a subset of GTM.
- You can use this to manage any other embeds, not just Google products. E.g. you can incorporate a Facebook pixel (reference), your own custom scripts for event trackers, etc.
- All changes that you make on the GTM site are staged, so you have to publish them before they’ll take effect.
- Liquidor: Tip: Setup a filter for your own IP so you don’t spam your Analytics with your own visits. You can setup a filter in GA and Exclude with IP. Just make sure to hide this while creating the filter (the IP is hidden unless you edit the filter in the future)
- Alternatively, just don’t opt in to your own marketing cookies.
- You can apparently debug/check your setup using this Chrome extension
Setup
Section titled Setup- I had to make an account. This is separate from a Google Analytics account.
- I think it’s typical for the container name to be the same as your domain, e.g. adamlearns.com
- It gave me code that I added to my site.
- At that point, you don’t need Google Analytics’ scripts specifically since GTM loads GA.
Setting up a Facebook pixel (reference)
Section titled Setting up a Facebook pixel (reference)- When I got to the step about creating a pixel on Facebook, I couldn’t actually use business.facebook.com; there was no “Create account” button anywhere despite their instructions saying that it would be there. Codephobia found this link for me, which linked to a working Events-Manager link.
- When setting up the pixel, it was suggested to me not to let Facebook easily set it up for me. Instead, I chose “manually add code to website”.
- At first, I didn’t set up any custom events, e.g. for purchasing or for specific actions that a user may take.
- Publish the changes.
Setting up Google Analytics
Section titled Setting up Google Analytics- I made a new tag
- For the tag type, I chose Google Analytics: Universal Analytics
- In Google Analytics Settings → Select Settings Variable…, chose “New Variable” and type in your tracking ID
- Set the “Tag firing options” to “Once per page”.
- Add a trigger for “All Pages”
- Publish the changes.