Recent Topics

1 Apr 22, 2019 02:30    

Hi guys,

I'm getting an error of invalid XHTML for the google analytics tag inserted in "collection/settings/advanced/Custom meta tag/css section (before </head>)".
Shouldn't it be accepted just as it is? I tried to loose the settings as suggested but didn't work too.

Validation errors:
Tag <body> may not contain raw character data
Parser error: Space required near <script async src=""></script> <script>
Invalid Custom meta tag/css section. You can loosen this restriction in the Group settings.

Google Analytics Tag Validation errors
Google Analytics Tag Validation errors

2 Apr 23, 2019 02:41

This is solved, I managed to fix the google's original code so it becomes valid for the XHTML validation.
Just use a template like this (don't forget to replace 111222333-1 with your tag). Tested and receiving hits ok B)

<script src="">
  // Global site tag (gtag.js) - Google Analytics
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'UA-111222333-1');

Form is loading...

Community software – This forum is powered by b2evolution CMS, a complete engine for your website.