Update to an Old Favorite – Detailed PPC Keyword Data in Google Analytics

Back in November of 2006, our friends at GA Experts posted a method to get detailed PPC keyword data from Google Analytics. This method involved creating a seperate profile and using some intimidating but powerful filters. I really liked and referenced this method because it isolated the changes to a single profile and didn’t involve any updates to the GA tracking code. Obviously I would prefer if this feature came built-in to GA but at least now you could get to some very useful data with very little work. Lots of keywords!

As Google Analytics was updated over time, the way the filters were using Custom Field 1 was no longer possible and so the profile broke. The smart folks over at ROI Revolution came up with another way to get to the exact PPC keyword data using the User Defined field and adding 2 lines to the GA tracking code. This was a great solution and probably suitable for a lot of people. However, I preferred not having to update the tracking code (this can be very difficult on some client sites), saving the User Defined field for other uses, and also being able to isolate the keyword extraction and concatenation to one profile.

I still see some blogs referring to the original method that doesn’t work anymore so one day I tried playing with the original filters approach and after 2 months of observing the data, it appears to be working correctly. Please follow these screenshots & instructions to give it a try for yourself.

Filter 1 – look at only paid traffic data.

  1. From your account, click on Filter Manager.
  2. Click on Add Filter.
  3. Give it a name such as Data Filter – PPC.
  4. Filter type is custom filter.
  5. Select on the Include option.
  6. The filter field should be Campaign Medium.
  7. The filter pattern can be cpc|ppc
  8. Click on Save Changes.

PPC Keywords Filter 1

Filter 2 – extract the actual keyword that was typed and concatenate it to the paid keyword that was matched.

  1. Assuming you are still in the Filter Manager, click on Add Filter.
  2. Give it a name such as Data Filter – PPC Keywords.
  3. Filter type is custom filter.
  4. Select the Advanced option.
  5. Field A -> Extract A should be set to Referral and the value needs to be (\?|&)(q|p|query)=([^&]*)
  6. Field B -> Extract B should be set to Campaign Term and the value needs to be (.*)
  7. Output -> Constructor should be set to Campaign Term and the value needs to be $B1 – ($A3)
  8. Field A required, Field B required, and Override Output Field all need to be set to Yes.

Please click on the screenshot to view the full version.

PPC Keywords Filter 2

Finally create a new profile with a name such as PPC Keywords Data and all your usual settings (default page, search settings, goals, etc). Make sure you apply these two new filters to it.

This method seems to work for Google, Yahoo, and MSN paid traffic. Below is a screenshot with sample results. Let me know if it works for you!

Result of PPC Keywords filters

35 thoughts on “Update to an Old Favorite – Detailed PPC Keyword Data in Google Analytics”

  1. Rehan, does method of obtaining ‘searched keywords’ affect the click data within Analytics? The original filter method used to affect the clicks data.


  2. Hi Eddy,

    Are you talking about the data in this report?
    Traffic sources -> Adwords -> Adwords campaigns -> Clicks tab
    Please let me know if this is not the report you are talking about.

    When I compare this report in the “main profile” and the “ppc keywords profile”, the data looks to be the same.

  3. A few months ago I implemented these advanced (ppc query) filters on about 5 or 6 different Analytics Accounts and found great results.

    All of these Analytics accounts were integrated with their respective AdWords Accounts and were showing PPC queries in detail.

    However, from 23rd March 2009, these suddenly stopped working. Now there is no PPC visits data all.

    AdWords campaigns for these accounts are still running. I CAN see AdWords data inside Analytics accounts in normal profiles. These are the advanced profiles (using filters) that are creating problems.

    The new advanced profiles with advanced query filters still showing other (organic, referral) visits but no PPC data, not even simple PPC visits.

    It is strange as every thing was normal a week ago.

    Any reasons? Help PLEASE.

  4. Hello Atiq,

    I checked a few accounts and don’t seem to be having this problem.

    Do me a favour and log into Adwords, click on the Analytics tab, and make sure each profile (especially the PPC keywords one) has the Apply Cost Data checkbox as checked.

    Also, while you are doing that see if there are any other differences between the profiles.
    Let us know what you find.

  5. Hi Rehan

    Thanks alot, problem solved. It was Apply Cost Data checkbox that was unchecked.

    Once again thanks for your great help. One more issues, this time it is with ecommerce data matching with referal, when transaction is carried out on third party site (WorldPay) that does not allow passing cookies or redirect users after sale completeion.

    Complete details are posted on Google Analytics Help Group. No final answer yet. http://www.google.com/support/forum/p/Google+Analytics/thread?tid=2c821eba10078545&fid=2c821eba1007854500046053c9252fff&hl=en

    Please help.

  6. Hello Atiq,

    Worldpay doesn’t let you put the Google Analytics tracking code on their site, right?
    What about Google Adwords code on the thank you page? Is that possible?

  7. Is their anyway to merge event tracking information with keyword data so that I can see which kewords are driving my subscriptions and Info Requests?


  8. Hi Oliver,

    I’m looking in Google Analytics right now and I don’t see a way to go from the keywords report to a list of event/actions/labels.

    But you can go from an action like “Video – Play” (in the Event Tracking -> Actions report for me) and segment by keyword to see if certain keywords cause more videos to be played.

    Hope that helps.

  9. Thanks for the wonderful read. Good that you have done a great deal of home work related to the topic. Keep up the Good Work.
    All the best!

  10. I have been using this or a similar filter for some time, but there appears to be a problem. The multiple term keywords extracted do come out with a plus sign between them, but the page views per visit and goal tracking is messed up. There are absolutely no goals tracked. If you filter your keywords by (type in) \+, you will find them. Select Paid traffic. The average pages per visit is very low, but the average time on site and bounce rate is normal. Our site high volume and I am sure after landing many people visit more than 1 page and end up completeing a goal. Has any seen this and knows how to fix?

  11. Hi Bill,

    Hard to say what is wrong without looking at your exact setup, but you can try this:

    1) Create a new profile.
    2) Apply the above technique, exactly and without modifications.
    3) See if the data looks all right a few days later.

    It may be that one of your filters or profile settings is slightly irregular and is causing the problems you mentioned.

  12. Hello Rehan,

    I juz added these two filter for my webstie, but finally nothing happens on the report.
    Recently, i am worrying about the inability of reporting yahoo adwords. because all traffic sources are come from “direct”.

    I know it is impossible for all sources coming from “direct”, would you mind analyzing this situation for me?

  13. hello Rehan,

    I have two profile, the first one is http://www.goldmaxint.com with no filiters, it showed that all sources are “Direct”.

    Another profile is the same domain (goldmaxint.com), but it was using two filiters. After 1 day, the GA also showed that all sources are also “Direct”.

    Please help me =) , I am going to be fired by my boss. hehe

  14. Hello Terence,

    Since one profile without filters is showing all sources as direct, the problem has nothing to do with the PPC keywords profile.

    I would look for things on your website that can break GA tracking, such as poorly implemented tracking code or analytics-unfriendly redirects such as meta refreshes.

  15. Hi, Thanks for this post. I have created both the filters in GA for my site as suggested above.
    My Adwords account consists of both search & content campaigns. So, while checking the GA data I saw that the search campaigns are being tracked fine. i.e. the GA data shows the keywords/search terms the user is looking for in the keyword column. My concern is with the tracking of my content campaigns. It displays the “content + URL” in the keywords column for a few campaigns, while just the term “content with out a URL” for a few others. Why is that so? Is there a way to find out what the URL’s for these content campaigns are?


  16. Hello Rehan.

    Thank you for your advice =)

    Which filters should i add in order to track yahoo adwords? since the above filters seems not work in my website.

  17. Hello Terence,

    No filters will help you track google or yahoo ad systems until the data issue you described (all traffic showing up as direct) is resolved.

    Once the data start coming in properly, the filters from this post or other similar posts will work just fine.

  18. Hi Shilpa,

    The content network is little trickier.
    If you were a publisher via AdSense, there is a Google Analytics integration option from the interface.
    Most of us aren’t publishers of ads so we have to go with less elegant options.

    There are posts out there that show how to get some data about the content network in a separate profile.
    For example, this post by GA Experts and another by ROI Revolution.

  19. Terence,

    There are many blog posts out there that show how to track Yahoo Search Marketing (YSM) inside of Google Analytics. A quick search on Google or Yahoo will give you what you need.

    My advice is to focus on your data attribution issues first, otherwise your YSM tracking efforts might not bear fruit.

  20. Hi Rehan,

    One quick question. I have been using the DCMP codes to track my ppc campaigns. I am running it across different SEM platforms like Adwords, Bing & Yahoo SEM. However, the ppc keyword filter I created (as suggested by you) shows the Source as Google for all the keywords that are being tracked here. It doesn’t segregate the Yahoo SEM from Bing & Adwords. Is there any string I can pass to help me track this data as well. Or do I have to use the utm source in my ads & only then would it track the data? It would be great if you could help :(

  21. Hi Shilpa,

    It’s odd that it would show Google as the source for all three paid marketing platforms.
    Can you post an example of a DCMP code you would use?

    Most likely utm_source is necessary but I’ll let you know after looking at an example DCMP code.

  22. Hi Rehan,

    I’m interested in using this code, is it still applicable today with all the advances in Analytics?


  23. Hi James,

    With advanced segments, secondary dimensions, and better keyword reports right out of Adwords, we don’t create this profile for most clients.
    On the other hand, since the report data modifications are isolated to one profile, you can always run this technique in another profile to see if you get any value out of it.

    Everyone’s reporting and analysis needs are different – no one solution fits all.
    Try it out, and if you don’t like it you can simply delete the extra profile and filters.

Leave a 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 class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">