To implement this tracking pixel in Google Tag Manager (GTM) with the requirement that the ta('send', 'lead') only fires on button clicks, here's how to set it up:
Step 1: Create the Base Tag (for Header)
- In GTM, go to Tags > New
- Name it "Thribee Pixel - Initialization"
- Choose tag type: Custom HTML
- Paste this code
<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['TrovitAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://analytics.trovit.com/trovit-analytics.js','ta');
ta('init', 'es', 1, 'unique_identifier_for_the_client');
</script>- Set trigger to: All Pages (page load)
- Set tag firing priority to high (so it loads early)
Important: make sure to include your unique identifier in the following line ta('init', 'es', 1, 'unique_identifier_for_the_client');
Step 2: Create the Lead Event Tag
- Go to Tags > New
- Name it "Thribee Pixel - Lead Event"
- Choose tag type: Custom HTML
- Paste this simple code:
<script type="text/javascript">
ta('send', 'lead');
</script>- Set the trigger to fire only when your specific button is clicked.
Step 3: Create the Button Click Trigger
- Go to Triggers > New
- Name it "Button Click - [your button description]"
- Choose trigger type: Click - Just Links or Click - All Elements depending on your button
- Configure to fire on:
- Some Clicks
- Choose the appropriate identifier for your button (ID, class, text, etc.)
- Save the trigger
Step 4: Publish Your Container
After setting up both tags and the trigger, publish your GTM container to make the changes live.
Verification
- Use GTM's preview mode to verify:
- The initialization tag fires on all page loads
- The lead event tag only fires when your specific button is clicked
- Check your Thribee analytics to confirm events are being recorded properly
This setup ensures the tracking pixel is properly initialized on every page while the lead event only fires on the specific button click you want to track.
Comments
0 comments
Article is closed for comments.