This is a collection of custom script tags I wrote for various clients of a digital marketing agency. The GTM custom HTML tags track specific user data triggered by events. Please see comments in the code for specifics.
- Create a Google Analytics account.
- Create a Google Tag Manager account.
- Link your GA account to your GTM account.
- Copy and paste the GTM Container Code in the head of each page of your site.
- Set up Custom Event Variables for Action, Category, Label and NonInteraction with the names eventInfo.nameOfVariable.
- Set up a Custom Event Trigger, with an event named customEvent to fire on Custom Event - Label and does not equal Conversion.
- Set up a Page View - DOM Ready trigger which fires on all DOM ready events.
- Set up a Custom Event Universal Analytics GA tag to track events, add the Custom Event Category, Action, Label and NonInteraction variables and fire the tag with a Custom Event Trigger.
- Create Custom HTML tags for your site and use the code as an example - replace your site's elements/ids/etc. Most Custom HTML tags I created used the DOM Ready trigger.
- jQuery
- Google Tag Manager
- Google Analytics
- Omnibug for debugging
- Observe Point for debugging
None.
Contributions are always welcome! Please contact Kaili Nishihira at kailinishihira@gmail.com
Copyright (c) 2018 Kaili Nishihira
Licensed under the MIT License