Intro
Once you've created the Dynamic Site Tag, copied the Tag code, and come up with your strategy, then you're ready to deploy the Tag code in your Tag Management System (TMS).
This help article will walk through how to place this Tag using Google Tag Manager. There are 4 different use cases, so please read this entire article and choose which use case, or combination of use cases, is best for you before you begin to place your Tag.
The 4 different use cases are:
- Simple Use Case - use when your website has less than 100 total pages
- Page Method - use when your website has 'categories' of pages, like product pages or content pages that number to over 100 individual pages
- Identify Method - use to track information on website visitors that rarely or never changes, such as a visitor's browser, gender, or age.
- Track Method - use for events that occur while the visitor is looking at a page, for instance an “Add To Cart” button click.
1. Simple Use Case - Google Tag Manager
If the website your tagging has:
- Less than 100 total pages
- Meaningful page titles on every page
Then follow these steps:
- Create a Dynamic Site Tag in Resonate and copy the Tag code
- Go to Google Tag Manager and Create a Tag
3. Select Custom HTML element
4. Paste the Tag code you copied
5. Add a trigger for the Tag
6. Save the Tag
7. Publish
Once your Tag has seen traffic, the next day you'll be able to see data in Resonate.
2. Advanced Use Case (Ecommerce site or Publisher site) - Page Method - Google Tag Manager
If you have a website with 'categories' of pages, like product pages or content pages that number to over 100 individual pages, you will quickly run into our key-value thresholds. In order to provide real value to our clients we require them to send us meaningful groups of data. Clients can accomplish this by sending Resonate 'categories' of pages by using RegEx pattern matching on the page url.
This solution requires an adequate understanding of RegEx to categorize pages based off the page url. We recommend using something like Regex101 to test RegEx matches.
1. Create a Dynamic Site Tag in Resonate and copy the Tag code
2. In Google Tag Manager, define variable rules. Click Variables
3. Then User Defined Variables
4. Click Choose Variable Type
5. Then choose RegEx Table
6. We are categorizing off the page url, so select {{Page URL}}
for the input variable.
7. Start adding rows to categorize a matched url with a meaningful name.
8. Here is an example of what we did for our Resonate corporate website.
9. Make sure to set a default value for pages that don't match any of your patterns, such as calling it "Other Pages."
10. Save the variable with a name like 'pageTitle.'
11. Then we'll create the Tag and follow steps 2-8 above (here again for your reference).
12. Select Custom HTML element
13. Paste the Tag code you copied
14. Add a trigger for the Tag
15. Save the Tag
16. Publish
Once your Tag has seen traffic, the next day you'll be able to see data in Resonate.
3. Identify Method - Google Tag Manager
This method is used to track information on users that rarely or never changes, such as a user’s browser, gender, or age.
- Go to Google Tag Manager and create your variable however you like. For example, a JS Variable:
- Create a Dynamic Site Tag in Resonate and copy the Tag code
- Go to Google Tag Manager and Create a Tag
- Select Custom HTML element
- Paste the Tag code you copied
- Edit the code to use the Identify method instead of the Page method.
- Insert your variable data using double braces to wrap the variable name
- The Identify method takes a JS Dictionary object, with the first key being the user ID, like so:
resonateAnalytics.identify(‘<user id’>, { <variableName> : {{<Google Tag Manager Variable>});
which may look like this:
resonateAnalytics.identify(‘{{userId}}’, { userAgent: {{userAgentVariable}} });
- Add a trigger for the Tag
- Save the Tag
- Publish the tag
Once your Tag has seen traffic, the next day you'll be able to see data in Resonate.
4. Track Method - Google Tag Manager
The Track method is used for events that occur while the user is looking at a page, for instance an “Add To Cart” button click.
- Go to Google Tag Manager and create your trigger that will fire on the event you wish. For example, a Trigger that fires when a search button is clicked:
- Create a Dynamic Site Tag in Resonate and copy the Tag code
- Go to Google Tag Manager and Create a Tag
- Select Custom HTML element
- Paste the Tag code you copied
- Edit the code to use the Track method instead of the Page method.
- Insert your data using double braces to wrap any variable names
- The Track method takes an event name, and a JavaScript Dictionary object, with the event name being the action you want to track, like so:
resonateAnalytics.track(‘ActionName’, { <variableName> : < Variable>, <variableName2: <Variable2>);
which may look like this:
resonateAnalytics.track(‘Searched For’, { searchTerm: {{searchTerm}}, category: {{searchCategory}} });
- Add your trigger for the Tag
- Save the Tag
- Publish the tag
Once your Tag has seen traffic, the next day you'll be able to see data in Resonate.
Comments
0 comments
Please sign in to leave a comment.