Tracking Code Migration Guide



Similar documents
Setup Guide

Google Analytics - A Practical Guide to Implementation

The un-official Google Analytics How To PDF guide to:

Uploading Ad Cost, Clicks and Impressions to Google Analytics

Technical Brief: Dynamic Number Insertion

Index. AdWords, 182 AJAX Cart, 129 Attribution, 174

英 文 考 題 1. You are an online seller. A consumer purchases a product to be delivered to his office. He then makes another order to be delivered to his

Canadian Association for Research Libraries Toronto, Ontario 14 October 2015

Google Analytics Guide

Introduction. Chapter 1 Why Understanding Your Web Traffic Is Important to Your Business 3

Google Analytics Health Check Laying the foundations for successful analytics and optimisation

Google Analytics Guide. for BUSINESS OWNERS. By David Weichel & Chris Pezzoli. Presented By

WEB ANALYTICS. Presented by Massimo Paolini MPThree Consulting Inc

Google Analytics Integration Guide

Is Your Google Analytics Data Accurate?

8 illegitimate reasons for discrepancies between AdWords and Google Analytics conversions

1 Which of the following questions can be answered using the goal flow report?

Web Analytics Definitions Approved August 16, 2007

GOOGLE ANALYTICS 101

Tagging Guide: Website and Implementation. Contents

HOW DOES GOOGLE ANALYTICS HELP ME?

Demystifying Digital Introduction to Google Analytics. Mal Chia Digital Account Director

graphical Systems for Website Design

Web Analytics Big Three Definitions Version 1.0

Microsoft Advertising adcenter Campaign Analytics Getting Started Guide

Google Analytics Basics

Google Analytics workbook

Pizza SEO: Effective Web. Effective Web Audit. Effective Web Audit. Copyright Pizza SEO Ltd.

Google Analytics Audit. Prepared For: Xxxxx

web analytics ...and beyond Not just for beginners, We are interested in your thoughts:

How To Pass The Gaconcept Quiz

TOP 10 things. In Google Analytics. Your Association Should Measure. weblinkinternational.com

Getting started with digital analytics - Cheat sheet GAIQ

Getting Starting with Google Analytics. Summer Durrant IUPUI University Library Indiana Library Federation Conference November 14, 2012

White paper: Google Analytics 12 steps to advanced setup for developers

Google Analytics Universal Guide

Integrating KIMBIA form widget data with Google Analytics. What's Inside? KIMBIA. What s required...

Intell-a-Keeper Reporting System Technical Programming Guide. Tracking your Bookings without going Nuts!

Tracking True & False Demystifying Recruitment Marketing Analytics

Trendspotting: Using Google Analytics to Track and React to Website Visitor Patterns

TheComplete GoogleAnalytics PowerUserGuide

Google AdWords customers can see their Analytics data from inside their AdWords account

Website analytics / statistics Monitoring and analysing the impact of web marketing

Google Analytics: Tracking Where a Visitor Goes on Your Web Site

Analytics for Pros. SEMpdx

Google Analytics for Robust Website Analytics. Deepika Verma, Depanwita Seal, Atul Pandey

Google Analytics Guide. A step by step guide to a best practice implementation of Google Analytics

1. Link Building 2. Site Content 3. Advertising 4. Marketing 5. Viral Marketing 6. Affiliate Marketing 7. Search Engine Optimization 8.

ONLINE ADVERTISING (SEO / SEM & SOCIAL)

Web Analytics. Using emetrics to Guide Marketing Strategies on the Web

About Google Analytics

Geo Targeting Server location, country-targeting, language declarations & hreflang

The Easy Step Guide to SEO

Google Analytics for Government Second Edition

Getting Started with the new VWO

Practical Exercises. Professional Diploma in Digital Marketing. Analytics

Infinity Call Tracking

Decision-making using web analytics. Rachell Underhill, UNC Grad School Anita Crescenzi, UNC Health Sciences Library

Data Driven Success. Comparing Log Analytics Tools: Flowerfire s Sawmill vs. Google Analytics (GA)

Analytics case study

Web Analytics in China

SEO 2.0 ADVANCED SEO TIPS & TECHNIQUES ABSTRACT»

Web analytics, Dashboard & Optimization Experts. Web Analytics Audit Best Practices

1 open source' I community experience distilled. Piwik Web Analytics Essentials. Stephan A. Miller

5.7 Keyword density settings Step 6: Crawl the Joomla! website Step 7: Optimize your Joomla! website 7.1 Optimize pages Optimize titles

HOW TO AMPLIFY YOUR PAY-PER- CLICK ROI

Measure What Matters. don t Track What s Easy, track what s Important. kissmetrics.com

The ultimate integrated Magento helpdesk solution

Management Software. Web Browser User s Guide AT-S106. For the AT-GS950/48 Gigabit Ethernet Smart Switch. Version Rev.

6.1.6 Optimize internal links Search engine friendly URLs Add anchor text to links 6.2 Keywords Optimize keywords 6.2.

Practical Web Analytics for User Experience

How to Edit Your Website

User Guide. You will be presented with a login screen which will ask you for your username and password.

Evaluating the impact of research online with Google Analytics

Introduction to ServerIron ADX Application Switching and Load Balancing. Module 6: Content Switching (CSW) Revision 0310

Overview of Website Analytics. membership, marketing & website solutions

Google Analytics Health Check

Session Attribution in SAS Web Analytics

Access Control Rules: URL Filtering

WompMobile Technical FAQ

Webtrends for SharePoint 2010 A Microsoft Preferred Analytics Solution for SharePoint

SkyGlue Technology Inc., all rights reserved SkyGlue User Manual SkyGlue Technology Inc.

Transcription:

Tracking Code Migration Guide Switching from urchin.js to ga.js Beta Version 2007 Google 2007 Google 1

Contents What's changing? Everything. Why switch to the? Can I stay with urchin.js? Are the new and old codes compatible? What is the tracking code? Basic tracking code Tracking virtual page views Tracking downloaded files Tracking a page in multiple accounts Tracking subdomains Track a visitor across domains using a link Track a visitor across domains using a form E-commerce transactions Adding organic sources Segmenting visitor types Restrict cookie data to a subdirectory Control data collection settings Control session timeout Control campaign conversion timeout Custom campaign fields Using the anchor (#) with campaign data Setting keyword ignore preferences Control the data sampling rate Using Google Analytics and Urchin 3 3 3 3 4 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 2007 Google 2

What's changing in the new version? Everything. Now do even more! The Google Analytics tracking code snippet and associated function calls are changing in several important ways: Faster, smaller source file Easier to use and understand Automatic detection of HTTPS Increased namespace safety Benefits of the The gives the following benefits and capabilities: Easily customize the tracking code for your site's needs. Conveniently set up e-commerce and cross-domain tracking. Quickly enjoy new features and reports as they roll out. The lays the foundation for a wide range of exciting new features coming down the pipeline, such as more granular and accurate reporting for rich Internet applications and additional goal types, as they become available. Can I stay with urchin.js? Yes, urchin.js will continue to function for at least a year after the new version is released, and possibly longer. Please note that urchin.js will not receive feature updates and is not compatible with new features. Are the old and the new tracking codes compatible? No, the two styles of tracking code should not be used together. Be sure that you do not mix the new and old code styles on any given page on your site, because the old and are not compatible. 2007 Google 3

type="text/javascript"> What is the tracking code? The Google Analytics tracking code is a JavaScript code snippet required to be part of the source code of the web pages you would like to track with Google Analytics. To track an entire website, simply add the tracking code to all the web pages on your site. Basic tracking code Start collecting your data effortlessly with Google Analytics. Easily copy and paste our basic tracking code onto your site. This JavaScript snippet is the minimum code required for a site to be tracked with Google Analytics. NOTE: Choose between either the old tracking code or the, because they should not both be used on the same page. Automatically detects protocol (http:// or https://) 2007 Google 4

Tracking virtual page views Google Analytics allows you to change the actual URI that appears in your reports. Create an arbitrary entry in Google Analytics reports by sending a string beginning with a forward slash to the _trackpageview() function. old tracking code type="text/javascript"> urchintracker("/my/virtual/url"); pagetracker._trackpageview("/my/virtual/url"); 2007 Google 5

Tracking downloaded files Need metrics on your downloads? Track them, too! Know when key files are downloaded from your site. To create an entry in Google Analytics reports for file downloads, send a string beginning with a forward slash to the _trackpageview() function. old function style <a href="/mydoc.pdf" onclick="urchintracker('/mydoc.pdf');">download PDF</a> new function style <a href="mydoc.pdf" onclick="pagetracker._trackpageview('/mydoc.pdf');">download a PDF</a> 2007 Google 6

Tracking a page in multiple accounts Need to track one page in multiple accounts? Now you can! A single page may be significant to several accounts. If you want to track a page in multiple Google Analytics accounts, simply instantiate more than one tracker object. type="text/javascript"> _uff = 0; // Reset flag to allow for second account _uacct = "UA-67890-1"; var firsttracker = _gat._gettracker("ua-12345-1"); firsttracker._initdata(); firsttracker._trackpageview(); var secondtracker = _gat._gettracker("ua-67890-1"); secondtracker._initdata(); secondtracker._trackpageview(); 2007 Google 7

type="text/javascript"> _udn = "example.com"; Tracking subdomains You can easily and comprehensively track your web presence. If your site spans multiple subdomains, set your domain name to the root domain using _setdomainname(). If you are using different root domains, use _setdomainname("none"). pagetracker._setdomainname("example.com"); 2007 Google 8

Track a visitor across domains using a link Comprehensively track a visitor across multiple websites! To track unique visitors across multiple sites requires maintaining a session by transferring cookies across multiple domains. To send cookies via URL parameters (HTTP GET), use the _link() function. type="text/javascript"> _udn = "none"; _ulink = 1;... <a href="http://newsite.com/test.html" onclick=" utmlinker('http://newsite.com/test.html'); return false;">click me</a> pagetracker._setdomainname("none"); pagetracker._setallowlinker(true);... <a href="http://newsite.com/test.html" onclick="pagetracker._link('http://newsite.com/test.html'); return false;">click me</a> 2007 Google 9

type="text/javascript"> _udn = "none"; _ulink = 1;... <form name="f" method="post" onsubmit=" utmlinkpost(this)">... </form> Track a visitor across domains using a form Does your form send visitors to another domain? Track them as one! This is the second method you can use to track multiple websites. If your site hosts a form that sends visitors to another domain name, you can send cookies via HTTP POST by using the _linkbypost() function. pagetracker._setdomainname("none"); pagetracker._setallowlinker(true);... <form name="f" method="post" onsubmit="pagetracker._linkbypost(this)">... </form> 2007 Google 10

type="text/javascript"> <form name="utmform" id="utmform"> <textarea name="utmtrans" id="utmtrans" style="display:none"> UTM:T 1234 Mountain View 11.99 1.29 5 San Jose California USA UTM:I 1234 DD44 T-Shirt Green Medium 11.99 1 </textarea> </form> utmsettrans(); E-commerce transactions Track sales revenue and measure success when you sell! Simply use the code below on your receipt page. pagetracker._addtrans( "1234", // order ID - required "Mountain View", // affiliation or store name "11.99", // total - required "1.29", // tax "5", // shipping "San Jose", // city "California", // state or province "USA" // country ); pagetracker._additem( "1234", // order ID - required "DD44", // SKU/code "T-Shirt", // product name "Green Medium", // category or variation "11.99", // unit price - required "1" // quantity - required ); pagetracker._tracktrans(); 2007 Google 11

type="text/javascript"> _uosr[28] = "bigsearch"; // search engine _uokw[28] = "q"; // query term Adding organic sources Track all search engines and optimally identify organic traffic. By default, Google Analytics recognizes the main search engines. However, you can easily customize this list by adding search engines with the _addorganic() function. New items are added to the end of the list. pagetracker._addorganic("bigsearch", "q"); 2007 Google 12

type="text/javascript"> utmsetvar("test_value"); Segmenting visitor types Segmentation is powerful! Quickly segment types of visitors. Set a visitor segmentation cookie to help you classify the types of visitors coming to your site. For example: New Customer vs. Prospect or Cat Owner vs. Dog Owner. pagetracker._setvar("test_value"); 2007 Google 13

Restrict cookie data to a subdirectory Control where your Google Analytics first-party cookies are set (in case you only own a subdirectory on your domain). By default, Google Analytics sets the cookie path to /. If you would like to change this, simply send your preferred cookie path to the _setcookiepath() function. old tracking code type="text/javascript"> _utcp = "/path/of/cookie/"; pagetracker._setcookiepath("/path/of/cookie/"); 2007 Google 14

Control data collection settings You can control the amount of information you collect. By default Google Analytics will track an optimal set of data elements, such as Flash versions and web browser information. You have the option to turn this detection off by using the functions listed below, but be careful, because once you do so, you will lose the data permanently. type="text/javascript"> _ufsc = 0; // track browser info _uhash = 0; // cookie integrity checking using hashes _uflash = 0; // detect Flash version _utitle = 0; // track title in reports pagetracker._setclientinfo(false); pagetracker._setallowhash(false); pagetracker._setdetectflash(false); pagetracker._setdetecttitle(false); 2007 Google 15

Control session timeout Don t like the standard session timeout of 30 minutes? You can change it to what works for your business. You have the option to modify the number of seconds by using the _setsessiontimeout() function. Please use this function with caution because this very important setting is used to compute visits. old tracking code type="text/javascript"> _utimeout = "3600"; // the number of seconds in 1 hour pagetracker._setsessiontimeout("3600"); 2007 Google 16

Control campaign conversion timeout Google Analytics credits the most recent campaign if conversion happens within six months, or you can adapt the timeout to your unique business needs. Change the campaign conversion timeout by sending the desired number of seconds to the _setcookietimeout() function. type="text/javascript"> _ucto = "31536000"; // the number of seconds in 1 year pagetracker._setcookietimeout("31536000"); 2007 Google 17

type="text/javascript"> _uccn = "ga_campaign"; // name [default: utm_campaign] _ucmd = "ga_medium"; // medium [default: utm_medium] _ucsr = "ga_source"; // source [default: utm_source] _uctr = "ga_term"; // term/keyword [default: utm_term] _ucct = "ga_content"; // content [default: utm_content] _ucid = "ga_id"; // id number [default: utm_id] _ucno = "ga_nooverride"; Custom campaign fields Easily configure Google Analytics to recognize campaigns with custom field names in manually tagged URLs. Track campaigns with custom field names by passing your desired names to these campaign functions on your landing pages, enabling Google Analytics to recognize the campaign information in your manually tagged URLs. // don't override [default: utm_nooverride] pagetracker._setcampnamekey("ga_campaign"); // name pagetracker._setcampmediumkey("ga_medium"); // medium pagetracker._setcampsourcekey("ga_source"); // source pagetracker._setcamptermkey("ga_term"); // term/keyword pagetracker._setcampcontentkey("ga_content"); // content pagetracker._setcampidkey("ga_id"); // id number pagetracker._setcampnokey("ga_nooverride"); // don't override 2007 Google 18

Using the anchor (#) with campaign data in URL You can adapt Google Analytics to accept manually tagged URLs that use the # symbol instead of the default question mark (?). Simply set the _setallowanchor() to true. Please confirm with your webmaster that using the # instead of the? does not cause issues with other tools on your site. old tracking code type="text/javascript"> _uanchor = 1; pagetracker._setallowanchor(true); 2007 Google 19

Setting keyword ignore preferences You can configure Google Analytics to treat certain keywords as direct traffic, such as visitors who type in your domain (www.mb4r.com) into a search engine. Use _addignoredorganic() to treat a keyword as a referral or _addignoredref() to treat a referral as direct. old tracking code type="text/javascript"> _uono[0] = "ignore"; // keyword to treat as referral _urno[0] = "urchin.com"; // referral to treat as direct pagetracker._addignoredorganic("ignore"); pagetracker._addignoredref("urchin.com"); 2007 Google 20

Control the data sampling rate Traffic too high? Need faster long term data trends? Simplify by specifying a sample size that's more manageable to analyze. By default, Google Analytics tracks every visitor. If you would like to implement a sampling rate instead, you can send your preferred rate to the _setsamplerate() function. type="text/javascript"> _usample = 50; // set sampling rate at 50% pagetracker._setsamplerate(50); 2007 Google 21

type="text/javascript"> _userv = 2; Using Google Analytics and Urchin Google Analytics and Urchin software are completely compatible! Enable tracking of your site with Google Analytics and Urchin software by calling _setlocalremoteservermode() in the tracking code. Simple. pagetracker._setlocalremoteservermode(); Using the _setlocalremoteservermode() function tells Google Analytics to request the tracking image ( utm.gif) from both your own server and Google's server. NOTE: Remember to remove utm.js from your webpages if you are using this feature. 2007 Google 22