Google Analytics Training



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

Is Your Google Analytics Data Accurate?

Setup Guide

MONITORING YOUR WEBSITE WITH GOOGLE ANALYTICS

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

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

Google Analytics Audit. Prepared For: Xxxxx

Google Analytics - A Practical Guide to Implementation

英 文 考 題 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

TheComplete GoogleAnalytics PowerUserGuide

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

WEB ANALYTICS. Presented by Massimo Paolini MPThree Consulting Inc

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

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

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

Google Analytics Guide

How To Pass The Gaconcept Quiz

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

Tracking Code Migration Guide

Google Analytics for Government Second Edition

Implementing Sub-domain & Cross-domain Tracking A Complete Guide

Google Analytics Health Check

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

Google Analytics workbook

Google Analytics. Jay Murphy Trionia Incorporated The Science of Marketing

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

Web Analytics Definitions Approved August 16, 2007

Technical Brief: Dynamic Number Insertion

Google Analytics Basics

8 illegitimate reasons for discrepancies between AdWords and Google Analytics conversions

HOW DOES GOOGLE ANALYTICS HELP ME?

Personalizing Google Analytics Using Events and Custom Variables. Josh Wilson State Library of North Carolina

Nonprofit Technology Collaboration. Web Analytics

Impressive Analytics

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

Google Analytics Universal Guide

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

SmallBiz Dynamic Theme User Guide

Getting Started with Google Analytics 7 Easy but comprehensive steps

Get Started with LeadSquared Guide for Marketing Users. Complete lead to revenue platform

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

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

Tagging Guide: Website and Implementation. Contents

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

How to: Audit Your Google Analytics Installation

HOW TO USE GOOGLE ANALYTICS. (for beginners) universal analytics. Courtney Petty, of DKS Systems adapted from our previous beginner s guide.

GOOGLE ANALYTICS TERMS

WompMobile Technical FAQ

How to Edit Your Website

Getting started with digital analytics - Cheat sheet GAIQ

Using Google Analytics

How To Understand Your Online Marketing Program

Uploading Ad Cost, Clicks and Impressions to Google Analytics

Hybrid Approach to Search Engine Optimization (SEO) Techniques

Installation & Configuration Guide Professional Edition

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

Dynamic Product Ads Implementation Guide

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

User Guide to the Content Analysis Tool

The Social Accelerator Setup Guide

Google Analytics. Web Skills Programme

Getting Started Guide

Checklist of Best Practices in Website

WEB ANALYTICS Where to Begin

Google Analytics and Google Analytics Premium: limits and quotas

VIDEO TRANSCRIPT: Content Marketing Analyzing Your Efforts 1. Content Marketing - Analyzing Your Efforts:

80+ Things Every Marketer Needs to Know About Their Website

Tracking True & False Demystifying Recruitment Marketing Analytics

62 Ecommerce Search Engine Optimization Tips & Ideas

Creating Campaign Tracking URLs

So you want to create an a Friend action

Improving Magento Front-End Performance

Going Mobile-does your website work on mobile devices?

Instructions for Configuring Your Browser Settings and Online Security FAQ s. ios8 Settings for iphone and ipad app

GUIDE TO GOOGLE ADWORDS

Getting A Google Account

DIGITAL MARKETING TRAINING

Microsoft Advertising adcenter Campaign Analytics Getting Started Guide

IMRG Peermap API Documentation V 5.0

Technical Brief: Google Analytics Integration

O Reilly Ebooks Your bookshelf on your devices!

How to Use Google AdWords

Video Ad Exam. 01 Types of Video Ads. 02 Using Video Ads. 03 Making a Video. 04 Creating a Campaign. 05 Campaign Settings. 06 Companion Banner

Transcription:

Google Analytics Training sponsored by Clockwork is a digital firm creating technology solutions that really work. Your vision is our mission. Strategy Design Technology Content Search Engine Optimization Paid Placement: Pay Per Click Advertising (PPC) Analytics and Reporting SEM subcontracting for agencies Local Search Marketing and Google Places Founded 2005

Google Analytics 301 Let s Get Technical

Who We Are 412.381.5500 http://www.lunametrics.com/blog Traffic SEO Paid Search Social Media Analysis Google Analytics setup & training Web Analysis Action User testing Google Website Optimizer 3

Today s singular goal Get your questions answered: Ask questions during or between sessions Grab me at breaks Stay late at the end of the day 4

Agenda Welcome Configuration & Coding Tracking Code Break Clean Up Your Data Measuring Conversion Lunch Measuring Traffic Measuring Content Measuring Visitors Break Managing Cookies and Tracking Extracting Data Conversion Testing & Website Optimizer Understanding Each Other: IT and Marketing Q&A, Individual Help 5

Configuration and Administration

Assumptions You ve used Google Analytics You should understand how basic metrics are defined, the types of reports Analytics offers, and how to navigate You don t have to be an expert You are familiar with web technologies HTML JavaScript Passing familiarity with cookies, redirects, server-side languages, Flash You don t have to be a hard-core developer You are aware of conversion testing/optimization 7

Learning Objectives After completing this section, you should be able to: Explain the relationship among usernames, accounts, web property IDs, and profiles. Add a user to Analytics and understand the difference between administrators and read-only users. Navigate Analytics and account and profile settings. Understand issues that can be dealt with by configuring Google Analytics settings vs. issues that require changes to your tracking code. 8

Account Overview Account Overview 9

Users, Accounts, Profiles User Your email login (could be a Gmail address or your own email address you ve signed up as a Google Account). Account Your user login may have access to multiple accounts in Google Analytics a personal account for your blog and your company account for your corporate websites, for example. Profiles Separate buckets of data within an account, which could be for different websites, or for the same website with a different set of data filtered in a different way. 10

Account Overview Account Overview 11

Profiles in an Account Account comparison 12

Web Property ID DEFINITION: Web Property ID The web property ID is a number of the form UA-XXXXXX-YY. It s often called the UA number because the always start with UA. The XXXXXX part is unique to your account, and the YY represents an additional site within an account. 13

How it all fits together 14

Managing Users Profiles Overview 15

User Manager Analytics Settings > User Manager 16

Adding a User Analytics Settings > User Manager > Create New User for Access 17

Types of Users DEFINITION: View reports only This type of user can only view reports and cannot make configuration changes, such as changing profile settings, creating goals, or adding other users. You can specify access on a profile-by-profile basis. DEFINITION: Account Administrator This type of user has complete control over the account and all of the profiles within it. 18

Best Practices: Account, Profiles, Users Shared Login: Should we share one login? You should have at least 2 (1 read-only and 1 admin). More depending on whether users want to personalize their experience (Dashboard, Advanced Segments, etc.) or all share those customizations. Number of Profiles: You can have up to 50 profiles per account. Multiple Sites in One Account: Will you want to have separate admin capabilities for different sites? Do you need to compare the sites to one another (in the Profile Overview)? Agencies: Track each client as a separate account, so you don t run out of profiles and are able to give admin access to your clients if they request it. 19

Questions so far? Administrative Interface

Administration in Google Analytics There are two ways to affect your data: Configuring settings within Google Analytics Filters Goals Site Search Changing the tracking code on your site Event Tracking Ecommerce Subdomains and Multiple Domains 21

Account Settings Account comparison 22

Account Settings 23

Profile Settings Account comparison 24

Profile Settings 25

Profile Settings: Main 26

Profile Settings: Goals 27

Profile Settings: Filters 28

Profile Settings: Users 29

Topics Configuration and Coding Tracking Code Clean Up Your Data Measuring Conversion Measuring Traffic Measuring Content Measuring Visitors Managing Cookies and Tracking 30

Administration and Coding ACTIVITY What are some opportunities or issues with tracking that you would like to explore? Are there troubleshooting scenarios or hard-to-track items on your website that you d like to know more about? 31

Questions? Administrative Interface

Google Analytics Tracking Code

Learning Objectives After completing this section, you should be able to: Implement basic Google Analytics Tracking Code on your site. Explain how Google Analytics tracking works. Recognize situations that may need additional or alternative code to handle. 34

Account Creation 35

Tracking Code 36

So how does Google Analytics work? Web Browser Your website GATC Google Analytics Server Data Processing Google Analytics Reports 37

Client vs. Server Based Measurement Client-side tools use a JavaScript tag like GA Identify visitors by cookies (problems with clearing cookies) Robots and crawlers generally don t execute JavaScript (good) Records HTML pages, not PDF, etc. (without additional work) Server-side tools use server logs Identify visitors by IP address (problems with dynamic IPs and proxies) Must actively maintain list of robots and crawlers Easily track all filetypes, not just HTML Not unusual to see huge discrepancies (~100%) Want to maintain continuity with historic data? Run tools side-by-side for a while, benchmark against one another 38

OK, so how does it really work? <body> <! the contents of your page > <script type="text/javascript"> var gajshost = (("https:" == document.location.protocol)? "https://ssl." : "http://www."); document.write(unescape("%3cscript src='" + gajshost + "googleanalytics.com/ga.js' type='text/javascript'%3e%3c/script%3e")); </script> <script type="text/javascript"> try { var pagetracker = _gat._gettracker("ua XXXXX Y"); pagetracker._trackpageview(); } catch(err) {} </script> </body> </html> 39

OK, so how does it really work? <script type="text/javascript"> try { var pagetracker = _gat._gettracker("ua XXXXX Y"); pagetracker._trackpageview(); } catch(err) {} </script> 40

Step 1: Set Cookies utma: Visitor identification (2 years) utmb & utmc: Maintain session (30 minutes/close) utmz: Information about the source (6 months) utmv: Optional, custom visitor information (2 years) TIP You can change the expiration lengths for these cookies with extra code. We ll see how later. 41

Step 2: GIF request The code requests a 1x1 pixel transparent GIF from Google with a variety of parameters that transmit data about the visitor and pageview. 1x1.gif http://www.googleanalytics.com/ utm.gif?utmwv=4.7.2&utmn=575285510&utmhn=www.googlestore.com& utmcs=utf-8&utmsr=1280x960&utmsc=24-bit&utmul=enus&utmje=1&utmfl=10.0%20r42&utmdt=google%20online%20store&utmhid=122377674 2&utmr=0&utmp=%2Fshop.axd%2FHome&utmac=UA-30481-1&utmcc= utma%3d148589601.1582204557.1254853256.1262564466.1275586055.22 %3B%2B utmz%3d148589601.1262020438.19.5.utmcsr%3dgoogle%7cutmccn%3d(o rganic)%7cutmcmd%3dorganic%7cutmctr%3dgoogle%2520t%2520shirt%3b 42

Step 3: Google Processing Google does a bunch of processing on the data, and deposits the processed data in profiles for reporting. Processing happens in the following order: Default page, site search, and exclude query parameters Filters Goals 43

Just copy and paste, right? Just fine in many cases But you still need to think about configuring certain things that don t involve code, like goals and campaign tagging You should consider the following: Multiple domains Subdomains Excluding internal traffic Ecommerce tracking URLs with lots of query parameter junk Frames and iframes Redirects AJAX and Flash Non-HTML files (PDF, MP3, etc.) 44

Ensuring GA is installed Spot check pages for code WASP Firefox Extension by Stéphane Hamel of Immeria http://wasp.immeria.net Scan your whole site GA SiteScan by EpikOne http://gasitescan.com

Additional web dev extensions Web Developer Toolbar: View & alter cookies, styles, and lots of other stuff https://addons.mozilla.org/en US/firefox/addon/60 Firebug: Debug JavaScript https://addons.mozilla.org/en US/firefox/addon/1843 Live HTTP Headers or HTTP Fox

Getting Your Code 47

Code Wizard 48

Three eras of tracking code urchin.js old-style tracking code still supported for sending data, but is not updated to support new features, such as event tracking or custom variables ga.js Standard Tracking examples given today updated version of urchin.js supporting newer features ga.js Asynchronous uses same ga.js code loads asynchronously from the page less susceptible to missed tracking of long pages 49

Asynchronous Tracking Traditional tracking recommends placement at the bottom of the page, so that any potential latency in tracking doesn t hold up page content from loading Downside: With heavy pages (taking a long time to load), visitors could navigate away before the entire page is loaded and not be tracked Asynchronous tracking happens in parallel to the page loading without holding up content Asynchronous code can safely be placed higher in the page, so more likely to track heavy pages even if visitors navigate away from them before the entire page is loaded 50

Asynchronous Tracking Code <head> <! other scripts and elements in the head > <script type="text/javascript"> var _gaq = _gaq []; _gaq.push(['_setaccount', 'UA XXXXX X']); _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> </head> 51

Asynchronous Tracking Queue _gaq Array is a queue for methods to be executed Push items into the array and they are executed in the order they are pushed, as soon as the tracking script is fully loaded 52

Asynchronous Tracking Syntax _gaq.push([methodname, argument1, argument2,...]); Note that you must push an Array into the queue (enclose in square brackets, separate items with a comma) The items in the array are Strings (enclose them in quotes) The first item in the array is the method name The subsequent items are any arguments you want to supply to the method 53

Comparison of traditional & asynchronous code pagetracker._trackpageview(); _gaq.push(["_trackpageview"]); pagetracker._setdomainname(".example.com"); _gaq.push(["_setdomainname",".example.com"]); 54

Questions so far? Tracking Code

Other ways to collect GA data Mobile Mobile tracking code for mobile sites aimed at non-smartphones SDKs for mobile apps on Android and iphone Non-HTML content Flash Flex Silverlight 56

Mobile Tracking

Types of Mobile Phones Smartphones iphone Android Windows Mobile Blackberry Palm Not-smartphones The other ones 58

Smartphones Regular websites JavaScript, cookies, and the whole deal Regular GA tracking code captures these visits 59

Smartphone Apps Applications (Android and iphone OS only) Installed applications Software development kits plug into app development to provide tracking internal to apps Pageviews and Events only http://code.google.com/mobile/analytics/docs/iphone/ http://code.google.com/mobile/analytics/docs/android/ 60

Non-Smartphones Specialized mobile sites Generally, these phone s browsers don t use JavaScript or cookies Server-side tracking Pageviews only PHP, Perl, JSP, ASPX currently supported Get the code through the wizard in Google Analytics http://code.google.com/mobile/analytics/docs/web/ 61

Questions so far? Mobile Tracking

Learning Objectives After completing this section, you should be able to: Implement basic Google Analytics Tracking Code on your site. Explain how Google Analytics tracking works. Recognize situations that may need additional or alternative code to handle. 63

Questions? Tracking Code

Cleaning Up Your Data

Learning Objectives After completing this section, you should be able to: Create a profile and apply filters to it. Understand how filters are processed. Remove internal traffic from your data. Clean up messy URLs in your data. Understand options for using filters to manipulate your data. Explain the differences between using filters and advanced segments. 66

Creating a Profile Profiles Overview 67

Create A New Profile 68

Profile Best Practices Because all of the processing happens once, when data is received, changes are not retroactive and can t be undone! Recommended profiles: Unfiltered: raw data, no filters, just the data as it is. Create this and never touch the configuration on it again. Use this for troubleshooting. Test profile(s): Test out changes to filters, goals, and other configurations here before applying them to your production data. 69

Questions so far? Profiles

Filters Google Analytics lets you filter the data that goes into a profile: including or excluding data, or making changes to it. There are a number of reasons to do this: Exclude employees, web developers, and other internal traffic from your site. Separate data from test/development and production sites. Include data for just yourself, for testing purposes. Clean up messy URLs or other data. Include data for just one portion of your site, or traffic from a particular segment of visits. 71

Detour: Regular Expressions What are Regular Expressions? A way to describe a pattern in text Uses characters with special meanings One regular expression can match many text strings Google Analytics uses Perl Compatible Regex, so you may already be familiar 72

Regular Expression Examples google youtube google OR youtube vertical bar is OR you?tube youtube or you tube question mark makes preceding character optional (0 or 1) goo+gle google or gooogle or goooogle or plus says 1 or more of preceding character 73

Regular Expression Examples ^goo google or gooey or good, but not magoo caret means starts with gle$ google or ogle or gargle, but not gleeful dollar sign means ends with 74

Regular Expression Examples goo. good or goof or goo2 or goo% dot matches any character goo[a-z] good or goof or goop but not goo2 or goo% square brackets group a class of characters: use a range like a-z or 0-9, or a list of specific characters tubes* tube or tubes or tubessssssss star means 0 or more of preceding character 75

Combining Regular Expressions ((great )*grand)?(mo fa)ther mother or grandfather or great great grandmother grouping with parentheses (.*) dot-star is a common combination 0 or more of any character 76

Why Regular Expressions? You can use regular expressions in a number of places in Google Analytics Filters (as we ll see in a moment) Goals Containing/Excluding field in reports Advanced Segments 77

Creating Filters Profiles Overview 78

Filter Manager 79

Applying Filters to Profiles 80

Filter Order 81

Types of Filters Predefined filters: include or exclude Traffic from IP addresses Traffic from domains Traffic to subdirectories Custom filters, operating on a variety of fields Exclude Include Lowercase Uppercase Search and Replace Advanced 82

Filter Fields (and poor labeling) These correspond (mostly) to dimensions that are available in Google Analytics reports. However, they aren t always named the same thing 83

Filter Fields: Content Dimensions Request URI = Page Content > Top Content Hostname Visitors > Network Properties > Hostnames Page Title Content > Content by Title 84

Filter Fields: Campaign Dimensions Campaign Source Campaign Medium Campaign Name Campaign Content = Ad Content Campaign Code Traffic Sources > All Traffic Sources Traffic Sources > All Traffic Sources Traffic Sources > Campaigns Traffic Sources > Ad Versions (not displayed in reports) Referral (not displayed in reports) = raw referrer value 85

Visitor Information Visitor IP Address (not displayed in reports) Visitor ISP Organization Visitors > Network = Service Providers Properties > Service Providers Visitor Type (New or Returning) Visitor Country, Region, City Visitor Geographic Domain (.co.uk, for example) Visitor Language Settings Visitors > Visitor Type Visitors > Map Overlay (not displayed in reports) Visitors > Languages User Defined Visitors > User Defined 86

Filter Fields: Browser Information Visitor Browser Program, Visitor Browser Version, Visitor Operating System Platform, Visitor Operating System Version, Visitor Screen Resolution, Visitor Screen Colors, Visitor Java Enabled?, Visitor Flash version, Visitor Connection Speed Visitors > Browser Capabilities 87

Filter Fields: Ecommerce Ecommerce Transaction ID Ecommerce Transaction Country, Region, City, Store or Order Location Ecommerce > Transactions (not displayed in reports) Ecommerce Item Name Ecommerce > Product Performance = Product Name > Product Overview Ecommerce Item Code Ecommerce > Product Performance = Product SKU > Product SKUs Ecommerce Item Variation Ecommerce > Product Performance = Product Category > Categories 88

Filter Fields: Other Custom Field 1, Custom Field 2 (not displayed in reports) used in Advanced Filters for temporary storage 89

Questions so far? Profiles

Internal Traffic 3 methods: By IP Address If everyone in your organization has a single IP address, or an enumerable list or range of IP addresses, that don t change By Service Provider Simpler, because you don t have to know the IP address ranges, but only applies to larger organizations By Cookies If you have dynamic IPs, people work from home, or you otherwise can t guarantee any particular IP address 91

Remove by IP Address (Predefined filter) 92

Remove by IP Address (Custom filter) TIP Regular expressions use a number of special characters: \.?+*([^$ If you use one of those characters literally, escape it by preceding it with a backslash \ 93

Remove by Service Provider 94

Remove by Service Provider 95

Remove by Cookie utmv cookie stores custom information about visitors We can use it to label visits as employee and exclude based on those 96

Step 1: Set the cookie Tech-savvy users? javascript:pagetracker._setvar( employee ); in URL bar of browser (while you re on the site) works in Firefox, Safari, Chrome (not IE) Not so tech-savvy? Put the code in a bookmarklet Put the code on a special page they have to visit on the site (which includes loading the GA tracking code) 97

Step 2: Create the filter 98

Step 3: Nag, nag, nag You have to remind users that they need to repeat this: on every computer they use (desktop, laptop, home computer, ) on every browser they use (IE, Firefox, Safari, Chrome, ) every time they clear their cookies 99

One more thing: Filter dev/test servers 10 0

Questions so far? Profiles

Messy URLs Capitalization Ending in / or in /index.html (or whatever) Query parameter gunk Too many URLs 10 2

Capitalization Often you can get to the same page with capitalized or lowercase URLs; your web server doesn t mind and serves the same page either way. Try it on your site and see. Can be an especially big problem if links within your site are capitalized differently (rather than just visitors typing in URLs). Differently capitalized URLs are listed separately in Top Content Report and makes it difficult to compare pages without doing totaling by hand. 10 3

Capitalization 10 4

Potential Fields to Lowercase Request URI Hostname Campaign labels Campaign Source Campaign Medium Campaign Name Campaign Term Campaign Content 10 5

Default Pages Often your default home page (and pages of subdirectories) is accessible both through URLs ending in slash, as well as index.html, index.php, default.aspx, or other variations Similar problems to capitalization in Top Content report 10 6

Default URLs 10 7

Defaults URLs (with filters) 10 8

Query Parameter Gunk Query Parameters: values after the? in URLs. www.example.com/page.html?abc=123&xyz=789 Sometimes query parameters distinguish different pages, so they help form a unique URL that corresponds to a page of content. Other times they don t tell us anything and the data would be cleaner if we removed them (the query parameters that are useful to you depend on your site). Especially true when you have a random number that identifies a visitor or session (different URL for every visitor, even though they re viewing the same page. 10 9

Too Many URLs Google Analytics limits your site to 50,000 unique URLs within a day (notice that s not 50,000 pageviews, but 50,000 unique URLs). URLs over 50,000 for the day go into a line labeled (other) in Top Content. This is often due to extraneous query parameters as well. 11 0

Query Parameters & Too Many URLs TIP Exclude query parameters that are meaningless to the analytics (they convey information to the server, but don t tell us anything about the actual page). Exclude query parameters that are unnecessarily specific, such as session IDs, visitor IDs, or any other parameter that is specific to a visit that does not uniquely identify the page. 11 1

Questions so far? Filters

Advanced Filters 11 3

There s lots more you can do Include just specific traffic sources Include just specific parts of your site Rewrite fields in fancy ways TIP Use Advanced Segments where possible, since they are much easier for non-technical users to experiment with and understand. Advanced Segments are useful for looking at specific traffic sources and other situations. 11 4

Advanced Segments vs. Filters Advanced Segments Includes historical data See multiple advanced segments at once in the same report On the fly, intuitive Visit, not page level Tied to a user login, not the profile Filters & Profiles Only going forward on data Filter certain kinds of traffic you almost always want to exclude, like your internal traffic Rewrite field values Segment the Funnel Visualization, Absolute Unique Visitors, or Keyword Positions reports Page level, not visit 11 5

Learning Objectives After completing this section, you should be able to: Create a profile and apply filters to it. Understand how filters are processed. Remove internal traffic from your data. Clean up messy URLs in your data. Understand options for using filters to manipulate your data. Explain the differences between using filters and advanced segments. 11 6

Questions so far? Filters

Measuring Conversion

Learning Objectives After completing this section, you should be able to: Set up goals and funnels to measure conversions Understand common issues with URL goals and how to solve them Implement ecommerce tracking code 119

Setting up Goals

What is a goal in Google Analytics? There are two types of goals: URL goals: A particular page was reached, possibly with a number of steps (a funnel ) leading up to the page. A thank-you page for filling out a form. A receipt page for a purchase. A key page of information on your site. Engagement goals: A metric reached a numeric threshold. Pages/Visit Time on Site 121

Managing and Adding Goals Profile Overview 122

Goal Sets and Organizing Goals Profile Settings 123

Creating an Engagement Goal TIP Use clear, descriptive names for goals and funnels. The names you use are the labels that show up in reports. 124

Defining URL Goals: Get to the page(s) /shop.axd/contact /shop.axd/sendcontactemailbp 125

URL Goals: Create the goal 126

URL Goals: Create the goal 127

Goal Match Types Exact match The URL must match exactly what you type in Goal: /goal/ Matches: /goal/ Head match The URL must match what you type in, but can have additional text afterward Goal: /goal/ Matches: /goal/ /goal/anything/else.html Regular Expression match /goal?lots=of-stuff You can use regular expressions to match any pattern 128

Goals that match multiple pages Notice that with head match, or regular expression match, many different URLs can match a goal. So if all our download URLs start with /download?file=, we can easily make a goal that matches them all. 129

For goals that are clicks, rather than pages 1. Use virtual pageviews to record clicks 2. Base your goal on the virtual URLs you have used for the clicks 130

What about goals without distinct URLs? Sometimes a form posts back to the same URL there s no distinct thank-you page URL Or a whole series of steps in a funnel uses the same URL In general, these things can be fixed, but you need some coding help: Either give them distinct URLs If that s not possible (with your CMS or application), you can give them distinct URLs in Analytics 131

Distinct URLs You can fix this manually (if you can t change the way the form works). Change your tracking snippet: pagetracker._trackpageview(url); Supply the url value with the URL that should appear as the referrer, instead of just allowing Analytics to use the document.location URL (the default when you don t supply an argument) You can do something like this: document.location +?step=1 document.location + thankyou 132

Troubleshooting Goals Remember goals are processed after filters, so if you ve changed URLs through filters, you need to use the changed URLs in the goal Look in the Top Content Report Filter the report by your Regular Expression to see if it matches For head match or exact match, remember that the containing/excluding filter uses Regular Expressions escape any special characters! 133

Troubleshooting Funnels Funnel step order and backfill Head match or Regular Expressions that match more than one step Example Step 1: /contact/ Step 2: /contact/thank-you Be careful! Step 1 also matches Step 2! Use Regular Expressions Step 1: /contact/$ Step 2: /contact/thank-you 134

Copying Goals The problem: You ve got multiple profiles with different segments in each one. You want the same goals in all the profiles so you can compare them. You have to set up each goal from scratch. The solution: Goal Copy toolbar http://bit.ly/avxug0

Questions so far? Goals

Setting up Ecommerce

First: Set up a goal for the shopping cart! Funnel for shopping cart steps Don t provide a $ value (we ll get to that next) 138

Ecommerce Tracking Tracks transactions: Products, quantities, dollar amounts, shipping, etc. NOT a replacement for your ecommerce platform, but a way to track it Not a full-fledged order tracker Not an accounting system Tracks the success of your website in contributing to sales and revenue 139

How Ecommerce Tracking Works 2 parts: Extra tracking code placed on receipt page that records items, dollar amounts, etc. (or, integrates with Google Checkout) Turning on Ecommerce Tracking in the Profile Settings 140

Ecommerce Tracking Code Goes on the receipt or thank-you page Records summary of the transaction and a detail of each item 141

Ecommerce Tracking Code <script type="text/javascript"> var pagetracker = _gat._gettracker("ua XXXXX 1"); pagetracker._trackpageview(); </script> <script type="text/javascript"> pagetracker._addtrans( "1234", // Order ID "Mountain View", // Affiliation "11.99", // Total "1.29", // Tax "5", // Shipping "San Jose", // City "California", // State "USA" // Country ); pagetracker._additem( "1234", // Order ID "DD44", // SKU "T Shirt", // Product Name "Green Medium", // Category "11.99", // Price "1" // Quantity ); pagetracker._tracktrans(); </script> 142

Ecommerce Tracking Code <script type="text/javascript"> var pagetracker = _gat._gettracker("ua XXXXX 1"); pagetracker._trackpageview(); </script> Regular Google Analytics Tracking Code Ecommerce code should come after this 143

Ecommerce Tracking Code: Transaction pagetracker._addtrans( "1234", // Order ID Required "Mountain View", // Affiliation Not Displayed "11.99", // Total Required "1.29", // Tax "5", // Shipping "San Jose", // City Not Displayed "California", // State Not Displayed "USA" // Country Not Displayed ); TIP Don t use commas in large prices. 1000.00, not 1,000.00. 144

Ecommerce Tracking Code: Items pagetracker._additem( "1234", // Order ID Required "ABC4", // SKU Required "T Shirt", // Product Name "Green Medium", // Category "8.00", // Price Required "1" // Quantity Required ); pagetracker._additem( "1234", // Order ID Required "XYZ7", // SKU Required "Shoes", // Product Name "Running 12", // Category "45.00", // Price Required "1" // Quantity Required ); Repeat for each item in the transaction 145

Ecommerce Tracking Code: Send pagetracker._tracktrans(); Sends the information about the transaction 146

Dynamically Place Values pagetracker._addtrans( "<?php echo $array["order_id"]?>", // Order ID "<?php echo $array["total"]?>", // Total "<?php echo $array["tax"]?>", // Tax "<?php echo $array["shipping"]?>", // Shipping ); pagetracker._additem( "<?php echo $array["order_id"]?>", // Order ID "<?php echo $array["sku"]?>", // SKU "<?php echo $array["product_name"]?>", // Product Name "<?php echo $array["category"]?>", // Category "<?php echo $array["price"]?>", // Price "<?php echo $array["quantity"]?>", // Quantity ); 147

Google Checkout Integration http://code.google.com/apis/checkout/developer/checkout_analytics_int egration.html 148

Troubleshooting Ecommerce Walk through your checkout: nothing is as good as placing an actual transaction to troubleshoot Your shopping cart may have a fake credit card number to place test orders or a way to place a $0.00 transaction Otherwise, see if you can make an order and then reverse it Check GIF hits: additional requests go out when _tracktrans() executes for the transaction and each item 149

Filter Fields: Ecommerce Ecommerce Transaction ID Ecommerce Transaction Country, Region, City, Store or Order Location Ecommerce > Transactions (not displayed in reports) Ecommerce Item Name Ecommerce > Product Performance = Product Name > Product Overview Ecommerce Item Code Ecommerce > Product Performance = Product SKU > Product SKUs Ecommerce Item Variation Ecommerce > Product Performance = Product Category > Categories 151

Questions so far? Ecommerce

Learning Objectives After completing this section, you should be able to: Set up goals and funnels to measure conversions Understand common issues with URL goals and how to solve them Implement ecommerce tracking code 153

Questions? Conversion

Measuring Traffic

Learning Objectives After completing this section, you should be able to: Understand how Analytics records campaign information for a visit when it arrives Link an AdWords account with Analytics and populate AdWords reports Use manual campaign tagging with Analytics Understand options for changing how manual tagging functions Add additional search engines to Analytics Troubleshoot problems with tracking traffic sources 156

Google Analytics Sources A visitor s source is determined when they land on the site from the referrer value and stored in the utmz cookie Google Analytics recognizes the following kind of traffic, in this order: AdWords traffic (if properly configured) Campaign traffic (if you specify campaign URLs) Organic search traffic from a variety of search engines (you can add additional search engines) Referral traffic (from websites that do not fall into the above categories) Direct traffic (the referrer value is blank) 157

Checking the utmz value Check the cookie value that is set (using your browser settings, Firefox s web developer toolbar, Developer Tools in Chrome, etc.) 230887938.1280507731.28.3.utmcsr=google utmccn=(organic) utmcmd=organic utmctr=deadly%20titles%20of%20google% 20Analytics 158

Refer(r)er The HTTP Referer is a field that is passed to a page by a web browser when someone arrives from another page 159

Campaign Variables: Medium & Source Medium: How they came Direct Referral Organic Search Paid Search Source: Who we work with to make that happen Direct Source (none) Referral Source site names Search Engine Yahoo!, Google, etc. Additional variables Campaign Keyword Content 160

Direct traffic source TIP Direct (a blank referrer) never overwrites existing campaign information. In any other case, when a visitor enters the site from a new source, the utmz cookie is updated. 161

Questions so far? Measuring Traffic

Medium Source Campaign Medium: How they came Direct Referral Organic Search Paid Search Add your own? Email Banner RSS? Source: Who we work with to make that happen Direct Source (none) Referral Source site names Search Engine Yahoo!, Google, etc. Campaign: Marketing activity Spring 2008 cuts across everything 163

So How Do You Do It: Campaign Links YOU control the link. You tack some labels onto the end of the link. When a visitor clicks the link and arrives at your site, Google Analytics records those labels. There s nothing to set up or configure in Google Analytics, you just make the link. Marketing folks can create their own URLs without IT having to set anything up. 164

Campaign Links: How They Work We can use some query parameters that Google Analytics recognizes: www.example.com/page?utm_medium=email &utm_source=newsletter &utm_campaign=spring-2010 These represent the medium, source, and campaign. TIP These query parameters can generally peacefully coexist with other query parameters used by your site, CMS, etc. Just make sure that they are not stripped off or redirected. 165

URL Builder makes it easy http://bit.ly/17gqv 166

Campaign Variables utm_source utm_medium utm_campaign utm_term utm_content TIP Ensure that these parameters are not stripped out of URLs during a redirect. They should appear as query parameters on the final page after all redirects have occurred. 167

Using alternative query parameters If your site already uses existing tracking parameters that correspond to medium, source, campaign, etc. you can tell Analytics to use those instead: pagetracker._setcampaignsourcekey(queryparameter) ; queryparameter is the query parameter you want to use instead of utm_source This should come before the _trackpageview() call (because that is when the cookies are set) There are additional methods for medium, campaign, etc. TIP If you are leveraging existing parameters, you must include a source. You can do without any of the other parameters (medium, campaign, etc.) if you need to, but the more information you can supply, the better your data. 168

Using alternative query parameters So suppose you are currently using the following tracking URL: www.example.com/page?tracking-id=1234 You could reuse your existing tracking-code parameter as source or campaign or whatever makes sense www.example.com/page?tracking-id=1234 &utm_medium=banner &utm_campaign=spring-2010 We let tracking-id substitute for utm_source by using the following code in our GATC: pagetracker._setcampaignsourcekey( tracking id ); 169

Using the anchor instead of query parameters If you need to avoid conflicts with existing query parameters or are trying to avoid duplicate content issues with multiple URLs for a page, you can use the anchor for campaign variables intead: pagetracker._setallowanchor(true); allows use of anchor for campaign your URLs should look like www.example.com/landing/page.html#utm_source= 170

Offline Advertising Redirect a vanity URL to the campaign-tagged link (Use a 301 redirect) example.com/promo www.example.com/page?utm_medium=print &utm_source=magazine &utm_campaign=spring-2010 171

Internal Campaigns Often you have internal banners or other promotions within your site. Don t use campaign tags for links within your site, only external links that lead to your site. You don t want to overwrite someone s original source information on an internal link. You can use something like the following instead: /target/page.html?from=top-banner You can then see this separately in the Top Content report. 172

Questions so far? Measuring Traffic

Make AdWords & Analytics Talk AdWords can track extra information automatically, and also import data into Analytics TIP Link your accounts by starting from the AdWords interface. Make sure the AdWords account administrator login is also an administrator on the Google Analytics account you wish to link.

Autotagging Medium = cpc Source = google Campaign, Keyword, Content = campaign, keyword, and ad headline from AdWords AdWords > My Account > Account Preferences This works by appending a tracking parameter to the URL of the destination page: www.example.com/landingpage/index.html?gclid=12345

Import Cost Data Analytics > Analytics Settings > Profile Settings

Troubleshooting AdWords traffic is showing up as organic? Autotagging is not turned on in your AdWords account Tracking parameter is being stripped off by a redirect on your site AdWords traffic showing up as cpc, but no detailed campaign information is available? Autotagging is turned on but cost data is not applied

Troubleshooting You see 0s for the Clicks tab in AdWords reports Cost data is not applied to the profile

Questions so far? Measuring Traffic

Organic Traffic Google recognizes a list of search engines by default: http://code.google.com/apis/analytics/docs/tracking/gatrackingtraffic.htm l#searchengine 180

Adding Search Engines You can add search engines by specifying a regular expression for the hostname and the query parameter used for keywords: pagetracker._addorganic(searchsite, keywordparameter); searchsite is the site keywordparameter is the query parameter the site uses to contain the keyword a user searched for This should come before the _trackpageview() call (because that is when the cookies are set) TIP Check out the list of supported search engines. If there are industry- or region-specific search engines that are important to you that are not included, you can add them through this method. 181

Questions so far? Measuring Traffic

Redirects and Referrers You can safely use redirects on landing pages IF: You use server-side redirects (301 or 302), which pass along the Referer header The redirects leave query parameters in place (utm_source & friends for campaign tracking, gclid for AdWords) Test this: Follow a link to the site and inspect the Referer header to make sure it shows the URL you came from Follow a campaign tagged link and ensure that the query parameters show in the URL when you arrive on the landing page 183

Client-side redirects Redirects that make Bad Things Happen (client-side redirects): meta-refresh redirects JavaScript redirects BEST: Change this to a server-side redirect ALTERNATIVE: Include GA tracking code on the redirect page, before the redirect occurs, to capture the source Less than ideal because this affects bounce rate (all the redirected visitors aren t counted as a bounce, even though the first page they saw didn t have any content) 184

Specify a link s referrer should not count For links that you control, you can use the following format: www.example.com/landingpage.html?utm_nooverride=1 The utm_nooverride=1 query parameter specifies to Google Analytics not to record source information when the page is loaded with this link TIP This is most commonly used for links in marketing to already existing customers. For example, we might put this in an email or a branded paid search campaign if we didn t want that to overwrite an existing source (like a non-branded paid search campaign). 186

Troubleshooting: Self-Referrals For example.com, you might see example.com as a referring site. Why? Subdomains or cross-domains that aren t set up to share cookies and be treated as one big site in Analytics (we ll cover this later) Untagged pages on your site (including redirects you can t fix) 187

Specify a certain referrer should not count If there are certain referrers you don t want to count: pagetracker._addignoredref(referrer); referrer is the site you want to exclude This should come before the _trackpageview() call (because that is when the cookies are set) TIP If you have self-referrals (yoursite.com shows up as a referrer to itself) that you cannot fix in any other way (tag untagged pages, fix bad redirects, implement cross-domain tracking), you can use this to ignore those referrals. 188

Questions so far? Measuring Traffic

Learning Objectives After completing this section, you should be able to: Understand how Analytics records campaign information for a visit when it arrives Link an AdWords account with Analytics and populate AdWords reports Use manual campaign tagging with Analytics Understand options for changing how manual tagging functions Add additional search engines to Analytics Troubleshoot problems with tracking traffic sources 190

Questions? Measuring Traffic

192 xkcd HTTP://XKCD.COM/208/

Measuring Content

Learning Objectives After completing this section, you should be able to: Set up Site Search reporting Explain the differences and tradeoffs between virtual pageviews and event tracking Implement tracking with virtual pageviews or event tracking 194

Measuring Content Setting up Site Search Event Tracking and Flash 195

Site Search Engine 200

Search Results URLs http://www.googlestore.com/googlesearch.aspx?fi lter=[gscategory:+wearables]&q=jackets Query parameters: After the? in URLs, separated by &s Category (optional) filter=[gscategory:+wearables] query parameter filter Term q=jackets query parameter q 201

Site Search Setup Profile Overview 202

Site Search Setup Profile Settings 203

Site Search Setup Edit Profile Settings 204

What if there s no query parameter? You can fake one by changing the GA tracking code on the search results page: pagetracker._trackpageview(url); Supply an argument to the trackpageview() function You might use something like this: document.location +?q= + searchterm 205

Questions so far? Site Search

Tracking Non-Pageviews Anywhere the URL doesn t change or tracking code isn t on the destination page: Downloads Links to external sites Video and audio players Interactive AJAX and Flash elements Fix problems like forms that post back to the same page 207

Tracking Non-Pageviews Anywhere someone clicks, you can track with additional Google Analytics tracking code. JavaScript has events such as click, submit, mouseover, We can apply Google Analytics anywhere we can trigger a JavaScript function. There are two approaches: Virtual pageviews Event tracking 208

Virtual Pageviews Show in reports just like real pageviews Because they re like real pageviews, you can use them for goals Be aware that they will inflate your pageview numbers TIP Downloads such as PDFs are good candidates for virtual pageviews, since they re essentially another pageview to the site, just in a different format. TIP If the action is something you need to use as a goal, use the virtual pageview approach. 209

Virtual Pageviews: Code The virtual pageview code: pagetracker._trackpageview(url); Call this on an onclick, onsubmit, or other event (in addition to regular tracking code on the page): <a href= /files/download.pdf onclick= pagetracker._trackpageview(this.href); > Download the PDF now! </a> We ll talk about some more complex scenarios in a few minutes 210

Event Tracking Similar to virtual pageviews, but don t count as pageviews Have a special set of reports and allow more categorization Can t use as goals (but available in Advanced Segments, etc.) 211

Event Dimensions Category: High-level grouping of a type of event Examples: Videos, Downloads, Games, Outbound Links Required Action: Within a category, what did the visitor do? Required Label: Additionally differentiate the event Optional Value: A numerical value assigned to the event No specific meaning associate with the value, could be dollars or seconds or points or anything Optional 212

Example: Video Category: Video Actions: Play, Pause, Stop, Watched To End Label: Title of video Value: Timestamp TIP Think in advance about what you really want to capture. Do you want to know every time someone pauses a video? What s really important? (In this case, maybe play and watched to end.) 213

Example: Game Category: Game Action: Play, Save, Finish Label: Level Value: High Score 214

Event Tracking: Code The event tracking code: pagetracker._trackevent(category, action, label, value); Call this on an onclick, onsubmit, or other event (in addition to regular tracking code on the page) 215

Questions so far? Event Tracking

Race condition between href and onclick For outbound link tracking When you click a link, 2 things happen: The browser follows the link The browser executes the onclick event As a result, if a new page loads before the _trackpageview executes, you may not get tracking 217

Race condition between href and onclick Best practice: Use a function that tracks the pageview, then follows the link after a short delay. <a href= http://www.externalsite.com onclick= mylinktracker(this);return(false); > Download the PDF now! </a> mylinktracker() is a function we will define momentarily return(false) tells the browser not to follow the href of the link 218

Race condition between href and onclick In the head of our page (or in an included script file), we ll include our mylinktracker() function: <script> function mylinktracker(link) { pagetracker._trackpageview("/outbound" + link.href); settimeout('document.location = "' + link.href + '"', 100); } </script> 219

Automate Tracking You don t have to manually tag every link or other item you want to track with an onclick attribute. Use a library (or code of your own devising) to inspect the DOM for all elements that meet your criteria and attach an event handler to them. A few jquery examples PDFs: $('a[href$=pdf]') Mailto links: $('a[href^=mailto] ) Outbound links: $('a[href!=example.com] ) 220

YouTube Videos YouTube has a JavaScript API for the embedded video player Broadcasts state change information: unstarted, video cued, playing, paused, buffering, ended Create a script to monitor for this state change, and fire a Google Analytics event http://code.google.com/apis/youtube/js_api_reference.html 221

Questions so far? Event Tracking

Flash: ActionScript OnRelease (button) { geturl('javascript:pagetracker._trackevent( "games","save game","racing challenge", "340");') } Really simple example 223

All-Flash Sites Entire site built in Flash: just one HTML page, and different content loads within a Flash file Events or Pageviews? It s a judgment call What do you want to count as a pageview for the pageview metrics? What do you want to be able to use as a goal? What do you want to be able to use the categorization and value features of Event Tracking for? 225

Questions so far? Event Tracking

Bounce Rate Both virtual pageviews and events count as interactions toward bounce rate So if a visitor lands on a page and clicks something with a virtual pageview or an event, they are no longer a bounce TIP In general, it s a bad idea to automatically fire an event or a virtual pageview in addition to the pageview that is tracked when the page loads. If you do, you ll have a 0% bounce rate. 227

Limitations There is a limit of approximately 500 events and pageviews per visit As you approach 500, events may be ignored so that pageviews continue to be recorded TIP In general, it s a bad idea to automatically fire events on a short-delay timer (like every second during a video) because you may quickly exceed this limit. 228

Troubleshooting Content Inspect the GIF hit Are there filters that affect pageviews or events? Does the pageview appear in Top Content? Does the event appear in Event Tracking reports? 229

Learning Objectives After completing this section, you should be able to: Link an AdSense account to Analytics Set up Site Search reporting Explain the differences and tradeoffs between virtual pageviews and event tracking Implement tracking with virtual pageviews or event tracking 230

Questions? Content

Measuring Visitors

Learning Objectives After completing this section, you should be able to: Change the expiration date of Analytics cookies Understand the uses of custom variables Implement custom variable code Understand the difference between custom variables and the user defined field 233

Adjusting Cookie Length utma: Visitor identification (2 years) utmb & utmc: Maintain session (30 minutes/close) utmz: Information about the source (6 months) pagetracker._setvisitorcookietimeout(time) pagetracker._setsessioncookietimeout(time) pagetracker._setcampaigncookietimeout(time) time is a time in milliseconds This should be set before the _trackpageview() call, since that is when the cookies are set. 234

Those Dimensions/Metrics Aren t Enough? Custom Variables is a feature that lets you collect more information about your visitors Set on three different levels: Visitor (stored in the cookies, returns with the visitor) Visit (applies to the current session only) Pageview (applies to the pageview only) TIP Recording custom variables requires extra tracking code. For more information, see the Resource Guide or the Google Analytics 301 Seminar. 235

Custom Variable Examples Visitor-level variables (intrinsic to the visitor or semi-permanent) Demographic information: age, gender, income, family, occupation, etc. Customer information: member or subscriber or gold club Original source information: how did they originally find out about us Session-level variables (behavior during a particular visit) Added an item to the shopping cart Viewed a particular section of the site Pageview-level variables (behavior on a particular page) Saw a particular promotion or banner 236

Custom Variables: Code Custom Variables are key/value pairs pagetracker._setcustomvar(index, key, value, scope) index we ll get to momentarily key and value are the label and value for the custom variable scope is the scope: 1 is visitor, 2 is session, and 3 is pageview. The default is 1 if you don t supply a value. 237

Custom Variable Tracking utmv cookie stores visitor-level variables (session and pageview variables are not stored in cookies) Variables are sent as a piggyback on the GIF request, so they should be set before _trackpageview (or _trackevent) index is a slot from 1-5 where the custom variable is stored The last value recorded for a particular index during a session is the value reported for the session 238

Where do the values come from? You have to have them already in your application Insert the value dynamically in the JavaScript: pagetracker._setcustomvar(1, "eyes", <<dynamically fill in eye color>>, 1) 240

Where does the code go? It depends on where you re collecting this information. Maybe you know it because someone filled out a form: put the code on the thank you page. Maybe you know it because someone has logged in: put the code on the page someone gets after logging in. 241

Custom Variables Reports 242

User Defined Custom variables replace the User Defined field in Google Analytics However, the User Defined report is still available, and the _setvar() function can coexist with custom variable code User Defined is available in filters, while Custom Variables are not 243

Questions? Visitors

Managing Cookies and Tracking

Learning Objectives After completing this section, you should be able to: Understand how Google Analytics uses cookies to store information Understand the issues associated with tracking domains and subdomains Implement tracking for subdomains and cross domains 246

Types of Cookies DEFINITION: First-party cookies Browse to www.example.com and receive cookies from www.example.com DEFINITION: Third-party cookies Browse to www.example.com and receive cookies from www.adnetwork.com Browsers have security settings that can accept or reject firstparty cookies and/or third-party cookies. First-party cookies are considered more trustworthy. Google Analytics uses first-party cookies. 247

Domains & Subdomains example.com www.example.com video.example.com store.example.com Cookies are set to the full domain. If you want to treat all the subdomains as a single site, you need to tell Google Analytics to set them to the main domain (example.com). This requires changes to your tracking code. 248

Domains & Subdomains www.example.com example.com video.example.com store.example.com You can also treat multiple domains as one big site. thirdpartysite.com 249

Cross-Domain Tracking: Do you want it? You have 2 options: Place the regular tracking code on both sites. Place tracking code on both sites with additional code to pass cookies from one site to another ( cross-domain tracking ). The data you see in Google Analytics is different depending on which approach you take. 250

Cross-Domain Tracking Pass the visitor s cookies with them as they go from site to site (using extra code). Since the cookies are the same, the visitor is 1 unique visitor and shows their original campaign information on both example.com and thirdpartysite.com. TIP Cross-domain tracking is often critical for sites where the visitor lands on one domain, but converts on another. Third-party shopping carts are a common example of this. 251

No Cross-Domain Tracking Use the same tracking code (within a single account, or in separate accounts) to track sites in the same account. Visitors have separate cookies for each site. Since the cookies are different, a visitor is 1 unique visitor for each site, and you will see referral traffic from example.com to thirdpartysite.com and vice versa. TIP This approach works well for loosely-connected networks of sites, or in situations when you want to see the flow of traffic between sites. 252

Tracking Multiple Sites TIP No matter which approach you use, you must have the ability to put tracking code on the site you want to track. No code, no data. 253

Questions so far? Understanding Cookies

Cookies and Domains utma utmb utmc utmz university.edu noseycookie.com 255

Subdomains housing.university.edu admissions.university.edu 256

Subdomains housing.university.edu admissions.university.edu university.edu 257

Subdomain Code Use the top domain: pagetracker._setdomainname( university.edu ); Leading dot: If you re making changes to existing sites, NO leading dot preserves current cookies. If you have sub-sub-domains, you NEED the leading dot Set this before the _trackpageview() call (because that s when the cookies are set) 258

URLs Now we have a problem: admissions.university.edu/index.html housing.university.edu/index.html both appear as /index.html in Content reports 259

Append hostname to beginning of URL 260

Append hostname to beginning of URL.* Dot. matches any character Star * zero or more Together they grab the value of the entire field 261

Append hostname to beginning of URL Advanced filters let us grab values in variables and place them in an output field Enclose the captured value in parentheses $A1 The first captured value in field A $B1 The first captured value in field B End result admissions.university.edu/index.html housing.university.edu/index.html 262

Fixing URLs Note that this will break the Site Overlay and other reports that open the URL from within Google Analytics 263

Questions so far? Subdomains

Cross Domains university.edu university-mba.edu 266

Cross Domain Code Use the.edu domain? pagetracker._setdomainname(.edu ); 267

Cross Domain Code, Part 1: Set up Cookies pagetracker._setallowlinker(true); pagetracker._setallowhash(false); _setallowlinker(true) enables passing the cookies between domains (by a method we will see in a moment) _setallowhash(false) turns off domain hashing in the cookie (which is an error-checking feature that ensures the cookies goes with the domain, but it would break what we re about to do) Also use _setdomainname() as well if you have subdomains (good practice even if you don t but might someday) _setdomainname( none )? AVOID 268

Cross Domain Code, Part 2: Pass Cookies When a visitor leaves one domain for another (by clicking a link or submitting a form), you use a function to pass the cookie values with them. The site on the receiving end gets the cookie values, records them, and the session is maintained. pagetracker._link() pagetracker._linkbypost() 269

_link <a href="http://newsite.com/test.html onclick="pagetracker._link('http://newsite.com/te st.html');return false;"> click me</a> alternative: pagetracker._link(this.href); return false; TIP You can use a script to attach this event to all links in the DOM that go to this site 270

_linkbypost <form name="myform" method="post" onsubmit="pagetracker._linkbypost(this)">... </form> 271

How it works The cookie values are appended as query parameters in the GET or POST request They are read by the receiving site and used to construct cookies http://www.otherdomain.com/? utma=186993195.2706337 88.1166470528.1207333& utmb=...utmccn=(referral) utmcm d=referral utmcct=%2f& utmv=& utmk=159531197 272

Troubleshooting Self-referrals: you see example.com (or a subdomain) as a referring site in your analytics for example.com Often due to links between domains missing the _link() or _linkbypost() Tracking them down Use the Referring Sites report Remember, even after you fix them, some visitors who return directly may still have the referral in their utmz cookie You can use _setignoredreferrer() if nothing else helps, but that s not ideal 273

Questions so far? Cross Domains

Taking It To The Next Level Conversion Optimization

Post Click Optimization LP Goal

Testing 5% 10% 5%

Google Website Optimizer Limitations A/B/N Multivariate Maximum Number of Pages: 127 Maximum page sections: 8 Maximum variations per section: 127 (in addition to the original content) Maximum combinations: 10,000

Website Optimizer vs. Analytics Visits 12 34 5 1 Conversions 12 1

Website Optimizer Account http://www.google.com/websiteoptimizer

Tagging Pages A/B Test TEST (A)

Tagging Pages A/B Test TEST (B)

GOAL Tagging Pages A/B Test

TEST PAGE Tagging Pages Multivariate Test

Tags Multivariate Test Page Sections Get Yourself a Slinky! <h1> <h1> <script>utmx_section( Header )</script> Get Yourself a Slinky </h1> </noscript> </h1> <script>utmx_section( Image )</script> <img src= slinky1.gif > </noscript> $3.99 <script>utmx_section( PriceStyle )</script> <p class= price >$3.99</p> </noscript>

GOAL Tagging Pages Multivariate Test Goal

What about my SEO??? Will running Website Optimizer experiments affect my search ranking? Website Optimizer keeps original content visible in the HTML source Will running GWO experiments affect my landing page quality score? Using Website Optimizer won't negatively or positively impact your landing page Quality Score

I don t want to test with all my traffic!!!

Reading Reports A/B Expected conversion rate range 0.03 0.13 0.23

Confidence Interval Observed conversion rate is less than the original Observed conversion rate is greater than the original.

Status Bar and Estimated Conversion Rate We have a winner!

Status Bar and Estimated Conversion Rate We have a loser!

Multivariate Report Page Sections

Multivariate Report Page Sections Factor has some influence on conversion rate. Factor has little to no influence on conversion rate.

Over Time Charts

Patience is a virtue

Google Website Optimizer Advanced Testing

Multiple Page / Sitewide Tests TEST PAGE

Testing Dynamic Pages <img src= /images/mint-juleps-small.jpg > src= /images/mint-juleps-big.jpg >

Options: Vary the CSS itself Render BOTH every time & toggle Testing Dynamic Pages <div id= orig > <div id= alt > <style> <script> Alternate Original OFF, CSS definitions Alternate ON

Testing Dynamic Pages - Tokens <div id= price >%%product_price%%</div> <script>var v = utmx( variation content, Section1 ); <h1>%%product_name%%</h1> if (v) { document.write( <img src= %%product_image%% > v.replace( %%product_name%%, <? print $product_name?> ). replace( %%product_price%%, <? print $product_price?> ). replace( %%product_image%%, <? print $product_image?> )); document.write( </nosc + ript> ); } </script>

... Non-Pageview Goals <script> function trackgoal(){ var pagetracker=_gat._gettracker("ua-xxxxxxx ); pagetracker._trackpageview("/kkkkkkkkkk/goal"); } </script>... onclick= trackgoal(); onclick= trackgoal(); onenterframe= trackgoal(); trackgoal();

Non-Pageview Goals <?php if($productvalue > 500){?> <script> var pagetracker=_gat._gettracker("ua-xxxxxxx ); pagetracker._trackpageview("/kkkkkkkkkk/goal"); </script> <?php }?> if($crosssell == true) if($featureditem == true) if($margin > 30%) if($leadtype == premium ) if($zipcode == 90210 )

Conditional Testing <?php $ref=getlocation($ipaddress); if(strpos($ref, UNITED STATES, VERMONT )!=FALSE){?> <script> function utmx_section(){}function utmx(){}(function(){var k='2062586364',d=document,l=d.location,c=d.cookie;function f(n){if(c){var i=c.indexof(n+'=');if(i>-1){var j=c.indexof(';',i);return c.substring(i+n.length+1,j<0?c.length:j)}}}var x=f(' utmx'),xx=f(' utmxx'),h=l.hash;d.write('<sc'+'ript src="'+'http'+(l.protocol=='https:'?'s://ssl':'://www')+'.googleanalytics.com'+'/siteopt.js?v=1&utmxkey='+k+'&utmx='+(x?x:'')+'&utmxx='+(xx?xx:'')+'&utmxt ime='+new Date().valueOf()+(h?'&utmxhash='+escape(h.substr(1)):'')+'" type="text/javascript" charset="utf-8"></sc'+'ript>')})(); </script> <?php }?>

Offline Goals Phone Leads Two Tracking Systems GWO for cookie handling / traffic splitting Phone tracking system for conversions VAR A VAR B VAR C Stats must be done outside of GWO: A/B/N MVT

Automagic Google Analytics integration A/B Use Advanced Segments

Google Analytics integration A/B

Google Analytics integration - Multivariate //GA integration Code using Custom Var in SLOT 1 at Session Level if(typeof(utmx)!== 'undefined') { var combonum=utmx('combination'); if(combonum==0){ combonum="control"; } pagetracker._setcustomvar(1,"combo",combo Num,2); } //End GA integration Code

Google Analytics integration

Advanced Segments Google Analytics integration MVT

Questions? Google Website Optimizer

Extracting Data

Yes, Virginia, there is an API It s an export API for processed data It s not an export API for raw data It s not a configuration edit or data import API Libraries & code samples in JavaScript, Java, curl, PHP,.NET, Ruby, Python (some official, some third-party/open source) 318

Other Reporting Tools and More http://www.google.com/analytics/apps 319

Questions? Extracting Data

Understanding Each Other: IT and Marketing

You ve learned all the solutions What are the questions they address? You need to work hand in hand with the business users of analytics to understand what they need and want: Help them understand what s possible (and what isn t) Help them troubleshoot mysterious data Help them understand technical issues (like cookies)

Marketing They ll have lots of questions about tracking marketing campaigns. They may say this in lots of ways: I need to know if this email does well I need to know if this landing page does well I need to see navigation from landing page X to thank you page Y That isn t really what they mean They need campaign tagging They need goals

Content They ll say: I need to know if people view this module or section I need to know when people click the Flash banner on the homepage I need to know if people actually watch this video They need: Event tracking or custom variables

Questions so far? Understanding Each Other

Resources Google Analytics Help Center http://www.google.com/support/analytics/?hl=en Google Analytics Conversion University http://www.google.com/support/conversionuniversity/ Videos http://www.youtube.com/googleanalytics Official Blog http://analytics.blogspot.com/ User Forum http://www.google.com/support/forum/p/google+analytics/?hl=en

Resources Google Code Site http://code.google.com/apis/analytics/ All the developer docs live there Tracking code Data API Integrations Code examples, libraries, etc.

Resources Our blog http://www.lunametrics.com/blog and check out our blogroll for other GA blogs Books specifically about Google Analytics Advanced Web Metrics with Google Analytics by Brian Clifton Performance Marketing with Google Analytics by Sebastian Tonkin, Caleb Whitmore, and Justin Cutroni

Google Analytics 301 lunametrics.com/blog twitter.com/lunametrics facebook.com/lunametrics twitter.com/theharrison