SSL Labs ScoreSecurityHeaders.io ScoreHSTS Preloaded

Log in to participate

There is no cost to join RicheyWeb, and membership is a requirement to submit bug reports and participate in the support forums.

Google Analytics code stripped?

More
4 months 3 weeks ago #3866 by jjnxpct
Hi! I just added a new item in the headtag plugin, but I noticed that the GA code we put there (and worked) was somehow stripped and not working anymore after saving the plugin.


We use the type 'Script declartation' and enter this code:
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=******"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', '******');
</script>

After saving this only remains:
window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-1316997-28');

I also tried the 'custom tag' type, but with the same issue.

Can you help me out? Have there been changes to the plugin or am I missing something?

I am not sure why the tags here are being stripped. Or is this an editor issue?

Kind regards,
Jip


Kind regards,
Jip

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

More
4 months 3 weeks ago #3867 by jjnxpct
I just tried it on another site. When I opened the plugin there is a 'custom tag' type with this code:
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-26800243-28"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'UA-26800243-28', {
    'cookie_name': 'Google_Analytics', //Naam van de cookie wijzigen
    'cookie_domain': 'www.inxpact.nl', //Alleen cookies op dit domein plaatsen
    'anonymize_ip': true, // laatste deel IP niet opslaan
    'cookie_expires': 31536000  // one year (in seconds) 
  });
</script>

I only hit the save button (no changes made) and the item was stripped to:

window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'UA-26800243-28', {
    'cookie_name': 'Google_Analytics', //Naam van de cookie wijzigen
    'cookie_domain': 'www.inxpact.nl', //Alleen cookies op dit domein plaatsen
    'anonymize_ip': true, // laatste deel IP niet opslaan
    'cookie_expires': 31536000  // one year (in seconds) 
  });

Wat is happening here?

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

More
4 months 3 weeks ago #3868 by jjnxpct
Some more info:

Joomla 3.9.10
PHP 7.2.19
HeadTag plugin 3.5.3

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

More
4 months 3 weeks ago #3869 by jjnxpct
Well, it seems there is a new version of the plugin (3.5.6). I installed it and now it seems fine. Great.

I do think maybe thew new version are not picked up OK by the Joomla update extension, otherwise I think we would have noticed (and installed) the new version. But maybe the installation of the latest version also fixes this.

Kind regards,
Jip

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

  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to edit your message.
Powered by Kunena Forum