Analytics Questions & Answers: Volume 2

It’s that time again! Time to take your analytics questions (via Google+) and try to provide a useful answer.

This edition includes information about:

  • Tracking across an iFrame
  • A bug with the Ad Content secondary dimension
  • Integrating Google Analytics and Google AdSense
  • Ecommerce reporting based on item category/group

Please note, if I did not get to your question it was for one of two reasons:

1. It was posted after I started writing the post.
2. It may have been a bit too specific. I contacted a few people directly about those questions.
On to the answers!

I also want to apologize for the delay in getting to your questions. I’ll plan a bit better next time!

Your Analytics Questions

Cross-Domain iFrame Question from Michael Walker:

Implementation Question – I have 2x domains lets call them dom1.comand – each have a their own Google Analytics (GA) account.

The problem I am having though is that is as follows – we have a form on that is pulled in from dom2 via an i-frame. the code within the form fires off 2x custom variables to its dom2 GA account. The outer frame on dom1 fires off all the incoming traffic sources and more importantly the campaign data.

Now what I need to do is I need to have the dom2’s GA account filled with the same campaign values – so that I can tie the campaign names to the 2x custom variables. Now I do have some restrictions that forbid me to set the custom variables to dom1’s GA account as even though this would be the simplest way.

So which of the following options should I go down.
1) Set up on the master frame – a second tracker that fires off the campaign data to dom2’s GA account. Leaving dom1’s GA code in place. Also leaving the code in the dom2s frame as is and hope that the custom variables get set as they are ?

2) Attempt when calling the i-frame page to pass all the campaign data in the URL string and hope that the GA code within dom2 recognises it and passes the campaign data?

I have tried using the GA help + forums to no avail and am really stumped on this one.

Please help Justin… even if its the worst set up ever I have to get it working :-(

Justin’s Answer:

Thanks for the question Michael.

So it sounds like you need to have the campaign data and the custom variable data together, in one account. I’m assuming that the custom variables are visitor level custom variables and are stored in a cookie (which makes it hard to combine them with the other GA data).

The problem with option #1 is that you’ll start to inflate the data in the GA account. You’ll have 2 sets of cookies for dom2, thus doubling your visits and visitors.

You could go with option #2: cross domain tracking through an iFrame. But it can be very hard to do because you need to P3P header.

What about an alternate solution? Kind of a “hybrid” solution. Why not pass some special query parameters in the iFrame URL for dom2 and then tweak the GA tracking code on to use those parameters?

You can create three query parameters that represent the campaign information in Google Analytics. You can name the parameters anything you want, maybe camp, med and source. You’ll have to populate the variables dynamically. You can mine the data from the the __utmz tracking cookie.

Make sure on dom2 you customize the tracking code to use your new, custom tracking parameters.

This method will help you avoid cross domain tracking via an iFrame and the overcounting issue.

Canonical URL Tracking Question from Alex Rapp:

What is the best method to track canonical URLs through GA? Utilizing the (opt_pageURL) function or _gaq.push(['_trackPageview', canonical_link]);?

I feel as though they may accomplish the same end result, but seem to go about it in a different manner.

Thanks for your help.

Justin’s Answer

Thanks for the question Alex.

For those that don’t know what a canonical URL is the one true URL for a piece of content. Many times large sites might have multiple versions of a URL for the same content. Sometimes this can be caused by tracking parameters or other query parameters.

Alex, your idea of passing a URI into the _trackPageview method is a very good one. And it’s a solution that people use all the time. One way that I’ve seen it done is that people will include the URI value in a data layer, then pull that value into the _trackPageview call. It’s a scalable solution that normalizes data.

I’ve also seen people use an Advanced Filter to capture the canonical parts of a URL and re-write the data in Google Analytics. For example, if you’ve got a lot of query parameters, and this causes a lot of duplicate URLs, then you can use an advanced filter, like the one in the image below, to normalize your URLs.

Google Analytics Advanced Filter for normalizing a URL

Google Analytics Advanced Filter for normalizing a URL

I personally like the data layer/code approach. It’s more scalable and less susceptible to breaking. But ultimately you’ll need to pick the solution that you can implement.

Ecommerce Tracking Question from Alex Rapp:

I’m having an issue with an ecommerce implementation. During the test phase, I am able to pass through values from the “add_trans” portion of the code, such as: order id & total.

However, I am not seeing anything populate from the “add_item” portion, mainly SKU & quantity.

What am I doing wrong?

Justin’s Answer:

Thanks for the question Alex.

The _addItem code should send back gif requests, one for each item. I would first check the actual gif requests using some type of tool, like Charles, or a browser extension, like the developer tools in Chrome.

Look for GIF requests with utmt=item, this is the item data being sent to Google Analytics.

If you’re not seeing the correct GIF requests sent to the Google Analytics servers then check for syntax errors in the JavaScript. I’ve seen code where a missing comma or some other character will break the JavaScript.

Also make sure that you’re not calling the _trackTrans method before the _addItem method.

Content Grouping Question from Christopher Johnson:

We would like to track page views for individual meta tags on the page, for example, we have a index.html page tagged with Corn, Soybeans and Wheat. What’s the best way to run a report showing all page views for pages tagged with Corn?

We have looked at custom variables but might have pages with 5-10 tags per page.

Justin’s Answer:

Thanks for the question Christopher.

We’ll, you could always buy Google Analytics Premium and get 50 custom variables! Just kidding, sales pitch over :)

If you need to attach more information to a page, and custom variables are not scaling, you could try to use events or you could add more information into the URL.

I like the event option. You’ve got almost a limitless number of events available and you can create a custom hierarchy that will help you segment the data in different ways. Look to use the Category, Action and Label attributes in creative ways to group your data logically.

I also want to mention that this is a very common request. There are a lot of users, some ecommerce, some publishers, that need to ability to group their content together. And while Custom Vars exist you are limited to 5 per page. The Google Analytics team is looking at ways to make this type of functionality better in Google Analytics.

Filtering Question from Eric Bryant:

Is there a glitch in the new Analytics that throws that error when you try to filter by Ad Content? It happens especially when the Primary Dimension is a City or Landing Page, I think.

Justin’s Answer:

Thank for the question Eric.

YES, looks like this is be a bug. Hopefully it will be resolved ASAP.

“Resource Not Available” Question from Dean Shaw:

Justin –

We have been seeing increasing incidences of GA not being available. The exact language is “Resource is not available. Please try again later”.

Related, we have also seen that time out messages when we try and pull data for time-lines longer than a few months.

Finally, when we drill-down on reports we will encounter a flat-line.

This is all in the new interface and cannot be replicated in the old interface where we don’t encounter any of these issues.


Justin’s Answer:

Thanks for the question Dean.

Whenever you query a large date range, and you have a very high volume of data, you might see some of the effects that you’ve mentioned. The Resource not Available message, while delightfully vague, usually indicates that you’re requesting a HUGE volume of data and that the query is taking a long time to retrieve that information.

I should note that there are a lot of improvements that are happening at Google Analytics right now, many of them have to do with the processing of the data and report generation. Hopefully Resource Not Found will begin to appear less frequently.

(not set) Question from Alaa Batayneh:


I have 2 questions.

1) Why do I very often see (not set) whether in traffic sources or any other sections.
2) Is it true that Google Analytics does not record 40% of traffic coming to a site, since it consists of hackers, comment spammers, page scrapper …etc ?


Justin’s Answer:

Thanks for the question Alaa.

Question #1: The value (not set) indicates that a certain dimension of data, like keyword, city, region, etc. can not be identified. For example, if Google Analytics tries to identify a city based on the visitor’s IP address, but the lookup fails, the report will contain a line item for (not set).

Here’s a quick, partial, list of where you might see (not set) and what it means:

  • Geographic reports: (not set) indicates that Google Analytics could not identify the visitor’s geographic location
  • All Traffic Sources: (not set) may indicate that some link tagging parameters are not present. For example, Feedburner often automatically tags links with a source of Feedburner but often omits a medium, thus causing (not set)
  • Page Titles Report: (not set) indicates that the document.title DOM object is not set. This means that GA can not collect the title for the page
  • Devices: (not set) indicates that there is no User Agent that GA can use to identify the device

In addition to “missing” data, (not set) can also indicate that you are trying to combine two dimensions that don’t have any true relationship.

For example, if you are looking at the All Traffic report, and you try to set a secondary Dimension of Keyword, you’ll get (not set) for all of those rows that are not search related (ie referrals, direct, etc.)

Question #2: No, that is not correct. Google analytics will track the traffic to your site as long as it executes JavaScript tracking code. There are some sampling limits that are imposed on large sites. For example, you are limited to 10M hits/month in the free version of Google Analytics). But Google Analytics does not “pre-qualify” the traffic and drop 40%.

0 Result Searches Question from José Dávila:

Hi Justin,

I hope you are doing well and enjoying your time at Google. I have a couple of questions:

1) Do you know if GA regular expressions support negative look ahead? I am talking about something such as: ^(?!.*string-here)

When I tested it you get an alert. However some forums mention it is possible.

2) How would you track “zero results” searches when you use Google Site Search, given that the CSE results are loaded on an iframe with content from a different domain, so not accessible by traversing the DOM. I have an idea for a solution, however I wanted to know if there is an easier way to do it.



Justin's Answer:

Thanks for the question Jose.

Question #1: Unfortunately this is not fully supported in the entire Google Analytics interface. And things that are not fully supportedI’d avoid it and look for an alternate solution.

Question #2: This is a hard one. I’m going to assume you’re using a fairly standard implementation of the Google Custom Search Engine and that you’re also using the automatic Google Analytics integration.

I believe the Google Custom Search engine uses a dynamically generated DIV, not an iFrame.

When you use the Google CSE and Google Analytics integration the CSE code will generate a virtual pageview for the current page. This virtual pageview will include a query parameter for the search term. You could try to untangle all of the CSE JavaScript code and look for the line that generates the virtual pageview. Unfortunately wading through all the CSE code can be a lot of work!

Another option would be to parse the DOM when a search happens on your site.

When the Google CSE returns zero results there is normally an HTML DIV tag that looks something like this:

No Results

You need to dynamically parse the DOM when someone submits a search and identify the above DIV. You can probably simplify this by using JQuery. If you find the above code then you can send off some data to Google Analytics and record the zero-result search.

In this case, I would probably create an Event rather than use the zero-result tracking technique. The reason is that sending a virtual pageview, with a parameter for the zero-result search, will generate an additional search in the Google Analytics reports. You’ll be double-counting some searches.

Sorry I don’t have the exact code for you. I’d love to hear your solution as well!

Product Reporting Question from Steven Domingue:

I have a question about regular expressions in the Product Performance Report in GA. Is there a character limit in the field where you place the RegEx? I am attempting to do some reporting on product sales associated with emails, banners on my site, etc., and some of the product groupings we feature are basically mini catalogs with 200+ SKUs. I wanted to make sure that if I dump a list of 300 SKUs (between 2500 and 3000 characters) it will capture them all in the report.

Thanks Justin!

Justin’s Answer:

Well, that’s actually a hard question to answer. The standard table filter will not take a regular expression. So you need to use the Advanced filter. This field will take a max of 20 characters. But you can add up to 50 conditions to your filter.

To be honest, creating large, complicated regular expressions in Google Analytics is not scalable. While you can use it for a quick ad-hoc analysis, I would look for a more permanent solution.

What about using the Product Category dimensions rather than the product ID? It obviously depends on if you are setting the product category, but it would totally work.

Google Analytics Product Performance By Category with a Source/Medium secondary Dimension.

Google Analytics Product Performance By Category with a Source/Medium secondary Dimension.

Another option might be using a page level custom variable to group your products together into groups? Then use the custom variable in the Product Performance report. It will require some coding, but if you are looking to do this type of analysis a lot it may be worthwhile.

Also, I wanted to mention that the Google Analytics ecommerce reporting could use some improvements. It hasn’t changed in a long, long time and the team at Google has gotten that feedback.

Cross Domain Tracking Question from Rasmus Sellberg:


We’re about to cross-domain track a very short and good domain name with multiple subdomains, e.g. www.xx.yy, forum.xx.yy, and so on.

We use _setDomainName(“xx.yy”), and it works like a charm on all browsers but IE.

Unfortunately, IE does not allow cookies on short domains on the form xx.yy (to avoid security issues on all sites, for instance). No data at all is recorded for IE browsers…

If we use _setDomainName(“www.xx.yy”), the cookies aren’t available on forum.xx.yy, and vice versa.

What should we do, given that neither using _link everywhere nor changing the domain name is an option? Any best practices for really short domain names?



Justin’s Answer:

Thanks for the question Rasmus.

Yes, this is a known issue and unfortunately there is no good solution. It’s a limitation of Internet Explorer…. insert snarky comment here.

Unfortunately you don’t have many options. You can use _link on all of the URLs. And if it’s a big site you may want to use some type of JQuery auto tagging script. Or the other solution is to move the sub-domain content to subdirectories on the main domain. This may be very hard to do, but at least you avoid all the JavaScript coding.

I also want to mention that the Google Analytics team is working on a new solution to cross domain tracking that will solve this problem. It will also make cross-domain tracking better for the entire world :)

AdWords Metrics Question from

When viewing our adwords campaign data in Google analytics our Advertising Cost metric is reporting correctly, but when we try to create a custom keyword level report in GA the cost metric is all zeros? Are we unable to track adwords cost data at the keyword level in GA? 

Justin’s Answer:

Thanks for the question.

You should be able to use AdWords metrics, like cost, CTR and CPC, in GA custom reports. I’ve done it as recently as today.

BUT, cost metrics can only work with a few dimensions, mostly the AdWords related dimensions. If you are trying to use any dimensions that are NOT AdWords dimensions you might get all zeros.

If you want to post a link to the report here I can take another look.

AdSense Question from Reid Simonton:

I may be a bit late, but have to ask as this is an issue I’ve been struggling with for 2+ years – linking our AdSense account to our Analytics account. I understand the process, however here’s what I actually see:

1. Go to Content > AdSense > Overview in GA, see “This report requires AdSense to be enabled for this profile”. Hmm, I’ve already done that.

2. But I’ll try again – click the link provided there for the instructions. Instructions state, “Open either the Overview or Advanced Reports page, and find the link that invites you to integrate your accounts”, but there is no such link in the AdSense panel (presumably because I’ve previously gone through this step). Instead I see a link in the upper right corner of AdSense stating, ” View performance in Google Analytics”. Would seem to indicate the accounts are linked, right?

3. Click that link, it takes me to my Analytics home page (showing my two profiles). I go into the one I’ve attempted previously tried to link w/ AdSense, and (repeat step 1, above).

Something’s clearly broken. Been trying to resolve this for years, have posted bunches of forum posts, etc., but no luck. Incredibly frustrating! Any assistance would be enormously appreciated.


Justin’s Answer:

Thanks for the question Reid.

I’ve seen that problem before. An infinite loop and it’s MADDENING!

1. Log into GA. Make sure you log in with the same account that you use to access AdSense.

2. Go to the Admin section

3. Click on the Data Sources tab for your account and look for the AdSense section.

4. Click on the Link Account button. You should get a little window that asks which account and profiles you want to apply your AdSense data to.

Connect Google AdSense and Google Analytics

Connecting Google AdSense and Google Analytics

The AdSense code and Analytics code MUST be installed on all the same pages. If you do not have the Google Analytics Tracking code on all pages that have the Adsense code, page impressions and clicks cannot be accurately recorded.

AdWords Auto Tagging Question from Steven Nguyen:


I have 2 questions on about Analytics.

1. I have autotagging set up and someone wants to add parameters to the ad as well. Would the new parameters override the autotagging or mess up the reporting in anyway?

2. I want to track lead submissions, sign ups, etc…but it does not redirect you to a “thank you” page after you complete the action, a dialog box pops up. I want to use a destination goal but the dialog box does not change URLs. Is there a way to track it as a goal without adding a “thank you” page?

If you could help, that would be great. Thanks.


Justin’s Answer:

Thanks for the questions Steven.

Question #1. No, AdWords auto-tagging will work with your existing parameters. The Google Analytics auto-tagging parameter, named gclid, will play nice with your existing query parameters :)

Question #2. Yes, there are ways to work around a thank-you page that does not have a unique URL.

I’m going to make the assumption that when someone submits a form the page does change. It’s just the URL that stays the same. In this scenario you have a couple of options. Choose the one that works best for you.

You can use an Event to track this new window, and then set that event up as a goal. An event is a way to track visitor interactions with your site.

You’ll need to add some additional JavaScript to track when the window pops open. It might look something like this:

_gaq.push([‘_trackEvent’, ‘Goals’, ‘Submit Form’, ‘Lead Form’, 100]);

In the above code the value of 100 is the value of the lead form. That’s something that I arbitrarily chose. But if you can do some lead scoring, and enter that data into the code, then you’ll get some AMAZING revenue metrics in Google Analytics.

Once you have the code on your site you can use the Event data to your goal. For the above event, the goal settings would be something like this:

Setting up an Event as a Google Analytics Goal

Setting up an Event as a Google Analytics Goal

Thanks everyone! Those were great. What a variety of questions. Stay tuned, we’ll do this again next month.

Be Sociable, Share!

    Like this post? Sign up to get posts delivered to your inbox.


    1. Josh Breault says

      I keep seeing the same “Resource Not Available” error message as Dean, and am wondering if there is an ETA for performance improvements that will limit or eliminate this from happening. Also, are you aware of any specific limits as far as data set sizes or date ranges that will throw this resource error? Thanks.

    2. Esben Rasmussen says

      Great post Justin – and great questions!

      I would like to add a comment to the “Content Grouping Question from Christopher Johnson”:

      You could still use custom variables – and just use one variable.


      1, // This custom var is set to slot #1. Required parameter.
      ‘Page tag’, // The top-level name for your online content categories. Required parameter.
      ‘corn;soybeans;wheat’, // Sets the value of “Page tag” to “corn;soybeans;wheat” for this particular page. Required parameter.
      3 // Sets the scope to page-level. Optional parameter.

      You can now create an advanced segment using regular expressions that only shows the visited pages tagged with corn – by filtering the values in the custom variable.

    3. says

      About Google Analytics and Google AdSense loop I have encountered the same problem as Reid Simonton, but your answer did not solve it.
      I solved it by changing my profile language from italian to english UK; the loop is generated only for italian and maybe for other languages that are different from english.

    4. says

      Hi Justin,

      Love it that you are taking time to answer all those questions. I just have one regarding the following you said in this post:

      “I also want to mention that the Google Analytics team is working on a new solution to cross domain tracking that will solve this problem. It will also make cross-domain tracking better for the entire world :)”

      We are about to help a client with multiple (sub)domain tracking. They already track all domains with multiple UA-codes, which is not the best solution. This client has a very short URL as well ( Would you advice us to wait for the new solution to cross domain tracking that the Google Analytics team is waiting for?

    5. David says

      Hi Justin,
      I miss the “Old Reporting” in Analytics.

      One page where you saw all traffic to all your (in our case 40) websites. You could choose date range, week, month, year etc. just like usual.

      Very handy to see ALL traffic in a general snapshot.

      Now that it was removed, we don’t have any way to do that. Because (I presume) of all the people who were annoyed by the move, it appears Google has put a minor “tweak” on the logged-in page with a month’s worth of general traffic. I think it ‘s basically a stopgap measure to address the issue.

      It’s missing the ability to choose the date range. Every Monday, we like to see the general traffic, up/ down, time on page etc.for a week’s range.

      Also on the “Footer” it used to say “old reports” but they didn’t actually lead to old style reporting – looks like that’s gone now.

      I guess my question is:

      Why did they do that, and how do you actually request them to bring back the ability for us well-meaning webmasters to view our vast empires in one spot, filtered the way we want?



      • says

        @David: Thanks for the feedback. I assume you’re talking abou the old Admin landing page. If all of your sites are different web properties, then you’ll probably need to look for an API solution. Luckily there are a lot of them out there that can easily create a dashboard for you.

        Unfortunately the old UI is not coming back. Ever. Things change and evolve for a reason. The team is very careful to understand the impact on users before making a change, and while Google tries to minimize the impact there are always some folks that are unhappy. It would be great if 100% of users could be happy 100% of the time.

    6. bret says

      I am trying to track across multiple domains using GA. The problem is the main site is pulling information from a remote site with this javascript:
      var bid= 6517;
      var site =1;

      How do I integrate linkbypost into the javascript?
      Thanks for your help

      • says

        @bret: If the visitor never goes to the remote site, then do you need to track that other domain? Cross domain tracking is only used for when the domain name in the browser changes. If the domain in the browser never changes then I don’t think you need to worry about cross domain tracking.

    7. says

      Hi Justin,
      Hope you’re okay.
      I have a blog which is 5 independent blogs working as one. Every page in the blog is a single independent blog. The challenge am facing is how to make the Google analytic give out result as one. To make easy displaying of total number of unique viewers as one. Please assist me on the hows?

    8. says

      Hi Justin,

      I recently used the “copy profile” feature to copy my master (default profile) in order to add some filters to it. From that day, my master (default) profile stopped reporting data, though the copy is reporting data fine. Is there a limit being placed due to the high amount of traffic?



      • says

        @Sam: I’ve never heard of that problem happening. Is the code still on the site? Nothing has changed with the profile settings? Your data should not disappear, even if you are collecting a lot of data. I can check if there is some type of problem on our end. But I would also double check the code and make sure nothing has changed with the implementation.

    9. says

      I have noticed as of July 27, 2012 a 40-50% drop in visitors to my site as shown in google analytics. We have not done anything different and sales are still great. I thought this may have something to do with Panda release but after reading up on it I am not sure how much it actually affects me. Has there been any changes in the way analytics reads visitors that you are aware of? Thanks.

      • says

        @Angela: No, Google Analytics has not changed. I would try to determine which traffic sources have decreased in traffic. I would also work with IT to identify if any changes were made to the site.

        Hope that helps you get started!


    Leave a Reply to David Cancel reply

    Your email address will not be published. Required fields are marked *

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>