By Alistair Dent

As you are by now all aware, Yahoo search ads are now being served by Microsoft adCenter. This presents a problem for trying to track these two search engines in Google Analytics.

  • Search

Back to blog home

How did it used to work?

Google Analytics works really well with AdWords. If the two accounts are linked, you don't need to do anything to tell GA all the information about the search. That's not the case with all traffic sources though. In fact on both Yahoo and Bing in the past you needed to tag your pay per click campaigns.

Campaign tagging is a practice of adding query strings to your landing pages. So instead of pointing people to "" you'd instead point them to "" or equivalent. Adding the material after the question mark doesn't change what page loads (the software on your server typically ignores everything after that point) but the code on the page (in particular the GA script) can see that and use it.

Google Analytics supports certain query parameters, and if you use those it understands what you mean. It will convert those into real visit parameters before the data hits GA, so instead of seeing a page like "" you'd just see the actual page, and that visit would be associated with that value.

The query parameters GA understands are:

  • utm_source: this gets used to populate the traffic source
  • utm_medium: this tells Google what type of traffic it is, e.g. referrer, cpc or organic
  • utm_term: keyword, if applicable
  • utm_content: what ad variation you're using
  • utm_campaign: what ad campaign this traffic is coming from

What's the issue?

In the past you would set up these tags on your landing pages on Yahoo and Bing so that GA could identify the correct traffic source. But now that the same campaign runs on both, you need a slightly more complex tracking mechanism to be able to differentiate between the two.

Regular expressions

Regular expressions are a programming tool supported by Google Analytics that lets you test if a piece of text matches something you set, and extract portions of that text if necessary. We're going to show you how to set these up on filters in GA to be able to get your Yahoo and Bing traffic tracked.

Step 1

First make sure that your campaign is tagged correctly. Use the GA URL Builder if necessary.

Set your source to be something like yahoo-bing.

Set your medium to be cpc.

Set your campaign term as {keyword} - this ensures that the keyword in your PPC campaign is tracked correctly.

Set the campaign name to match your campaign, and the optional campaign content only if required.

Step 2

Create a new profile in GA. We're going to change the filters, which changes the raw data that gets stored by your profile. Always have one profile left unfiltered, for comparison.

In your new profile we're going to create some advanced filters.

Step 3

Create a new filter, choose "Custom Filter", and choose "Advanced".

You then need to set up the three fields that have appeared underneath.

  1. Campaign Source: (yahoo-bing)
  2. Referral: https?://([^/]+)
  3. Campaign Source: $A1, $B1

Set both field A and field B to required.

What it does

This filter accomplishes several steps. First it checks if the campaign source is equal to yahoo-bing, the setting we determined earlier. We don't want to do the next steps on any traffic except the yahoo and bing traffic.

Secondly we extract the domain of the referral URL. Whenever a visitor comes to the site, the browser remembers what page they came from. What we care about here is the domain of that page, whether it was Yahoo or Bing.

Finally we take our domain, and insert it back onto the end of our campaign source.

This means that traffic from Yahoo will eventually look like: yahoo-bing,

Make sure that the settings for Field A Required and Field B Required are set to yes, and that you have chosen to override the output field.

The result

In your Google Analytics account, your Yahoo and Bing traffic is now split into two distinct traffic sources, just like it used to be.

You can run any set of reports you need as normal. Analyse your traffic by source and hey presto, you get your Yahoo & Bing PPC campaign traffic back.

Share this article