Hello
In what file I have to put the code "google analytics" to track the homepage? I've added in the file "header.tpl" of the theme but does not work
Thanks
Regards
Hello
In what file I have to put the code "google analytics" to track the homepage? I've added in the file "header.tpl" of the theme but does not work
Thanks
Regards
Hello Jose,
I have changed code a bit Please try to verify again.
Viktor,
Flynax technical department,
Best wishes.
Hello Viktor
It does not work. The code works on all pages except if I add in "header.tpl"
Thanks
Regards
Hello Jose,
Would you please send code to my PM.
Viktor,
Flynax technical department,
Best wishes.
it doesnt work for me neither
Hello Alexander,
What exactly doesn't work for you? Would you please explain us better.
Viktor,
Flynax technical department,
Best wishes.
it doesnt show the corrects numbers in analytics panel, where do i need to add the code?
Hello Alex,
You should choose alternative code and choose meta code. Then go to ftp://templates>>your_template>>tpl>>header.tpl and add meta code between tags <head></head>
save and check again in analytics.
Also js analytics code you should add with tags {literal}js analytics code{/literal}
Last edited by Viktor; February 25, 2016 at 03:28 AM.
Viktor,
Flynax technical department,
Best wishes.
Viktor write
Hello Alex,
You should choose alternative code and choose meta code. Then go to ftp://templates>>your_template>>tpl>>header.tpl and add meta code between tags <head></head>
save and check again in analytics.
the header.tpl has no tag <head> .... </head>
it has include file head.tpl
this is the start of file = header.tpl
{include file='head.tpl'}
<div class="main-wrapper">
<header class="page-header{if $pageInfo.Key == 'search_on_map'} fixed-menu{/if}">
<div class="point1 clearfix">
<div class="top-navigation">
<div class="point1">
{include file='blocks'|cat:$smarty.const.RL_DS|cat:'lang_se lector.tpl'}
I have added the code in file head.tpl (ftp://templates/your_template/tpl/head.tpl)
<!-- Global site tag (gtag.js) - Google Analytics -->
<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>
I am waiting if it work or not
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
<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:38 PM.