Google Tag Manager - Add Trigger Using Div class

Hi, I thought I was doing this correctly, but I'm seeing no results in Google Analytics.

I have a Trustpilot review widget on my home page. I want to know if people are clicking on it. My understanding is, you create the trigger to fire when someone clicks on the element with class .trust-pilot, then you add an event that contains that trigger.

This is what I created in Google Tag Manager:

trigger
tag configuration
Hopefully that's enough information for someone to advise me. Let me know if you need more. Thanks. (I do have google tag manager set up on the home page, magickitchen dot com. ).
mel200Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Christopher RourkeProduct Manager @ Experts ExchangeCommented:
I've checked your site source and the GTM code appears to be implemented correctly.

Looking at your screenshots I can't tell if you have assigned the trigger you've configured to your Google Analytics tag. Beneath the tag configuration settings there should be a section, "Triggering", that allows you to assign the click trigger to the GA tag.

If that is set already let me know and we can dig deeper.
1
mel200Author Commented:
Let me try that again... and thanks!

When I open the tag configuration, I see:

tag.JPG
then when I click on Home Page Trustpilot Clicks, I see:

click1.JPG
0
Christopher RourkeProduct Manager @ Experts ExchangeCommented:
That all looks correct as well. Next lets try to debug the tag:

  • In Google Tag Manager, load the "Workspace" tab for the Container in which you created your tag and trigger.
  • At the top right of the page there should be a red button, "Publish", with a down arrow next to it. Click the down arrow.
  • Click on the "Preview" option to enable the debugger on your site.
  • Load your website in the same browser that is logged into Google Tag Manager, a debug screen should appear at the bottom.
  • Click on the element that has the matching CSS selector you setup in your trigger and confirm/deny the tag firing in the debug window.
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Christopher RourkeProduct Manager @ Experts ExchangeCommented:
Actually, while writing up my last comment I think I may have found your problem. Your trigger is set for matching the CSS selector .trustpilot-widget but looking at your site it appears the selector you want is, .tp-widget-wrapper.
1
mel200Author Commented:
Interesting... where do you find that? The code for the widget is:

<div class="trustpilot-widget" data-locale="en-US" data-template-id="xxxxx" data-businessunit-id="xxxxx" data-style-height="220px" data-style-width="100%" data-theme="light" data-stars="4,5"></div>
</div>
0
mel200Author Commented:
Never mind, I see! Let me try it, thanks!
0
Christopher RourkeProduct Manager @ Experts ExchangeCommented:
Using developer tools in the Chrome browser, see attached:
Screen cap
0
mel200Author Commented:
Ok, that's in place, now I should be able to see any clicks on that class in Analytics in Behavior>Events, right? How long should I wait after I click the widget a few times for the data to appear? Thanks!
0
Christopher RourkeProduct Manager @ Experts ExchangeCommented:
Can take a bit for you to start seeing data in Analytics (hours approximately). I'd recommend now running through the debug steps I outlined in this earlier comment:

https://www.experts-exchange.com/questions/29009818/Google-Tag-Manager-Add-Trigger-Using-Div-class.html#a42079131

If you see the tag firing as expected, you'd then need to publish your Google Tag Manager changes at which point the data should flow to your analytics account.
0
mel200Author Commented:
Ok, this is what I get - I'm sorry, now I have to go away until tomorrow... I'll try to check again later tonight. I did click on the trustpilot link, and it opened.
Capture.JPG
0
mel200Author Commented:
oh, and when I clicked on that box with the trustpilot click event, I saw this:

capture2.JPG
0
Christopher RourkeProduct Manager @ Experts ExchangeCommented:
And after clicking into the Trust-Pilot widget the tag does not fire?

If so then next we need to ensure your Google Tag Manager container has the built in Click variables enabled. They can be found by clicking on the Variables selector in the left hand navigation. Ensure all Click based variables are enabled:

  • Click Element
  • Click Classes
  • Click ID
  • Click Target
  • Click URL
  • Click Text
0
mel200Author Commented:
That's right, it didn't fire. I'll check that, thanks.
0
mel200Author Commented:
Ok, I have enabled these. They weren't enabled before.
      
Click Classes      
Click Element
Click ID
Click Target
Click Text
Click URL

Then I went back to my site, the bottom tag manager bar reopened, and I clicked on the review widget. Same result, didn't fire.
0
mel200Author Commented:
This must be frustrating for you, you could probably have it running in ten seconds if you had access...
0
Christopher RourkeProduct Manager @ Experts ExchangeCommented:
Potentially but no need to worry, I enjoy puzzles and challenges so it is unlikely I'll get frustrated :). We're eliminating possible error points so still making progress.

What are you clicking on in the Trust Pilot widget? The left and right arrows or, an individual review? Does the click result in you leaving your site?

Going to take a few moments to compile what you have set for each portion, now that you have the variables enabled we should be able to put all the pieces together.
0
Christopher RourkeProduct Manager @ Experts ExchangeCommented:
Ah, I got so wrapped up in the tag elements I overlooked that the widget is a cross-domain iframe. This means you'd need to have your GTM script present within the iframe in order to track it. There may be other ways without having to add the GTM script to the third party content, but I have not personally tried any.

Easiest why to resolve this would be if the third party, Trust Pilot, would add your GTM script to your iframe.

I also searched for any other documentation regarding this type of tracking and found the following:
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mel200Author Commented:
Hi- I'm clicking on an individual review, which does take me to another tab and opens the trustpilot review page.

Ok, I see what you mean. Trustpilot takes our snippet of code and adds substance to it from their side. That's why I initially wasn't sure about the class you mentioned. Interesting.

I read the articles, and it does sound like the easiest thing by far would be to have Trustpilot add the GTM to the iframe.

So I'll ask, although having talked to their support before, I hold out little hope.

Thanks!
0
mel200Author Commented:
Hi- it looks like that can't be done(Putting the gms code in the iframe at the trustpilot side). It's not important enough to continue with on my side. Thanks very much, I learned a lot!
0
mel200Author Commented:
One last dumb question- I couldn't wrap my widget code in another div with a class, and use that class for the event tag?
0
mel200Author Commented:
Like: <div class="newclass">Trustpilot widget here</div>, then use .newclass in place of  .tp-widget-wrapper?
0
Christopher RourkeProduct Manager @ Experts ExchangeCommented:
A solid idea but, no. The click would still be to their document which is inserted on your page.

Sorry we could not get this to work; on the bright side, you should now be setup to collect clickEvent tracking for any non-iframe elements on your site.
1
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Google

From novice to tech pro — start learning today.