- Posts: 19
- Thank you received: 0
Google Analitics tracking code
12 years 2 months ago #34089
by Jasway
Google Analitics tracking code was created by Jasway
Hey
How is it possible to be able to track with a sigle google analitics code only a sigle language of my site, e.g. the english one for all its pages and subpages??
How is it possible to be able to track with a sigle google analitics code only a sigle language of my site, e.g. the english one for all its pages and subpages??
Please Log in to join the conversation.
-
ivan.milic
Support Staff -
- Offline
- Moderator
-
Less
More
- Posts: 14116
- Thank you received: 1639
12 years 2 months ago #34104
by ivan.milic
Replied by ivan.milic on topic Google Analitics tracking code
I can only tell you way you can place different code spinets based on language. I'am not sure how google itself handles that , maybe you can open different accounts but I'am totally not sure.
In index.php of template, someware below BODY tag:
<?php
$lang = JFactory::getLanguage();
if($lang->getTag() == "en-GB"){ ?>
<!-- HERE GOES CODE SNIPPET FOR ENGLISH -->
<?php } else if($lang->getTag() == "fr-FR"){ ?>
<!-- HERE GOES CODE SNIPPET FOR FRANCH -->
<?php } else if($lang->getTag() == "de-DE"){ ?>
<!-- HERE GOES CODE SNIPPET FOR GERMAN -->
<?php } ?>
In index.php of template, someware below BODY tag:
<?php
$lang = JFactory::getLanguage();
if($lang->getTag() == "en-GB"){ ?>
<!-- HERE GOES CODE SNIPPET FOR ENGLISH -->
<?php } else if($lang->getTag() == "fr-FR"){ ?>
<!-- HERE GOES CODE SNIPPET FOR FRANCH -->
<?php } else if($lang->getTag() == "de-DE"){ ?>
<!-- HERE GOES CODE SNIPPET FOR GERMAN -->
<?php } ?>
Please Log in to join the conversation.
Time to create page: 0.294 seconds