Wallpaper Script Forum » How-To and Troubleshooting

Google tracking code

(6 posts)
  1. I tried several times to add the code for google analytics in the correct field in "Manage settings" but it never works.
    Please help.
    I had the code before from HIstats and it worked

    Posted 1 year ago #
  2. leahn88
    Member

    I tried that yesterday too and there is no way. I get a mysql error from the database.

    I also tried to paste the code directly on the template on main.tpl before the </head> tag but then the page gives me an error when it loads.

    Google gave us several ways to install the tracking code in the past but with the new code we don't have as many options.

    Does anybody know an alternate way of installing the analytics code?

    Posted 1 year ago #
  3. i just tried to add it in footer in the.. next way
    <div id="footer">
    {$_HOOK_FOOTER_}
    </div>
    {literal} <script type="text/javascript">

    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', '***********']);
    _gaq.push(['_trackPageview']);

    (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    })();
    {/literal}

    {if $smarty.const.SIFR_ENABLED == 1}
    {literal}
    <script type="text/javascript">
    //<![CDATA[
    if(typeof sIFR == "function"){
    sIFR.replaceElement(named({sSelector:"body h1", sFlashSrc:webPath + "sifr/sifr.swf", sColor:"{/literal}{$smarty.const.SITE_HEADER_TEXT}{literal}", sLinkColor:"{/literal}{$smarty.const.SITE_HEADER_TEXT}{literal} ", sBgColor:"#FFFFFF", sHoverColor:"#CCCCCC", sWmode:"transparent", sFlashVars:"textalign=left&offsetTop=0"}));

    sIFR.replaceElement(named({sSelector:"body .side-header", sFlashSrc:webPath + "sifr/sifr.swf", sColor:"{/literal}{$smarty.const.PANEL_LINKS_COLOR}{literal}", sLinkColor:"{/literal}{$smarty.const.PANEL_LINKS_COLOR}{literal}", sBgColor:"#FFFFFF", sHoverColor:"#CCCCCC", sWmode:"transparent", sFlashVars:"textalign=left&offsetTop=0"}));

    sIFR.replaceElement(named({sSelector:"body .logo-text", sFlashSrc:webPath + "sifr/sifr.swf", sColor:"{/literal}{$smarty.const.BODY_TEXT_COLOR}{literal}", sLinkColor:"{/literal}{$smarty.const.BODY_TEXT_COLOR}{literal} ", sWmode:"transparent", sFlashVars:"textalign=left&offsetTop=0"}));
    };
    //nPaddingTop:10, nPaddingBottom:10,
    //]]>
    </script>
    {/literal}
    {/if}
    {$smarty.const.TRACKING_CODE}

    {$_HOOK_LAST_FOOTER_}

    first line of the footer.tpl and added those tags {literal}{/literal} going to see tomorrow if actualy works.

    Posted 1 year ago #
  4. Yea actualy that might work anyway..
    The right way is to Click advanced tab when you get the tracking code and check the box for PHP content and... use the php tips to install it.
    Also you will need to write the full path of analyticstracking.php in body. Reply me if you need help

    Posted 1 year ago #
  5. leahn88
    Member

    Problem solved. I used a different method but it worked. I created a php file and named it analyticstracking.php and I pasted the code there.

    I uploaded the php file to the root directory and then I edited the file index.php located on the root directory and I added the code:

    include_once("analyticstracking.php");

    And it works, I could verify the site and now it works. Thank you anyways.

    Posted 1 year ago #
  6. yeh.. i did that way 5 minutes later i posted this :))

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.