Google Tag Manager Setup
How to implement your Ruler Script via GTM
Installing Ruler Analytics Using Google Tag Manager
You can add all Ruler scripts to your website using Google Tag Manager (GTM) by creating a Custom HTML tag. This includes your main Ruler Analytics JavaScript tracking script.
Add the Ruler Tag to Google Tag Manager
1. Create a New Tag
In your Google Tag Manager account:
- Select Tags from the left-hand menu.
- Select New.
- Choose Tag Configuration.
- Select Custom HTML from the available tag types.
2. Add Your Ruler Analytics Script
Paste your Ruler Analytics JavaScript into the HTML field.
You can find your unique Ruler Analytics tracking script in your Ruler account under Site Setup.
3. Set the Tag Firing Options
Under the tag's firing options, ensure the tag is configured to fire once per page.
This helps ensure the Ruler tracking script is loaded consistently as visitors navigate your website and prevents the tag from firing multiple times unnecessarily.
4. Set the Trigger
Under Triggering, select All Pages.
This ensures that the Ruler tracking tag is available across your website and can capture the customer journey from the beginning of a visitor's session.
5. Save and Publish
Once you have configured the tag:
- Select Save.
- Use Preview in Google Tag Manager to verify that the Ruler tag fires correctly.
- Publish your GTM container when you are happy with the setup.
6. Test Your Tag Setup
Before completing your setup, please ensure that the Ruler tag is firing correctly across your website, including any relevant landing pages.
Testing your setup helps confirm that Ruler is receiving data correctly and that the tracking script is loading as expected.
You can test your Ruler tracking by following our guide:
How to Test if Your Site Is Sending Data to Ruler Analytics
Please NoteWe recommend testing your main website pages as well as any campaign or landing pages that visitors may enter your website through. This helps ensure that Ruler can capture the full customer journey from the point of entry.
Using Custom Triggers
The setup above uses All Pages as a basic example. You can also use your own custom triggers if your website or GTM setup requires them.
Ruler's tag can work with custom triggers and conditions, provided the tag is able to fire on the relevant pages and visitor journeys you want to track.
Good to KnowIf you use custom triggers for other tags within GTM, you do not necessarily need to change your existing setup. The important thing is that the Ruler tag is installed correctly and fires on your website as required.
Need Help?
If you have any questions about installing Ruler through Google Tag Manager or need help checking that your tracking is firing correctly, please reach out to a member of the Ruler team.
Updated 9 days ago