Loading...
 
Skip to main content

History: PluginGoogleAnalytics

Source of version: 32

Copy to clipboard
            ^ Starting in ((Tiki11)), there is a simpler way to configure in the admin panel. See ((Google Analytics)).^ 

! Plugin Google Analytics
This ((wiki plugin)) provides a way to add the code snippet needed for Google Analytics to work on your site. Google Analytics will provide various types of detailed traffic reports and statistics for you to use to monitor the traffic on your Tiki site. See also ((Piwik)).

!! Parameters
{pluginmanager plugin="googleanalytics"}
!! Steps for Using This Plugin
!!! Since ((Tiki3))
#__Open Google Analytics account__%%%If you don't already have an account, go to [http://www.google.com/analytics/] to open one. When setting the account settings, choose "A single domain" when asked what you're tracking. If you choose another setting, you won't be able to use the plugin - use the instructions below for prior Tiki versions instead.
+ %%%
#__Go to Look & Feel admin panel__%%%Go to ''Control Panels > Look & Feel > General Layout Options (tab)'' %%%__NOTE:__ For tiki7, go to ''Admin Home > Look & Feel > Customization (tab)''
+ %%%
#__Insert Syntax and apply__%%%Go to the box titled "Custom End of Code" and insert the following and then click "Apply":
+ {CODE(colors="smarty")}{wiki}{literal}{googleanalytics account="xxxxxxx-x"}{/literal}{/wiki}{CODE}
+ {REMARKSBOX(type=tip title=Tip)}''Note: use your Google Analytics account number where the x's are shown above. Do not include the "UA-" part of your account number.''{REMARKSBOX}
!! Examples
!!! Basic Syntax
{CODE(colors="tiki")}
{googleanalytics account="xxxxxxx-x"}
{CODE}
!! Alternate method
If you can't get the GOOGLEANALYTICS module to work, you can do something like this (also excludes admins from generating Google Analytics hits, and sets cookie so you can use G/A filters to exclude Admin hits even when not logged in):''
{CODE(colors="smarty")}{if $tiki_p_admin ne 'y'}{literal}<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-XXXXXXXX-1']);
  _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);
  })();

</script>{/literal}
{else}
{literal}<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-XXXXXXXX-1']);
  _gaq.push(['_trackPageview']);
  _gaq.push(['_setVar', 'ga_exclude']); 
  (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);

  })();

</script>{/literal}{/if}{CODE}

!! Prior Tiki Versions
This plugin didn't exist before Tiki3, but the code snippet that Google provides when you open a Google Analytics account can be added in prior versions as follows:
* __Version 2.0:__ add to the footer at ''Admin Home > Look & Feel''
* __Version 1.9:__ add to templates/footer.tpl. Need to set "Edit templates" first in the Look & Feel admin panel

!! Related pages 
* [http://www.google.com/support/analytics/bin/answer.py?hl=en-uk&answer=55481 |How to exclude your IP address on google analytics] by Google;
* [http://www.google.com/support/forum/p/Google%20Analytics/thread?tid=4741f1499823fcd5&hl=en|How to exclude internal traffic by cookie] by Google;
* [http://solutionsforofficelive.com/googlewebmastertools.aspx|Webmaster tool verification HowTo] by Solution for Office Live
* [http://www.google.com/analytics/] - to see the stats for your site. 
* [https://www.google.com/support/analytics/bin/answer.py?answer=55488|Google help page] - to see the code that will be inserted at the end of each page as a result of following these steps.
* ((Stats))
        

History

Advanced
Information Version
Marc Laporte 33
Marc Laporte Not in a list 32
Marc Laporte cleaner 31
Yves Kipondo 30
lindon 29
Marc Laporte 28
Marc Laporte Remarksbox along with numbering breaks the page 27
SteveH 26
Daniel Gauthier 25
Rodrigo Sampaio Primo Código Plugin modified by editor. 23
Rodrigo Sampaio Primo typo 22
Marc Laporte 21
E.W. Peter Jalajas fixed ga_exclude and added link 20
E.W. Peter Jalajas added set cookie to exclude admin hits even when not logged in 19
E.W. Peter Jalajas if can't get plugin to work 18
lindon fixed stray apostrophes causing problems with left column 17
E.W. Peter Jalajas add admin exclude 16
lindon fix include 15
lindon 14
lindon 13
E.W. Peter Jalajas reiterating not to put the UA- part of account number 12
lindon 11
lindon 10
Marc Laporte 9
Pascal St-Jean 8
Pascal St-Jean 7
Pascal St-Jean Plugin modified by editor. 6
Pascal St-Jean 5
stefbrodu {GOOGLEANALYTICS(account="UA-xxxxxx-x")}{GOOGLEANALYTICS} (as previously mentionned) does not work 4
Marc Laporte 3
Marc Laporte 2
Marc Laporte draft 1