-
February 28, 2021, 08:44 PM
#1
Junior Member
Google Analytics Code
where to add the google Analytics Code
The code should be placed in head.tpl NOT header.tpl
tag <head> ....Google Code </head>
I have added the code in file head.tpl (ftp://templates>>your_template>>tpl>>head.tpl)
after the <head> tag
Note: you have to add {literal} ... google code ... {/literal}
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
{literal}
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-1660xxxxx-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-1660xxxxx-1');
</script>
{/literal}
OK It's working fine
Last edited by Amer Almusafer; February 28, 2021 at 08:48 PM.
-
March 1, 2021, 12:02 AM
#2
Guru
Amer,
I placed the code in Flynax's Free "Verification Code" plugin found here:
- https://www.flynax.com/plugins/verification-code.html
The advertisement for the plugin indicates:
- Allows you to add CSS and JS codes to a page
- Offers two positions for inserting a code: top and bottom
- Enables you to manage codes from admin panel
Is specifically states the following about Google Analytics:
"With the help of Flynax verification code, you may now add Meta Tags, JS codes from third-party services to the header or footer of your website, for instance web services like Google Search Console (Webmaster Tools), Google Analytics, chats, trackers like Alexa and many others."
-
July 23, 2021, 08:27 PM
#3
Junior Member
I did so but when i save it i get a 403 server errror.
-
July 26, 2021, 02:11 AM
#4
Guru
Can you paste the code here with the id?