Archive for the ‘GAIQ Lessons’ Category
Additional Customizations
How to change Session Timeout Value
In Google Analytics, a visit—or session—is defined by 30 minutes of inactivity, or when a user quits the browser. You can change the 30 minute default by calling _setSessionTimeout() as shown in the slide. Simply specify a new timeout value in seconds as the argument to _setSessionTimeout().
How to change the campaign expiration
By default, a conversion can be attributed to a campaign that is up to 6 months old. But, if your business has a longer or shorter marketing campaign timeframe, you can change this value. Just call _setCookieTimeout() and specify your new campaign length in seconds. For example, let’s say that you want to set a campaign length of 30 days. To figure out the number of seconds that is, type “30 days in seconds” into Google Search. The search engine will give you the answer — 2 million, 592,000 seconds — which you can plug into _setCookieTimeout().
How to change campaign precedence
Google Analytics attributes conversions to the campaign that most recently referred the visitor. For example, let’s say that someone discovers your site by clicking one of your AdWords ads. Then, they come back to your site by clicking a banner ad that you’ve tagged with campaign variables. This time, they convert to one of your goals. By default, the banner ad will get the credit for the conversion, not the AdWords ad that originally referred them. To change this behavior, you can tag all of your campaign links with utm_nooverride=1. If you do this consistently with all of your campaigns, Google Analytics will attribute conversions to the first referring campaign, instead of the most recent one. Note that the utm_nooverride setting can be used in conjunction with autotagging.
How to add search engines
Google Analytics automatically tracks referrals from over 30 search engines. But, if you want to add a search engine, you can do it by calling _addOrganic() in your Google Analytics Tracking Code. First, perform a search in the search engine and look at the URL of the search results page. In the URL, look for the keyword you searched — it should be preceded by a letter and an equal sign. This letter is the query variable for the search engine. In the example, the query variable is “p”. Add a call to _addOrganic in your Google Analytics Tracking Code. The first argument is the name of the search engine. The second argument is the query variable.
How to Treat Certain Keywords as Direct
You may wish to treat traffic that results from certain search keywords as Direct. For example, if someone searches for the exact name of your site, you might want to treat that visit as a Direct visit instead of a search. To do this, simply add a call to _addIgnoredOrganic() in your Google Analytics Tracking Code. Specify the keyword as the argument.
Treat Certain Referring Sites as Direct
You can also treat referrals from certain sites as Direct traffic instead of as referrals. For each site that you want to exclude as a referral and treat as Direct, add a call to _addIgnoredRef() in your Google Analytics Tracking Code. Specify the name of the site as the argument.
The Custom Visitor Segment Variable
‘User Defined’ versus Predefined Variables
Google Analytics provides over a dozen predefined variables that you can use to analyze different segments of your traffic. For example, segmenting a report by City allows you to compare how visitors from different cities interact with your site. But, Google Analytics also provides a custom segmentation variable that you can use to classify visitors any way you like. It’s called User Defined.
Example: Member versus Non-Member Visits
For example, you could use the User Defined variable to divide your visitors into two groups, members and non-members. Each time a visitor signs in to your site, you could set the User Defined value to “Member”. A visitor who never signs in would have the default User Defined value of “not set”. So, your User Defined variable would have two possible values — “Member” and “not set”. This would allow you to compare, for example, conversion rates for members versus conversion rates for non members.
Example: Returning Member
What happens if a returning visitor is a member but visits the site without signing in? Will the visit still be properly classified as coming from a member? Yes, because the value of the User Defined variable is set in the visitor’s __utmv cookie which is persistent. The visitor is classified as a ‘Member’ until the __utmv cookie expires after 2 years, or gets overwritten with another value. A User Defined value is set at a session level, which means that the value applies to the whole session. So, even if you overwrite the value of “Member” with another value, this visit will still be classified as a Member visit. But the next time the visitor comes back to your site, they’ll be classified according to the overwritten value.
Setting the User Defined Variable
To set a value, just call the _setVar() method and specify your value as the argument. So, for example, to flag a visitor as a member, you’d add the code shown in the slide to a web page of your site that is accessible only by visitors who are logged in. The call to _setVar() must appear after your Google Analytics Tracking Code on the web page. Calling _setVar() sets a persistent first-party cookie for the visitor called __utmv. Again, the visitor will be labeled as a ‘Member’ until the __utmv cookie expires after 2 years, or gets overwritten with another value.
Code Example: Form Selection
Let’s say you want to assign a visitor’s User Defined value according to his or her response on a form. For example, if you have a form that asks the visitor to select one of four job categories, here’s how you could capture the response as a User Defined value.
Practices and Guidelines
Even if you overwrite a previously set User Defined value, the current visit is still classified according to the value that was overwritten. Only subsequent visits will be classified according to the new value. So, User Defined values are best used to segment your visitors according to characteristics that don’t change frequently — things like profession or age group. You could capture this kind of information from a visitor survey, for example You might use the User Defined variable to segment visitors according to site activities they have participated in — for example people who have signed up to receive a newsletter versus those who haven’t. Another use of the User Defined variable is to filter out your internal traffic. Although you’d generally use an exclude filter to exclude a range of IP addresses, you might have trouble doing this if your company uses dynamic IP addresses. To get around this, you could call _setVar() on a page that is only accessible internally to label employees as ‘Internal’, and then filter out visits based on this value.
Viewing Report Data
To compare traffic, conversions, and e-commerce for each of your User Defined values, look at the User Defined report in the Visitors section. For each value that has visits associated with, you’ll see an entry in the table.
Event Tracking and Virtual Pageviews
Web Analytics in Transition
Many websites use technologies such as Flash and Ajax to interact with visitors. For example, some websites embed video players, games, and other interactive experiences on site pages. However, the basic web analytics model of tracking pageviews doesn’t capture these kinds of interactions. This is because when a visitor interacts with a video player, for example, no pageview is generated. Some other examples of interactions that don’t generate pageviews are Ajax-based activities, file downloads, and clicks on links that take the visitor to another site. So how do you track these kinds of activities? There are two ways: virtual pageviews and Event Tracking.
Virtual Pageviews
You can create a virtual pageview to represent practically any kind of activity or interaction you want. You simply call _trackPageview() and provide any name you want as the argument. It’s “virtual” because you’re telling Google Analytics to register a pageview even though no new page has actually been loaded. You’ll see these virtual pageviews alongside ordinary pageviews in the Top Content and Content Drilldown reports.
Example Code
If you look at the Google Analytics Tracking Code, you’ll notice that it calls _trackPageview(). This lets Google Analytics know that the browser has loaded a page. When you call _trackPageview(), however, you’ll want to provide an argument that specifies a virtual pagename for the event you’re tracking.
Uses of Virtual Pageviews
Here are some more examples. In the first example, we’re tracking a download. In the second example, we’re tracking a Flash event. In each of these cases, we’re simply calling _trackPageview() to register a virtual pageview.
Best Practices for Creating Virtual Pageviews
It’s a good idea to adopt a clear naming convention for your virtual pageviews. You might, for example, group virtual pageviews into categories by giving them a virtual subdirectory. Also, since virtual pageviews appear along with standard pageviews in reports, you may wish to create a duplicate profile where you filter out the virtual pageviews. To make this easy, you might organize all of your virtual pageviews into a “virtual” subdirectory.
Event Tracking
The other way to track non-pageview interactions is to use Event Tracking. One advantage of using Event Tracking is that you won’t generate an extra pageview each time an interaction occurs. Another advantage is that you can easily organize your events into categories, actions, and provide labels and even values for each event you track. All of your events show up in the Event Tracking reports within the Content section.
Call __trackEvent() to register an event
To use Event Tracking, you’ll need to use the ga.js based Google Analytics Tracking Code. So, if your site has urchin.js tags, you’ll need to migrate to the ga.js tags. Once you’re using ga.js, all you need to do is call the _trackEvent() method each time you want to register an event. We’ll discuss the arguments to _trackEvent() in a minute.
Example: Tracking a Flash Video Player
Here’s an example of how you’d call _trackEvent() from a Flash video player. In this example, _trackEvent will get called each time the visitor releases the Play button on the video player. _trackEvent will register an event with a category name of “Videos”, an Action name of “Play”, and a Label of “Movie Drama”. Let’s look at each of these arguments.
Event Tracking Data Model
Let’s look at each of the arguments to _trackEvent. The strings that you provide for the first 3 arguments, Category, Action, and Label, govern how the events will be organized in your reports. So, you’ll want to think carefully about how you want to structure your events.
Categories
Category is a name that you supply as a means to group objects — which are usually user interface elements that you want to track. So, for example, if you have games and videos on your site, you’d probably want to have a “Games” category and “Videos” category. The Categories report in the Event Tracking section will show you all the user interface elements with which your visitors interacted.
Actions
Action is the name you want to give to the type of interaction you’re tracking. So, for example, for Videos, you’d probably want to track how many times your visitors pressed Play. The Actions report in the Event Tracking section will show you the interactions that occurred.
Labels
The Label argument is optional. A Label allows you to provide additional information for for the event you are tracking. For example, if you are tracking video plays, you might use the Label argument to specify the name of the movie that was played. Or, for file downloads, you might use it for the name of the file being downloaded. The Labels report in the Event Tracking section will show you the Labels of of the events that occurred.
Values
Value is the fourth, and optional, argument to _trackEvent(). Unlike the other arguments which are all strings, Value is an integer. You can use it to assign a numeric value to a tracked page object. You’ll then be able to see a sum total of these values in the Event Value column of your Event Tracking reports. You’ll also be able to see an average of these values in the Avg. Value column of your Event Tracking reports. So, you might, for example, specify a dollar value when a specific playback marker is reached on your video player.
Total Events versus Unique Events
In your reports, you’ll notice that both Total Events and Unique Events are counted. Total Events is simply the total number of times an event occurs — really it’s just the number of times _trackEvent was called. But, for Unique Events, each particular event is only counted once per visit. So, if during a single visit, a visitor presses Play 5 times on the same movie, Total Events will be incremented by 5. But Unique Events will only be incremented by 1, because for Unique Events, a particular event is only counted once per visit.
Best Practices for Setting Up Event Tracking
As we mentioned earlier, the arguments you provide when you call _trackEvent will govern how events are organized in your reports. So, before you add the calls to _trackEvent to your site, consider these best practices. First, determine in advance all of the kinds of events you’ll want to track. Try to create a hierarchy of Categories, Actions, and Labels that will grow with your needs. Work with your report users to make sure that the hierarchy makes sense. And use a clear and consistent naming convention for your Categories, Actions, and Labels. Finally, note that a maximum of 500 events per visit will be tracked. So, avoid tracking highly repetitive events such as mouse movements
Advantages of Event Tracking over Virtual Pageviews
If you use the urchin.js Google Analytics Tracking Code and you track events using virtual pageviews, you may be wondering whether it’s worth it to switch to ga.js and use trackEvent() instead. By using ga.js and trackEvent(), you’ll be able to analyze event based interactions in much greater detail than is possible using virtual pageviews. For example, instead of just seeing how many times a movie was played on your site, you’ll be able to analyze how people use your video player, and see how different events correlate with site usage and ecommerce metrics. Also, by tracking events separately from pageviews, you won’t inflate your pageview count.
Internal Site Search
Internal Site Search Reporting
Google Analytics provides internal site search reports that allow you to see how people search once they’ve arrived at your site.
Why is Internal Site Search Important?
So why analyze how people search your site? On both large and small sites, visitors frequently use search boxes as a form of navigation. By looking at what people search for, you can identify missing or hidden content on your site, improve search results for key phrases, and even get ideas for new keywords to use in marketing campaigns.
Setting Up Site Search
In order to set up Site Search Tracking for your website, you’ll need to configure your Profile settings. On the Analytics Settings page, click ‘Edit’ next to the profile for which you want to enable Site Search Tracking.
Once the Profile Settings page appears, look for the Main Website Profile Information section and click Edit.
In the Site Search section, select the ‘Do Track Site Search’ radio button. In the ‘Query Parameter’ field, enter the letter, word or words that designate an internal query parameter. To find out what the query parameter is, perform a search on your site. Normally when a user searches on your site, their query can be found in the URL. For example, if you search on Google.com, you will see your search query preceded by ‘q=’. Therefore, Google’s query parameter would be ‘q.’ In the example above, the query parameter is ‘q,’ and the query was ‘Google Analytics’.
Identifying Your Query Parameter(s)
What is the query parameter in this example? Look at the URL that’s generated by your search. You should be able to find your query and the query parameter in the URL. In this case, the search query was “creating a profile” and you can see that the query parameter is “query”. Your parameter might be different — it could be the word “term” or “search”, Or it might be just a letter, like “s” or ”p”.
Setting Up site Search
If you have a particularly large site, some sections of your site may use different query parameters. You may provide up to five parameters, separating each parameter by a comma. Next, select whether or not you want Google Analytics to strip out the query parameter from your URL. Stripping out the query parameter has the same effect as excluding URL Query Parameters in your Main Website Profile Settings. If, in your Site Search settings, you choose to strip the query parameters, you don’t have to also exclude them from your main settings. Note that Google Analytics will only strip out the query parameters you listed, and not any other parameters in the same URL.
Site Search Categories
If you use ‘Categories‘ on your site – such as the ability to use drop-down menus to narrow a search – you can include categories in your search analytics by following these steps: First, select the ‘Yes’ radio button under ‘Do you use categories for site search?’ Then, enter your ‘Category Parameter’ in the field provided. Enter only the letters that designate an internal query category such as ‘cat, qc,’. The same principle that you used to identify the query parameter can be used to identify the category parameter. You can also contact your webmaster to identify the query and category parameters for your site. Decide if you want to strip out the category parameters that you just provided. If you select Yes, only the parameters you provided will be stripped out. As with the query parameter setting, this has the same effect as excluding URL Query Parameters in your Main Website Profile Settings so if you choose to strip the category parameters here, you don’t have to exclude them again from your main settings. Click ‘Save Changes’ to finish.
Where to Find Site Search in Your Reports
The Site Search reports are located in the Content section of Google Analytics. Click on the Site Search navigation button to see all of the reports. By analyzing your Site Search reports, you can find out: Which products or items visitors are looking for, Where visitors started their search and where they ended up after searching, Whether searches resulted in conversions
Site Search Overview
The Site Search Overview summarizes the search activity on your site. You can get to more detailed reports by clicking on the embedded links in the Site Search Overview, or by using the left navigation.
Site Search Usage
Here we can see that over half of all visits to this site included some form of internal site search, strongly indicating that internal site search is a popular feature on this website. Just above the pie-chart, you’ll notice two dropdown menus. if you select Goal Conversion Rate in the left-most dropdown, you can see how visits that included search compare to visits that did not include search with respect to conversions. And, you can click the ecommerce tab to see how revenue and other ecommerce metrics differ for visits with and without site search.
Site Search Terms
The Search Terms report only includes visits during which a search was performed. From the screenshot on the slide, you can see that there were 5,720 searches and that 4,410 search terms were used. The terms are listed in the table, and you can see how each term compares in terms of number of searches, percentage of search refinements, conversions and other metrics. Looking at the search terms that people use to search once they are on your site can give you ideas for keywords that might also help drive traffic to your site. You can cross segment this traffic. For example, if you wanted to see which cities these visitors came from, you could select City from the Dimension dropdown.
Other Analysis Options with Search Terms
You can see how visitors who searched on a specific term refined their searches. To see this report, click on one of the terms in the table of the Site Search Terms report. Then, from the Analyze dropdown menu, select Search Term Refinement. You’ll see a report similar to the one shown in the slide. This report shows you the terms visitors searched on after their original search and which of these “refinements” are most popular. If many of your visitors search on a common refinement, you might consider modifying the results page to present information related to the refinement.
Where did visitors who search on a specific term start the search from, and where did they go after searching? To find this information, go to the Search Terms report for a specific keyword, and select Search Navigation from the Analyze dropdown menu. Below the graph, you’ll see three columns. The table on the left shows the pages from which visitors began their searches. The icon in the middle represents the search results page and the table on the right shows the pages people visited immediately after the Search Results page. To use the report, click one of the entries in the table on the left. You can now see where those people who began their search on the page you selected ended up.
Site Search Start Pages
You can use the Start Pages report to find out how many searches were initiated on each page of your site. The easiest way to find this report is to click on Start Pages under Site Search in the left navigation. The Start Pages report lists all of the pages from which visitors searched. Click on a page in the table to learn more about the searches that occurred from that page. A detail report will appear which lists all of the search terms that were used from that page. You can use this report to find out what visitors are searching for from your landing pages and you can use the information to improve the page content. For example, if many visitors search on “shipping options” from your shopping cart page, you may want to display shipping information directly on the page.
Site Search Destination Pages
Which pages are most commonly found through search on your site? You are able to see popular destination pages for the search term, as well as additional information on the related search. Click on a page in the table to see the specific search terms that led to the page.
Site Search Categories
The Site Search Categories report helps you determine which categories your visitors selected when performing a search on your site. This information helps you understand how visitors use your search engine, which product areas and categories are most popular, and how successfully visitors find what they are looking for in each category.
Site Search Trending
There are 7 Trending reports which display search activity over time. To access them, click Trending in the left navigation under Site Search. Then select the specific report you want using the Trending dropdown menu in the report. For example, selecting Visits with Search allows you to see how many visits to your site included a search. Selecting Total Unique Searches shows you how many times people searched your site. And, if a visitor searches for the same thing more than once during a single visit, the search will only be counted once.
You May Wonder…
Your Site Search reports will generally show a different number of conversions than what is shown in all of your other reports. This is because goal conversions in the Site Search reports are based on visits that include at least one search on your website whereas the goal conversions shown in all other reports are based on all visits. Because Site Search reports only include conversions from visits that included a search, you can see how effectively searches on your site drive conversions. If you are confused about the difference between “search term” and “keyword”, it’s helpful to remember that Google Analytics reports use “search term” when referring to internal site searches and “keyword” when referring to external searches.
Motion Charts
What are Motion Charts?
Motion Charts allow you to visualize your data in 5 dimensions. You select metrics to be represented on the X and Y axis and by the size and color of the dots. And you can see how the data changes over time. A Motion Chart can help you identify patterns and relationships in your data that you might otherwise miss.
Accessing Motion Charts
Access Motion Charts by clicking Visualize. The Visualize button is available in most reports that show tables.
What You’ll See on the Motion Chart
Each dot on the Motion Chart will be a data point from the report that launched it. So, for example, if you click Visualize on a Keyword report, each dot will be a keyword. You can mouse over each dot to see its label and by clicking it, you can make the label stay visible as we’ve done here for the keyword “google store”. In this chart, the X axis is Pages per Visit and the Y axis is Visits. The color of each dot represents the Average Value. The size of the dots represents the bounce rate. In this Motion Chart, you can see right away that one keyword is much more valuable than the others.
How to Select Metrics
Menus are available on each axis and for dot color and size so that you can select metrics.
How to View Data Over Time
You can view the data over time by either dragging the slider or by pressing the Play button. You can also change the scale of the X and Y axis to linear or logarithmic.
Plotting a Data Point’s History
By selecting Trails and dragging the slider, you can plot the history of one or more data points over time.
Saving a Motion Chart
You can save the settings of any Motion Chart so that you can access it later. To do this, click Link to Chart and copy and save the link that’s provided.
Example Visualization: Keywords
Let’s use Motion Charts to analyze two keywords from the Google Store. The slide compares two Motion Charts side by side– one chart for each keyword. The same metrics are used in both charts. By comparing the size of the dots, we can see that the keyword on the left attracts much less revenue than the keyword on the right. But even though it brings in less revenue, the conversion rates on the left are much higher — indicated by the warmer colors. So, it might be appropriate to try to attract more traffic on this keyword by buying it. The keyword on the right is clearly valuable because it brings in so much revenue. But the low conversion rate suggests that it would be better to attract this traffic organically rather than through paid search. Both keywords are attracting mostly new visitors, so it might make sense to create promotional programs for existing customers.
Advanced Segmentation
What are Advanced Segments?
With Advanced Segments, you can quickly isolate and analyze subsets of your traffic. You can create an advanced segment that only includes visits that meet a specific set of criteria. So, for example you can create an advanced segment that only includes visits from a certain geographic region or visits during which more than $100 was spent.
Advanced Segments vs. Filtered Profiles
While it’s possible to create filtered profiles that segment traffic data, there are some differences between filtered profiles and advanced segments. Advanced segments can be applied to historical data, but a filtered profile will only filter traffic going forward. When you create an advanced segment, that segment is available across all of your accounts and profiles. But, a filtered profile is only useful for a specific web property. You can compare up to four advanced segments side by side in your reports. In contrast, filtered profiles can only be viewed one at a time. It is much easier to create an advanced segment than it is to create a filtered profile. If you want to permanently affect the data that a profile shows, you should use a filtered profile. So if you want a profile that only shows CPC data, you should set up a filtered profile to do this. And if you want to restrict user access to only a subset of data, the best way to do this is to set up a filtered profile and restrict the users’ access to only that profile.
Applying an Advanced Segment
To apply an advanced segment, simply Click Advanced Segments and select the segments you want. The Default Segments are predefined, so you don’t have to do anything to use them except to select them. The All Visits segment under Default Segments is enabled by default.
Once you’ve applied one or more advanced segments, you can see the data for the segments throughout all of your reports.
You can also change your date range and see the segments applied to historical data. The segments remain applied until you deselect them or you logoff or view reports on another account or profile.
Creating an Advanced Segment
Let’s create an advanced segment that only includes visits during which more than $100 was spent. Begin by clicking the Advanced Segments pulldown. Next, click Create a new advanced segment.
Now you’ll see a screen that looks like this. Using this screen, you ca combine one or more logical statements to define a segment.
To include only visits during more than $100 was spent, first look for the metric Revenue. It’s usually easiest to type what you are looking for into the search box, but you can also browse the complete list of metrics and dimensions. Now, drag the metric into the work area. Select the condition Greater than and specify 100. By clicking Test Segment, you can see that 25 visits meet the condition.
You can add additional logic, but for now, let’s just name and save the segment.
The segment will now appear in the Custom Segments area of the Advanced Segments pulldown.
Modifying an Advanced Segment
Now let’s modify this segment so that it only includes visitors from California. Click Manage your advanced segments. The Manage Advanced Segments screen will appear. This screen lists both the predefined default segments and your custom segments. If you want to build on an existing segment without changing the original segment, you can click copy next to the segment you want to build off of. But if you want to change an existing segment, click edit. You can only change Custom Segments. Let’s click edit next to the custom segment we just created.
Adding Conditions to a Segment
You can either add an Or condition or an And condition.
In this case, we only want to include visits that meet both conditions — revenue that exceeded $100 and coming from California. So, let’s click “Add And statement.”
Now, we can drag Region into the added condition and specify that Region must match California.
By clicking Test Segment, we can see that there were 25 visits with purchases of more than $100, Over 7000 visits from California, and 6 visits which match both conditions.
Finally, rename the segment if you wish and then save it.
The original segment is replaced by the new one and you can now apply it to your reports.
Custom Reporting
Designing a Custom Report
You can create reports that show exactly the information you want to see, organized in the way you want to see it. When creating a custom report, think of a table. Dimensions are the rows of the table and metrics are the columns in the table. This report has two dimensions — in green — and four metrics in blue. So, the report will show pageviews, bounces, visits, and revenue for each source and keyword.
Creating a Custom Report
Click on the Custom Reporting menu to get started. If you have no reports defined, your Custom Reporting Overview will look like this. You’ll see a help article link and links to sample reports. Click ‘Create new custom report’ to build a new report.
Adding a Title and Tabs
To name your report, just click on the title field, enter a report name and click Apply. Make your name simple and easy to identify so that you’ll be able to quickly find it in a list. You can also provide a name for the report tab. This is particularly useful if you add multiple tabs to your report.
Adding Metrics
The next step is to select the metrics and dimensions you want. Use the search box to find metrics and dimensions. You can also click a menu item to expand it and browse all of the available metrics or dimensions. To add a metric or dimension to the report, simply drag and drop it into the table.
Adding Dimensions
Here is a report with four metrics. Now, let’s add dimensions. You can add up to 5 dimensions for each custom report – one top level dimension, and up to four sub dimensions. The sub-dimensions allow a user to drill down to more detailed data. Some combinations of metrics and dimensions aren’t allowed. If you see a metric or dimension greyed out, it’s because the combination isn’t available. Review the chart available in the Google Analytics Help Center for an overview of permitted combinations:
http://www.google.com/support/googleanalytics/bin/answer.py?answer=99174
Viewing and Accessing the Report
You’ll see the new report listed under the Custom Reporting menu. Now that the report has been saved, you can access it anytime. In this custom report, we can click any of the Sources to see the keywords for that source. Lets click ‘google’.
Deleting a Report
Click on the Custom Reporting menu link to access the Custom Reporting Overview page shown in the slide. Here you can see a list of saved custom reports and you can edit or delete any of them. Click Edit to modify the report.
Editing a Report
By editing a report, you can add, remove or modify metrics and dimensions, add tabs, and change the name of the report. Creating a new tab allows you to drag a different set of metrics onto the report. To experiment with this, click Add Tab. Here we’ve created a new tab called Visitors.
Domains and Subdomains
Understanding Domains
So far in this course, we’ve focused on tracking within a single domain. Before we learn how to track across multiple domains, let’s understand why we might want to do this. A domain is a hostname that represents a numeric IP address on the internet. It allows us to easily identify a website by a name instead of having to use a long string of numbers. For example, Google.com and YouTube.com are both domains owned by Google.
Tracking Across Domains Doesn’t Happen Automatically
You may sometimes need to track activity across multiple domains. A common example of this is when you send visitors from your site to a separate shopping cart site to complete their purchases. However, since Google Analytics uses exclusively first party cookies, it can’t automatically track whether those visitors actually complete a purchase or not, because the purchase is taking place on another site. Phrased more generally, if a session spans multiple domains, it would not be possible to track the session as a single visit attributed to one visitor. So, you’ll need a way of sharing the cookie information between the two domains.
The __link() Method
By calling the _link() method, you can send this cookie information across domains. This allows Google Analytics to track a user across multiple domains by sending cookies via URL parameters.
Tracking Across Domains (Step 1)
To track across domains, you’ll need to follow two steps. First, add a few lines to the Google Analytics Tracking Code on all pages of each site. The lines you need to add are shown here, in blue. Call _setDomainName() with an argument of “none”. And call _setAllowLinker() with an argument of “true”.
Tracking Across Domains (Step 2)
The second step involves the _link() method. Use this method in all links between domains. In this example, we’re updating all links from Google.com to YouTube.com and vice versa. We update each link to call the _link() method as shown here. Now, when a user clicks on a link that takes them to the other domain, the session information is preserved and the user is identified as being the same visitor across both domains.
Forms and __linkByPost() Method
If you use a form to transfer your visitors from one domain to another, you will need to use the _linkByPost() method instead of the _link() method. This situation occurs most often with third party shopping carts. To use forms to transfer from one domain to another, you must modify all the appropriate forms with the code shown here. The _linkByPost() method will change the form action by adding query-string parameters to the value in the action attribute when the visitor submits the form.
Subdomains
You may also sometimes need to track across multiple subdomains. A subdomain is part of a larger domain and frequently each subdomain contains the pages for a specific department or offering. For example, Google.com has several subdomains such as news.google.com, sites.google.com, and maps.google.com. Since Google Analytics uses first-party cookies, cookies set on a subdomain can not automatically be read on the main domain, and vice versa. As with multiple domains, you need to explicitly share the cookie information between subdomains or you’ll lose session information. If you don’t share cookie information between your subdomains, it may appear as though your own site is a referrer since only one domain is recognized as the main domain.
Tracking Subdomains Using __setttDomainName()
To track across multiple subdomains, call _setDomainName() and specify your parent domain name as the argument. This will allow the Google Analytics Tracking Code to use the same cookies across the subdomains. For example, to track across Google’s various subdomains, you would call _setDomainName() with an argument of “dot google dot com”. A side effect of using this method is that your reports may not differentiate between visits to identically named pages within the various subdomains. So, for example, visits to maps.google.com/home.html and mail.google.com/home.html would be interpreted as visits to a single page. To correct this, you’ll need to set up an advanced filter. We’ll explain this in a minute.
Best Practice #1 for Tracking Subdomains
There are a few best practices for setting up your Analytics account to track across multiple subdomains. First, create separate profiles for each subdomain. This way, you’ll be able to see reports for each subdomain. Set up duplicate profiles – one master profile, plus one profile for each subdomain. In this example, we’re looking at two subdomains. Your master profile has no filters, and each of the other two has an Include filter. Profile 1 includes all traffic to both subdomains. Profile 2 includes only traffic to subdomain A. Profile 3 includes only traffic to subdomain B.
Best Practice #2 for Tracking Subdomains
Second, if you track across several subdomains within one profile, your reports may not differentiate between visits to identically named pages within the various subdomains. This is because the reports only show the Request URI — which, in this example, is /home.html. The hostname — maps.google.com — is stored in the Hostname data field in Google Analytics. So, once you’ve called _setDomainName() to set your primary domain name, visits to maps.google.com/home.html and mail.google.com/home.html would be interpreted as the same page–”/home.html”. To correct this, you can set up an advanced filter to include the subdomain in your reports. Set up your filter as shown in the slide. Note that the constructor must match exactly what is shown in the slide, starting with the forward slash. The filter works by appending the Hostname to the Request URI. As a result, you’ll be able to distinguish between identically named pages on your subdomains.
Multiple Domains with Subdomains (Step 1)
If you want to track across both multiple domains and subdomains, you’ll need to ensure that the Analytics cookies are set across the subdomains and that the cookies are being passed between the parent domains. There are two steps. For the first step, add the lines of code shown in blue to Google Analytics Tracking Code on every page of of one of Domain 1 and each of its subdomains. Make sure that _setAllowLinker() has an argument of true and _setAllowHash() has an argument of false. Then, to each page of Domain 2 and each of its subdomains, add the same code — but with a different argument to _setDomainName().
Multiple Domains with Subdomains (Step 2)
For step 2, call _link() or _linkByPost() in all links and forms that cross between the two parent domains. For example, the code shown in the slide shows how you’d do this to track across Google.com and YouTube.com. Note that you don’t need to use _link() or _linkByPost() in links between subdomains within the same domain. Again, you should create separate profiles in your account for each primary domain and/or each subdomain. You can easily do this by using an Include filter based on the hostname field.
Analysis Focus – Revenue Metrics
Goal Value
The Goal Conversion tab displays a metric called Per Visit Goal Value. This metric is calculated based on the goal values that you set on the Goal Settings page.
Revenue
The Ecommerce tab displays three revenue related metrics: Revenue, Average Value, and Per Visit Value. These metrics are calculated using the revenue that is recorded by your Google Analytics e-commerce code. So, what is the difference between Per Visit Value and Per Visit Goal Value on the Goal Conversion tab? Per Visit Value is calculated using e-commerce revenue. Per Visit Goal Value is calculated using static goal values.
Goal Value + Revenue
There are a few places where Goal Value and Ecommerce Revenue are summed. On the Clicks tab, the Revenue per Click, ROI, and Margin are based on the sum total of Goal Values and Ecommerce Revenue. In the Content reports, the $ Index metric is also based on the sum total of Goal Value and Ecommerce Revenue. We’ll look at $ Index next.
What is $ Index?
The $ Index metric appears in most of the Content reports and it allows you to identify the pages that have the most impact on site profitability. A single $ Index value by itself doesn’t tell you much — it’s most useful as a way of ranking pages. By sorting your pages from highest $ Index value to lowest $ Index value, you’ll be able to identify your most important pages. Let’s look at how $ Index is calculated.
$ Index Calculation
The calculation for $ Index assigns the highest values to pages that are frequently viewed prior to high value conversions or transactions. In contrast, pages that aren’t viewed prior to conversions or transactions will have the lowest $ Index values. To calculate the $ Index for a page, total ecommerce revenue and goal value is divided by the number of unique times the page was viewed prior to the conversion or transaction. For example, let’s say that there were 4 visits to your site and 2 visits resulted in a $100 purchase. So, you made a total of $200 from these four visits. If on every one of these visits, the visitor entered your site through the home page, the $ Index value for your home page would be $200 divided by 4 page views. So the $ Index value would be $50. On the 2 visits that included a purchase, the visitor also went to your Features page before purchasing. So, the $ Index value for your Features page would be $200 divided by 2 page views. The $ Index for your Features page would be $100.
Important Points About $ Index
You’ll notice that the calculation for $ Index uses unique pageviews. This means that a page is only counted once per visit, even if a person views the page multiple times before converting. Also, only pageviews that precede the conversion or transaction are counted. If you aren’t tracking ecommerce revenue in Google Analytics and you haven’t assigned values to your goals, all of your $ Index values will be zero. Finally, $ Index is most useful as a point of comparison or a ranking metric, not as a standalone number. It’s designed to help you identify the pages on your site that are most valuable.
E-commerce Tracking
E-commerce Reports
If your site sells products or services online, you can use Google Analytics e-commerce reporting to track sales activity and performance. The Ecommerce reports show you your site’s transactions, revenue, and many other commerce-related metrics. The Overview report and the top level navigation are shown here. Many of the reports allow you to drill down and segment for in-depth analysis.
Report Examples
Some examples of the kind of information you can get from the e-commerce reports include: the products that were purchased from your online store, your sales revenue, your e-commerce conversion rate, and, the number of times people visited your site before purchasing
The E-commerce Tab
E-commerce metrics are also available on the Ecommerce tab which appears in many reports. For example, on the Ecommerce tab of the AdWords Campaigns report, you can see how much revenue is associated with your AdWords campaigns. On the Ecommerce tab of the Referring Sites report, you can see how many transactions are associated with site referrals. And, on the Ecommerce tab of the All Traffic Sources report, you can see the per visit value across all traffic sources.
Three Steps to Track E-commerce
In order to use e-commerce reporting, you’ll need to do three things. First, enable e-commerce reporting within your Analytics website profile. Second, add or make sure that you’ve added the Google Analytics Tracking Code to your receipt page or “Transaction Complete” page. Finally, you’ll need to add some additional e-commerce tracking code to your receipt page so that you can capture the details of each transaction. Let’s take a look at each step.
Step 1: Enable E-commerce Reports
Step 1 is simply to enable the E-commerce selection on the Edit Profile Information page. Here’s how you find it. On the Analytics Settings page, click Edit next to the profile for which you want to enable e-commerce tracking. This will take you to the Profile Settings page. At the top of the page, you’ll see a section called “Main Website Profile Information”. Click “edit” in the top right corner. You’ll then see the screen shown here. Select “Yes” next to E-commerce Website and save your changes.
Step 2: Add Google Analytics Tracking Code
For Step 2, check to make sure that the Google Analytics Tracking Code is on your receipt page. You should probably place it near the top of the page because the code you add in Step 3 needs to appear after the Google Analytics Tracking Code. As with the other pages on your site, you can use a server-side include or other template driver for dynamically generated pages. Or, you can simply copy and paste the code into your HTML for static pages. The slide shows an example of the standard Google Analytics Tracking Code.
Step 3: Add Code to Track Transactions
For Step 3, you’ll need to add code to track transaction details. This is an example of what the code on the receipt page might look like. The Google Analytics Tracking Code is at the top. Then, there is a call to the _addTrans() method. The call to _addTrans() tells Google Analytics that a transaction has occurred. The arguments to _addTrans() provide details about the transaction — for example an Order ID, the total order amount, and the amount of tax charged. After the call to _addTrans(), there must be at least one call to the _addItem() method. This call provides Google Analytics with details about the specific item purchased. Finally, there is a call to the trackTrans() method which sends all the data to Google Analytics. Let’s look at each method in more detail.
Creating the transaction: _addTrans()
The _addTrans method establishes a transaction and takes the arguments shown here. Your code will need to dynamically retrieve the values from your merchant software to populate these fields. You can leave some of the fields blank by keeping the extra comma as a placeholder. But note that Order ID and Total are required arguments.
Providing Product Details: addItem()
For each item that a visitor purchases, call _addItem. If more than one item is purchased, you’ll call _addItem multiple times. As with _addTrans, you can leave some of the fields blank, but note that Order ID, SKU or Code, Price and Quantity are required arguments. Use the same Order ID that you used in the call to addTrans(). If you’re not sure how to write this code, contact your merchant software provider.
Recording the Transaction: _trackTrans()
Finally, after the calls to _addTrans and _addItem, you’ll need to call _trackTrans to send the transaction information to Google Analytics. Remember that all of the e-commerce code must appear after the Google Analytics Tracking Code calls _trackPageview.
Secure Pages
Generally, you’ll be placing ecommerce tracking code on a secure shopping cart page. As long as you use ga.js, the standard Google Analytics Tracking Code automatically detects when an https protocol is being used. So you won’t need to add any special tracking code for secure pages. However, if you are using urchin.js, you should review the Help Center article referenced in the slide.
Shopping Carts on Other Domains or Subdomains
For many e-commerce websites, the checkout process occurs on a separate domain or subdomain. For example, if you send customers from www.mystore.com to cart.mystore.com, you’re sending them to a subdomain. If either of these scenarios applies to your site, you’ll need to add some code to some of your pages so that you can track activity across domains and subdomains. The specific methods you’ll use are listed on the slide and you can learn how to use them in the module on tracking domains and subdomains.
