Dieses Dokuwiki verwendet ein von Anymorphic Webdesign erstelltes Thema.

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

google_analytics [2010/01/19 11:59]
pgmarshall
google_analytics [2010/10/01 14:01]
Line 1: Line 1:
-====== Google Analytics ====== 
- 
-  * Google Analytics is an amazingly powerful tool for monitoring your website traffic - and best of all it is free! 
-===== Screen Shots ===== 
- 
-{{:​wiki:​googleanalytics1.png|}} 
-===== Installation ===== 
- 
-==== Step 1: Upload your files ==== 
- 
-  * create a new directory **analytics** in catalog/​includes/​modules/​ 
- 
-  * copy this file catalog/​includes/​modules/​analytics.php from this zip file into the directory. 
-    * {{:​wiki:​googleanalytics.zip|}} 
- 
-==== Step 2: Edit the variables ==== 
- 
-  * If necessary, change the $transaction_string and/or the $item_string , for example ​ 
-if you do not use the value customers_state or affiliation tag, replace this with dummy text (company name description),​ like: 
-<file php> 
- $transaction_string = '"'​ . $order_id . '","​ ' . $analytics_affiliation . '",​ 
- "'​ . $analytics_total . '","'​ . $analytics_tax . '","'​ . $analytics_shipping . '",​ 
- "'​ . $orders['​customers_city'​] . '","​DUMMYTEXT","'​ . $orders['​customers_country'​] . '"';​ 
-</​file>​ 
- 
-==== Step 3: Add the tracking code to your main template ==== 
- 
-  * In your main_page.tpl.php file place the following script at the end of the file  
-<file html> 
- <script type="​text/​javascript">​ 
- var gaJsHost = (("​https:"​ == document.location.protocol) ? "​https://​ssl."​ : "​http://​www."​);​ 
- document.write(unescape("​%3Cscript src='"​ + gaJsHost + "​google-analytics.com/​ga.js'​ type='​text/​javascript'​%3E%3C/​script%3E"​));​ 
- </​script>​ 
- <script type="​text/​javascript">​ 
- var pageTracker = _gat._getTracker("​UA-xxxxxxx-x"​);​ 
- pageTracker._initData();​ 
- pageTracker._trackPageview();​ 
- </​script>​ 
-</​file>​ 
- 
-<note warning>​If you process your transactions on an another domain (e.g. store.yourdomain.com) it's strongly advised and recommended that you use the following code:</​note>​ 
- 
-<file html> 
- <script type="​text/​javascript">​ 
- var gaJsHost = (("​https:"​ == document.location.protocol) ? "​https://​ssl."​ : "​http://​www."​);​ 
- document.write(unescape("​%3Cscript src='"​ + gaJsHost + "​google-analytics.com/​ga.js'​ type='​text/​javascript'​%3E%3C/​script%3E"​));​ 
- </​script>​ 
- <script type="​text/​javascript">​ 
- var pageTracker = _gat._getTracker("​UA-xxxxxxx-x"​);​ 
- pageTracker._initData();​ 
- pageTracker._setDomainName("​yourdomain.com"​);​ 
- pageTracker._trackPageview();​ 
- </​script>​ 
-</​file>​ 
-  * Replace **yourdomain.com** with your parent domain name (between the quotes). The code does not differ that much from the original except now the (parent) domain name is setted. Google Analytics now can keep track of transactions from and to other domains within your access. 
- 
-==== Step 4: Replace your Analytics UA-code ==== 
- 
-  * Replace the xxxxxxx-x in the script above with your personal Analytics UA-code (available in your [[https://​www.google.com/​analytics/​settings/​home|Google Analytics account]]) 
- 
-==== Step 5: Put tracking code in checkout_success.php ==== 
- 
-  * open **catalog/​checkout_success.php** 
- 
-  * At the bottom of the file paste the following code: 
-<file php> 
- <script type="​text/​javascript">​ 
- var gaJsHost = (("​https:"​ == document.location.protocol) ? "​https://​ssl."​ : "​http://​www."​);​ 
- document.write(unescape("​%3Cscript src='"​ + gaJsHost + "​google-analytics.com/​ga.js'​ type='​text/​javascript'​%3E%3C/​script%3E"​));​ 
- </​script>​ 
- <script type="​text/​javascript">​ 
- var pageTracker = _gat._getTracker("​UA-xxxxxxx-x"​);​ 
- pageTracker._initData();​ 
- pageTracker._trackPageview();​ 
-  
- <?​php ​ 
- include(DIR_WS_MODULES . '​analytics/​analytics.php'​); ​ 
- ?> 
-  
- </​script>​ 
-</​file>​ 
- 
-==== Step 6: Replace your Analytics UA-code ==== 
- 
-  * Again (as in step 4), replace the xxxxxxx-x in the script above with your personal Analytics UA-code. 
- 
-  * Save the checkout_success.php 
-===== Download ===== 
- 
-{{:​wiki:​googleanalytics.zip|}} 
-====== Setting up Google Analytics ====== 
- 
-  * Google only updates your traffic stats every **24 hours** so you should not expect to see your current browsing instantly on the site. 
- 
- 
-  * To set up your site you need to go to the **Website Profiles** page of Analytics: 
-    * Click on **Edit** (on right hand side)  
-    * In the top box - Main Website Profile Information - click **Edit** 
-    * Click on **Yes, an E-Commerce Site** 
-    * Whilst you are here you might as well check the currency and timezone are set correctly. 
-    * You can also have Analytics track the search terms used on your site by clicking on **Do Track Site Search** and entering **keywords** in the text box provided. 
-{{:​wiki:​googleanalytics2.png|}} 
  
google_analytics.txt ยท Last modified: 2010/10/01 14:01 (external edit)
You are here: startgoogle_analytics
Dieses Dokuwiki verwendet ein von Anymorphic Webdesign erstelltes Thema.
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0