+ Reply to Thread
Results 1 to 10 of 10

Thread: code "google analytics"

  1. #1

    code "google analytics"

    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

  2. #2
    Hello Jose,

    I have changed code a bit Please try to verify again.
    Viktor,
    Flynax technical department,
    Best wishes.

  3. #3
    Hello Viktor

    It does not work. The code works on all pages except if I add in "header.tpl"

    Thanks
    Regards

  4. #4
    Hello Jose,

    Would you please send code to my PM.
    Viktor,
    Flynax technical department,
    Best wishes.

  5. #5
    it doesnt work for me neither

  6. #6
    Hello Alexander,

    What exactly doesn't work for you? Would you please explain us better.
    Viktor,
    Flynax technical department,
    Best wishes.

  7. #7
    it doesnt show the corrects numbers in analytics panel, where do i need to add the code?

  8. #8
    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.

  9. #9
    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

  10. #10
    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.

+ Reply to Thread