Tracking purchases with Google Tag Manager (New!)
We’re excited to announce two powerful new Google Tag Manager (GTM) templates designed to make integrating Triggerbee with GTM easier than ever! Our Triggerbee Tracking Template and Triggerbee Event Logger Template are now available for download (and soon also in the Community Template Gallery). Both templates are made to simplify your tracking setup while leveraging your existing GTM setup.
You can add our templates by:
- Visiting the official Google Tag Manager Community Template Gallery
- Following the instructions below to install it from inside Google Tag Manager.
How to install Triggerbee's Google Tag Manager templates
Log in to Google Tag Manager. Navigate to "Tags" and click on New tag
Add a name to your tag, and click on "Tag configuration" to open the tag selection menu. Click on the blue ribbon "Discover more tag types in the Community Template Gallery".
Click on the search icon in the top right corner and search for "Triggerbee". Click on the tag template you want to add (Triggerbee tracking should be the first tag you install).
Click on the blue button in the top right corner that says "Add to workspace"
Check the permissions and click on "Add".
- Repeat the process if you want to add the second template.!
1. Triggerbee Tracking GTM Template
Our Triggerbee Tracking Template is designed to give you a streamlined way to add Triggerbee’s tracking script in Google Tag Manager.
Key Features:
- Easy script installation: Capture detailed visitor behavior, helping you monitor key actions and conversions.
- Automatic duplicate script handling: The tracking template checks if the script is already loaded, and will not inject the script if it already finds another Triggerbee script on the website.
- Easier multi-account setup: You can use custom GTM variables and lookup tables to assign dynamic site ID’s .
- Data layer integration: You have the option to send a Triggerbee event to your data layer named “triggerbeeActive”. When the data layer event is sent, you can use it to fire other tags or perform other actions only when Triggerbee is active.
- Detailed debugging: If you use GTM’s preview mode, our tracking template logs console messages for every step it performs to make it easier to debug any issues.
Installing the Triggerbee Tracking Tag
Once you've installed and imported the Triggerbee tracking template, here are the steps you need to follow:
Create a new tag. Select the Triggerbee Tracking Template from the flyout menu on the right hand side. You can find it under "Custom" tags, below "Custom HTML".
Enter your Triggerbee Site ID in the textbox.
If you want to send an event to the data layer when the tracking script is fully injected, tick the checkbox that says "Send DataLayer event on successful script injection". The data layer event can be useful for both debugging or triggering other things that might rely on Triggerbee being active. Here's how it should look in GTM Preview Mode with the datalayer event enabled:
Optional: Set up necessary consent permissions. If you need to set up consent permissions for Triggerbee’s script to fire, click on “Advanced settings” > “Consent settings” and a permission check for: analytics_storage and personalization_storage
Set up your trigger to control when the tag should fire (such as on a Page View or Custom Event / history change if you have an SPA site).
- Test and publish—your tracking is ready to go!
Debugging the Tracking script
Tag fired successfully
GTM console output for successful script injection:
Tag failed to fire
GTM console output if another Triggerbee script is detected:
Once live, your Triggerbee tracking will start capturing valuable visitor data, pushing key events to GTM’s DataLayer for real-time insights and deeper analysis.
This tag also makes it easier to set up a multi-market environment with multiple Triggerbee accounts, since you can use a lookup table to assign different Triggerbee site ID’s to a single tracking tag.
2. Triggerbee Event Logging Template
With the Triggerbee Event Logger Template, you can easily send goal and purchase events to Triggerbee from GTM, using your existing data layer variables.
Note: Purchase events should only be logged once, and all goals should be logged in separate tags. If you want to log Purchase (Event), Add to Cart (Goal), and Initiate Checkout (goal), create 3 separate tags that fire on separate events. See the finished example setup here.
Key Features of the Triggerbee Event Logging Template:
- Log Goals, Purchases and revenue: Track key customer journey events like “Add to cart”, “Initiate checkout”, and "Register membership". Purchases can also be tracked and you can send revenue data, order ID, coupon code, and customer details with ease.
- Compatible with your existing GTM Variables: Use data variables from your existing GTM setup to send revenue and order details.
The setup is very straightforward and easy.
- Follow steps 1-3 in the section about how to install a custom GTM template and import the Triggerbee Event Logger Template.
Create a new tag and select the Triggerbee Event Logging Template.
Choose if you want to log a goal or purchase.
If you're logging a goal, choose a pre-defined goal from the dropdown, or make it custom by filling out a custom name.
NOTE: If you are choosing a custom name for your goal, this will overwrite any pre-defined goals.
Logging purchase events with revenue to Triggerbee
To log a purchase event, select "purchase" from the top dropdown and insert your variables for revenue, transaction ID, and user email. We highly recommend you insert your variable for revenue in order to send revenue data to Triggerbee. All fields are optional, but without revenue data you will not be able to attribute revenue to your campaigns.
Add a trigger to control when this event fires. We recommend you use a custom event for purchases, since it's an event sent to the data layer. (It's highly likely that you are already sending conversion events to Google Ads, GA4, or Meta using a purchase trigger. Use this :).
Ensure the event logging tag is injected after the Triggerbee tracking template (or the tag you use to insert Triggerbee's tracking code). You can control in which order the tag fires by clicking on Advanced Settings > Tag Sequencing > Fire a tag before... and selecting the tag that injects Triggerbee's tracking script.
- Test it by going into preview mode, and publish your container if everything is working as expected 🙂
With this setup, you’ll have rich event data flowing straight to Triggerbee, giving you the ability to log everything from interest-based goals to revenue-driven purchases—all without having to deal with developers or code by yourself.
Final view of a complete e-commerce setup
Here is a screenshot showing you how it can look in your GTM account when you've set up multiple goals and a purchase event:
Red = Purchase event
Yellow = Goals (add one tag for each goal you want to track, using the Triggerbee Event Logging tag).
Troubleshooting
1. Timing Issues: Event Tags Fired Before Triggerbee is Initialized
Problem: Event tags may fire before the Triggerbee tracking script is loaded and initialized, resulting in events not being logged correctly.
Solution:
- Double-check your tag sequencing:
- In GTM, navigate to the event logger tag's Advanced Settings.
- Under Tag Sequencing, enable Fire a tag before this tag and select the Triggerbee Tracking Tag. This ensures that the Triggerbee script loads before any event tags fire.
- Use Data Layer Events:
- Utilize the
triggerbeeActive
data layer event to trigger event tags only after Triggerbee is active. - In your event logger tag, set the trigger to fire on the
triggerbeeActive
event.
- Utilize the
2. Triggerbee Script not loading
Problem: The Triggerbee script fails to load on your website, preventing any event tracking from occurring.
Solution:
- Verify Script Installation:
- Ensure that the Triggerbee Tracking Template is correctly imported and configured in GTM.
- Double-check that your Triggerbee Site ID is accurately entered in the tracking tag configuration.
- Check for duplicate scripts:
- Although the tracking template handles duplicate script injection, verify that no other scripts on your site are interfering with Triggerbee.
- Inspect network requests:
- Use browser developer tools to check for any network errors or failed requests related to the Triggerbee script.
3. Data layer variables not populated
Problem: Event tags require certain data layer variables (e.g., revenue, order ID) which might not be populated when the tag fires.
Solution:
- Verify data layer Implementation:
- Ensure that your website correctly pushes the required variables to the data layer before the event tag is triggered.
- Use GTM’s Preview Mode:
- Activate GTM’s Preview Mode to inspect the data layer and confirm that all necessary variables are available when the event tag fires.
4. Consent Permissions Not Configured Correctly
Problem: If consent permissions are required and not properly set up, Triggerbee scripts may not fire.
Solution:
- Configure consent settings in GTM:
- In the Triggerbee Tracking Tag, navigate to Advanced Settings > Consent Settings.
- Ensure that permissions for
analytics_storage
andpersonalization_storage
are correctly set.
- Double-check your cookie bot / consent management software:
- Ensure that your cookie bot or consent software is properly set up to handle consent permission changes and updates.
- Verify user consent:
- Make sure that users have granted the necessary consents before Triggerbee tags are allowed to fire. Implement consent management solutions if needed.
5. Missing or incorrect trigger configurations
Problem: Tags may not fire as intended due to incorrect or missing trigger configurations.
Solution:
- Review Tag Triggers:
- Ensure that each tag has the appropriate triggers assigned, such as Page View, Clicks, or Custom Events.
- Test Triggers in Preview Mode:
- Use GTM’s Preview Mode to test and verify that triggers are firing correctly when the corresponding actions occur on your website.
6. Console Errors During Tag Execution
Problem: Errors appear in the browser console during tag execution, indicating issues with the setup.
Solution:
- Check Console Logs:
- Open your browser’s developer tools and inspect the console for any error messages related to Triggerbee tags.
- Enable Detailed Debugging:
- Utilize the detailed debugging features of the Triggerbee Tracking Template, which logs console messages for each step. This can help identify where the issue is occurring.
7. Events Not Appearing in Triggerbee
Problem: Events are sent from GTM but are not visible in the Triggerbee dashboard.
Solution:
- Verify Account and Site ID:
- Ensure that events are being sent to the correct Triggerbee account and that the Site ID matches the one in your Triggerbee dashboard.
- Allow Time for Processing:
- Sometimes there might be a delay before events appear in Triggerbee Wait for a few minutes and refresh the visitor list.
8. Missing Revenue Data in Purchase Events
Problem: Purchase events are being logged without revenue data.
Solution:
- Ensure your revenue variable is set:
- In the Triggerbee Event Logging Template, make sure that the data layer variable for revenue / order value is correctly mapped and populated.
- Verify data layer push:
- Confirm that your website pushes the revenue information to the data layer at the correct time, and that it's available when the purchase event tag fires.
- Test in Preview Mode:
- Use GTM’s Preview Mode to verify that the revenue variable contains the expected value when the purchase event tag is triggered.
9. Custom Goal Names Overriding Standard Goals
Problem: Custom goal names are unintentionally overriding standard goal names, leading to inconsistent goal tracking.
Solution:
- Review tag configuration:
- When configuring the Triggerbee Event Logging Template, ensure that the Custom Goal Name field is only filled when you intend to override the standard goal name.
- Maintain consistent naming conventions:
- Use clear and consistent naming conventions for custom goals to prevent confusion and ensure accurate tracking.
10. Multi-Account Setup Issues
Problem: Difficulty managing multiple Triggerbee accounts, especially in a multi-market environment.
Solution:
- Use Lookup Tables:
- Leverage GTM’s lookup tables to dynamically assign different Triggerbee Site IDs based on variables like language or market.
- Follow Multi-Account Setup Guide:
- Refer to our upcoming article on setting up GTM for multiple Triggerbee accounts to ensure a streamlined and error-free configuration.