Keyword

Google Tag Manager event tags & K2 conflict

  • Irene Sutherland
  • Irene Sutherland's Avatar Topic Author
  • Offline
  • New Member
More
8 years 6 months ago - 8 years 6 months ago #147977 by Irene Sutherland
Google Tag Manager event tags & K2 conflict was created by Irene Sutherland
Hi there,

Are you aware of any known conflicts between K2 and Google Tag Manger event tags?

I have K2 and GTM installed on catholicenquiry.com.

While the All Pages Universal Analytics tag is firing okay, event tags are not.

By a process of deduction, I have discerned that K2 appears to be blocking them.

Are you able to tell me if there is any setting in K2 that will allow the GTM tags to fire - or is it a programming issue?

Best regards

Rene

Irene Sutherland
Australian Catholic Bishops Conference
Last edit: 8 years 6 months ago by Irene Sutherland.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 6 months ago #147996 by Krikor Boghossian
Replied by Krikor Boghossian on topic Google Tag Manager event tags & K2 conflict
Hello Irene,

Unfortunately I am not aware of this extension. can you share a link towards a tag view?

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Irene Sutherland
  • Irene Sutherland's Avatar Topic Author
  • Offline
  • New Member
More
8 years 6 months ago - 8 years 6 months ago #148043 by Irene Sutherland
Replied by Irene Sutherland on topic Google Tag Manager event tags & K2 conflict
Hi Krikor,

Thanks very much for getting back to me. :)

Google Tag Manager (GTM) isn't an extension, it's a Google application that allows you to control event and other tags and generally read the analytics on your site. It can work with any analytics solution, but I'm using it in conjunction with Google Analytics .

What connects Google Tag Manager to your site is a snippet of code - although I'm using a plugin called Google Tag Manager , which inserts the snippet of code just after the <body> tag. All you have to do is place your GTM ID in the relevant field in the plugin.

I've set up GTM on a number of my sites. I've been able to get event tags firing on the non-K2 sites, but not on catholicenquiry.com, which uses K2 for articles.

There can be a range of reasons that tags don't fire and one common reason can be JavaScript library conflicts .

It would seem to me that this may be where the problem lies.

I'm wondering if you know of any setting in K2 that I might be able to change in order to avoid this conflict.

I'm sure, in time, other users of K2 will want to use GTM and will find your answer useful.

Thanks again

Rene

PS I had searched the forum first. :)
Last edit: 8 years 6 months ago by Irene Sutherland.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 6 months ago #148062 by Krikor Boghossian
Replied by Krikor Boghossian on topic Google Tag Manager event tags & K2 conflict
Hello Rene,

Is this the code?
<script type="text/javascript">
dataLayer = [];
</script>
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-TKZDTJ" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script type="text/javascript">
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({
	'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
	j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';
	j.async=true;j.src='//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-TKZDTJ');
</script>
<!-- End: gtm -->

I cannot see any JS errors in your site, but I cannot see any analytics code, only some HTML comments.

K2 by default does not load analytics, how are you loading them in this site?

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Irene Sutherland
  • Irene Sutherland's Avatar Topic Author
  • Offline
  • New Member
More
8 years 6 months ago #148066 by Irene Sutherland
Replied by Irene Sutherland on topic Google Tag Manager event tags & K2 conflict
Hi Krikor,

Thanks for taking a look.

There is no deployment of GA code when you use GTM.

You put GTM code on your site, which then speaks to GA. The way I'm getting GTM code into the site is with the GTM plugin.

I'm not suggesting there's JS errors - rather that there may be a JS library conflict.

Please have a look at this article: www.simoahava.com/analytics/dont-gtm-listeners-work/

Rene

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 6 months ago #148137 by Krikor Boghossian
Replied by Krikor Boghossian on topic Google Tag Manager event tags & K2 conflict
K2's scripts do not use return false; which cause conflicts with GTM.
There are however multiple versions of jQuery from the mod_cn_photos, the mod_susnet_twitter and the mod_susnet_likebox modules.
This will cause issues in your site's functionality.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Irene Sutherland
  • Irene Sutherland's Avatar Topic Author
  • Offline
  • New Member
More
8 years 6 months ago #148144 by Irene Sutherland
Replied by Irene Sutherland on topic Google Tag Manager event tags & K2 conflict
Thanks! I'll check it out and report back to this post for the benefit of others.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 6 months ago #148153 by Krikor Boghossian
Replied by Krikor Boghossian on topic Google Tag Manager event tags & K2 conflict
That's nice of you Irene :)

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Irene Sutherland
  • Irene Sutherland's Avatar Topic Author
  • Offline
  • New Member
More
8 years 6 months ago #148170 by Irene Sutherland
Replied by Irene Sutherland on topic Google Tag Manager event tags & K2 conflict
Hi Krikor,

I had a look at the modules you'd listed (mod_cn_photos, the mod_susnet_twitter and the mod_susnet_likebox).

I had tested for them by firstly disabling them on the page I was testing GTM. I found it made no difference.

It was only when I set up an article (that is using Joomla core Articles rather than K2 Items) - with those modules enabled, that I found GTM worked. That is why I have confidently narrowed it down to being a K2 Items issue.

Got any more thoughts on what might be happening here?

Thanks in advance

Rene

Please Log in or Create an account to join the conversation.

More
8 years 6 months ago #148227 by Lefteris
Replied by Lefteris on topic Google Tag Manager event tags & K2 conflict
@Irene Sutherland

I don't think that K2 is causing this. I am not aware about how Google Tag Manager works but does use the recommended "event.preventDefault()" for it's events.

Do you see any errors in the browser console? Maybe there is a conflict as Krikor suggested.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum