The ROI Revolution Blog

Matching Specific Transactions to Specific Keywords

May 2, 2007

moneyroll.jpgOne of the great things about Google Analytics is the ability to view overall trends for your website. You can, for example, see how well all visitors who come from AdWords are reaching one of your goals. You can see how valuable the average visit from an email campaign is to your ecommerce business. You can see total transactions and revenue, and see what percentage of transactions are coming from a specific marketing source.

But what if you want to see where a specific transaction came from? What if you get a very large order and you want to see what the marketing source for that specific order is? Well, now you can, with a set of three custom filters that work together.

Here are the details:

The first filter in the set, which I'll call Trans List Mod 1, grabs the campaign source and medium of a visit, and sticks in a custom field.

Click here for Filter #1

The second filter adds the keyword (bid term only) to the custom field. For those of you keeping score, the custom field now contains the source, medium, and keyword.

Click here for Filter #2

The final filter takes that custom field we created and appends it to the transaction order id. This matches up sources with specific transactions.

Click here for Filter #3

After you've created these filters, your filter list should look like this:

transfilterlistsmall.jpg
Click on the image for a larger view

Make sure the three filters appear in the order shown above.

The cumulative result of these filters will look something like this:

transaction%20list%20small.jpg
Click on the image for a larger view

As you can see, the traffic source responsible for the transaction will now show up in the transaction list. Easy as pie!

A warning for the wise: I strongly advise you to create a new profile when using this filter set. Keep your other profiles neat and clean, and if you make a mistake with one of the filters, nothing will be hurt. Remember, once you mess up data in Google Analytics, there's no way to get it back!

For those of you that decide to employ these filters, I'd love to hear your feedback. Feel free to post a comment, as we always love to hear what you have to say!

Google Analytics for Online Advertisers
Here at ROI Revolution, we consider Google Analytics tracking essential for paid search, so it's included in our PPC Campaign Management service.

Comments

Chris said:

Hi Shawn,

We've also done some work with this and also had a lot of head scratching to get the results - great post though and cleared up a couple of areas. Regards

Chris

May 3, 2007 4:56 AM

Shawn Purtell said:

@Chris:

Thanks for the nice comment. Let me know if these new filters work out for you. I've only been using them for a little while, so it would be great to get some feedback.

May 3, 2007 8:42 AM

Mikey said:

Hi Shawn,

Great post mate. Like Chris, I've been scratching my head over this & have a couple of clients that will absolutely love this. Thanks :)

Mikey

May 3, 2007 8:22 PM

Shawn Purtell said:

@Mikey:

Thanks! I hope it turns out to be as useful as I think it might. I'd love to hear feedback from you once you've used the filters with clients.

May 4, 2007 9:05 AM

Krista said:

Great Post. These advanced filters are very usefull. I took your training course on Google Analytics. I was wondering if in the future you are going to offer a whole course on advanced implementation and setup where filters like these are taught and where regular expressions could be learned?

May 17, 2007 10:31 AM

Shawn Purtell said:

@Krista:

Thanks for the compliment. The training course that you took includes the most common advanced implementation options that we've encountered (things like Paypal, cross-domain tracking, etc.). We've also included the general ideas about the types of filters you can create. We're currently revamping the course for our new training series, and it will include more about filters and how you can use them to accomplish specific tasks.

In order to get more specific than that, you really need one-on-one attention, because setting up advanced filters really depends on your site and what kinds of information you want to find. This is one example of something our support plans can do for you on an individual level. We try our best to make this information freely available through our blog.

The same sort of thing applies to regular expressions. Regular expressions can get extremely complex, so we covered the most basic/common ones that you can use in our training course. Again, the more advanced regular expressions are only needed in very specific situations that would require one on one attention.

This brings up another point: Google Analytics is like getting a suit (or dress) fitted - you need to take measurements and personal tastes into consideration when you are setting up analytics. There are some steps that are universally important, but when you start looking at your individual site, no two Google Analytics configurations will be exactly alike.

I hope you found this useful. Thanks again for posting and for taking our course!

May 17, 2007 11:13 AM

Shareen Jordan said:

Hi, Shawn.

I really enjoy reading your blog. Thanks for the information. I was wondering, in the first filter you name the constructor field 'custom field 1' and you call it the same thing in the next filter. But (I think)the second filter refers to the custom filed in the first filter. If they are both named the same thing, does the field from the 1st filter overwrite the field from the second filter? And is there any reason why you wouldn't name them differently? Would there be any benefit in naming them customer field 1 and customer field 2?

Thanks! Shareen

June 5, 2007 3:04 PM

Shawn Purtell said:

@Shareen:

Thanks for the compliments. As far as your question, I only had to use a single custom field across all three filters.

So, filter 1 puts the source and medium into custom field 1.

The second filter reads the custom field from filter 1 and adds the term to what was already there.

The final filter adds the custom field we built in the previous two filters to the transaction id.

This is why the order of these filters is so important. They will not work out of sequence (they also should be next to each other on the filter list).

I didn't use two separate custom fields (although I could have) because I really only needed one.

As far as 'naming' the filter fields, you can't do that. You are given two custom fields you can use. I didn't actually name those, I selected them from the pulldown. Thanks for reading!

June 5, 2007 3:10 PM

Will said:

Great post Shawn - this is gold.

I have a question related to this subject. What I really want to do is to take this info (source and keyword) and pass it into a contact form so that we can implement closed-loop tracking of enquiries.

Do you have any ideas on how that might be done?

Bests,
Will

June 14, 2007 4:05 AM

Shawn Purtell said:

@Will:

It can be done. There are actually two methods I know of to do this. Unfortunately, this kind of thing is too advanced for a blog comment, but feel free to contact us if you want help setting this up.

June 14, 2007 9:07 AM

Al said:

Can this be done for organic traffic ? i.e. finding the keywords that deliver conversions from non-paid natural / SEO sources ? Cheers - Al

July 30, 2007 11:31 AM

Shawn Purtell said:

@Al:

These filters will include organic keywords as well. You can check out the screenshot above for some examples of this.

Thanks for reading!

July 30, 2007 11:50 AM

Brian Hinkle said:

Shawn-

Excellent work. I've just started using GA and was annoyed that there was no built-in functionality for that sort of origin tracking in ecommerce transactions - glad to see it can be added fairly easily!

July 30, 2007 2:38 PM

Shawn Purtell said:

@Brian:

That's the whole idea - making this awesome free tool (GA) more and more useful.

Thanks for the comment!

July 30, 2007 2:50 PM

Fonts said:

I use it and get some interesting (great) results. Some transactions are direct which I assume are bookmarked traffic

#312676 (direct) - (none) ()

and other transactions are like the one below do not have a value for the keyword I suppose since it is another site sending the traffic.

#312632 some-referring-site.com - referral ()

Everything else looks killer!

Thanks.

July 31, 2007 1:48 PM

Shawn Purtell said:

@Fonts:

Thanks for the feedback! Direct sources can mean a couple different things. Usually it means a user typed your URL into the browser directly, but there are some other things that will cause this, like email visits from a program like Outlook.

And you are correct with your second point - referring sites obviously will not have any keyword data, and so the parentheses will be blank.

Thanks again for the feedback!

August 2, 2007 3:58 PM

Nathan Scheffey said:

This is a great use of filters to achieve an extremely useful result. However, I think combining it with your excellent Exact Keyword Matching script really takes it to the next level.
I added another filter to append the User Defined Value (the exact keyword) after the Campaign Term. Now my transaction data shows the exact search string that led to the conversion. Very cool.
Question: is there a place to learn the syntax used in these custom filters (e.g. $A1 ($B1))? It seems pretty straightforward but I can't find any information about it in the GA Help documentation.
Anyway, thank you all for your excellent tools, they really take Google Analytics from good to great.

August 2, 2007 5:55 PM

Shawn Purtell said:

@Nathan:

I agree. If you have Michael's exact keyword tracking script installed, this is a great addition, and we actually do that ourselves.

To be honest, I don't have a specific resource for you concerning regular expression string matching variables, but there are lots of great books and websites on the subject.

August 3, 2007 8:53 AM

Neil said:

Hi Shawn.

I've tried doing this on 2 different analytics accounts, and can't get it to work.

I've copied everything word for word, but the keywords are never added. Could it be because the screenshots are of the previous version of analytics?

August 17, 2007 11:13 AM

Shawn Purtell said:

@Neil:

These filters have been tested and confirmed in the new version of Google Analytics.

I can't say for sure where your problem is occurring, but I can tell you that these filters work fine if used properly.

Is it possible you are having problems with your referring source tracking? Also, remember that keywords only show up for organic and cpc results - not for anything else (referrals, direct, banners, and other sources do not have keywords associated with them).

August 20, 2007 8:51 AM

Prince said:

Great stuff Shawn, very usefull.

Just having 1 problem, the first filter that grabs the source and medium, in the output filed you have $A1 - $B1

Thats exatly how I entered it but in my Transaction I am not getting the "source" I do get the keywords

So I get something like this:
Order27 $A (keyword)

August 21, 2007 12:01 AM

Neil said:

It works! Sort off...

Thanks for your help Shawn. I've just logged into Analytics, and it seems that the filters need to be in place for 24 hours to return anything.

Only wish I should filter on Adwords Campaigns instead of Campaigns (no option that I can see).

August 21, 2007 7:19 AM

Shawn Purtell said:

@Prince:

Looks like there's a problem with one of your filters - the third one I believe (specifically the $A1 part). Make sure there is no space between the $A and the 1. I can tell there is something wrong with your output field because '$A' is showing up in your data, and it should never do that.

August 21, 2007 9:15 AM

Shawn Purtell said:

@Neil:

Glad you got things working. And yeah, Google Analytics data generally takes 24 hours to update completely, so anytime you make a change, you need to give it time.

As to your other wish, I'm not really sure what you're asking. There are filters that can do all kinds of things. If you can be more specific, I may be able to help.

August 21, 2007 9:17 AM

Neil Munn said:

I'm accessing Analytics through my Adwords account. This means all my campaigns are listed under Adword campaigns, which isn't shown in the filters dropdown.

What I'm trying to do is, display the keyword(s) that the user types in to make their transaction eg:

Transaction ID, Source, Medium, (Keyword)

Is this possible?

August 22, 2007 5:59 AM

Shawn Purtell said:

@Neil:

The filter set I provided does this automatically, if the keyword exists. You can see in the image above that the keyword should be present for all organic and cpc (including AdWords) sources.

You should not need any additional filters to achieve this result. If you aren't seeing this data, you may not have the filters set up properly.

*Note - There is a difference between 'what the user types in' and the keyword you are bidding on.

The 'term the user typed in' is called the search term while the keyword you bid on is called the bid term. The bid term is the information you will see.

To find out how to get search term info as well, visit Michael's awesome solution here.

August 22, 2007 9:33 AM

Netmeg said:

Hello - I've been using this filter pretty much since you posted it, and it worked just fine. But I created a new profile for it, and it hasn't worked since. Could it be the new Google Analytics code? I then tried to put it back on the original profile on which I had it, and it *still* doesn't work. I haven't changed any of the code, I have the three filters in the proper order - the only thing that has changed was the Google analytics code. And actually, I'm testing that on still another profile, so I'm not entirely sure what's going on now.

January 22, 2008 11:08 AM

Netmeg said:

As an update to my previous post, I went and checked, and between and my partners, five ecommerce sites that were using this filter ALL stopped displaying the data on January 15th. How weird is that? Google must have changed something.

January 22, 2008 1:34 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

There have actually been reports of all advanced filters breaking around that same date, but many people have also stated that their filters have begun to work again. I'd check the more recent data again. In the meantime, we're conducting our own investigation concerning why advanced filters have had this little hiccup, and we'll let you know if we find anything important.

January 23, 2008 8:59 AM

Netmeg said:

As of today, 1/23/2008, none of our advanced filters are working.

Thanks in advance for anything you find out.

January 23, 2008 10:51 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

After examining some other data and situations with both custom and advanced filters, it seems this is an issue many people are experiencing. From the Google Analytics help group to our own data, we have noticed two things:

Many custom filters seemed to stop functioning for several accounts for a brief period around Jan8th, but resumed working on the 15th. This includes custom includes and other custom filters.

Advanced filters that use custom fields, however, seems to be having more trouble, and in many cases have not worked since the 15th on January. Among these kinds of filters is the filter described in this article.

As soon as we get a good explanation as to what's been causing these errors, I'll be sure to post an update here.

January 29, 2008 10:42 AM

Steve Racicot said:

Is anyone using this advanced filters getting data? Is it working correctly?

I have had this installed for over a week and have seen no changes to my transaction list under Eccommerce -> Transactions.

Steve

February 18, 2008 11:14 AM

Jeremy Aube said:

@Steve

Any advanced filters that use custom fields have not been working since January 15th, including this one. This should be a temporary issues, but in the meantime, we have posted an article on an alternate set of filters you can use that function exactly the same as this set. You can get your filters there, and then refer to Shawn's article here for addition instruction and information.

February 18, 2008 3:55 PM

Imran Khan said:

Really informative post.
One question: Where can I find the Transaction List, the last image. I am using the old version of analytics code.

Thanks in advance

February 20, 2008 6:39 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Imran:

The Transaction list is under the Ecommerce section in Google Analytics, and will only show up if you have turned on Ecommerce in your profile settings. The exact report you're looking for is called Transactions.

As a note here, I realize these filters have not been working correctly since Jan. 15th. The filters are still correct, but there was a bug with custom fields (which these filters use) that is being resolved. Until then, feel free to look at Jeremy's update, which gets around this temporary issue.

February 20, 2008 8:57 AM

Asher said:

Have these filters every returned to working properly? I added them before reading to the bottom of the comments. I'm finding that when I view transactions I get the transaction number followed by the state.

June 9, 2008 10:49 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Asher:

These filters have been working correctly for a while now. These three filters do not affect the state of a user, so I wonder why you are seeing that information within Google Analytics. My hunch is that either there is a problem with the way you've set up the filters in your profile, or you have another filter that's using the Custom Field that's interfering with the transaction filters. Unfortunately, it's hard to tell you exactly what the problem is without seeing your filter setup.

June 9, 2008 1:15 PM

Duff said:

First of all, great post, Shawn.

I'm having a problem though.
I paid for a banner on another website. The link to my website is tagged properly:
http://www.mywebsite.com?utm_source=Other%2BWebsite&utm_medium=Banner&utm_campaign=Other%2BWebsite

I am getting some transactions through this banner but in my transaction list all I can see is:
mytransID mywebsite.com-referral (mywebsite.com)

However, of course I would like to be able to see:
mytransID Other Website-Banner ()

Do you have any idea about what did I do wrong?

July 23, 2008 5:57 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff:

It looks like you're getting what we call 'self-referrals' - meaning Google Analytics is registering visits from your own site. This actually has nothing to do with the filters, as those look like they are working.

Self-referrals can occur for many different reasons, but the three most common are:

1. Some pages on your site are missing Google Analytics code.
2. You use multiple subdomains and haven't set up the Google Analytics code for subdomains.
3. Your site has multiple main domains.

If any of these apply to you, then you've most likely found the reason for your self-referrals. If none of these apply to you, there may be another problem with your Google Analytics installation, and I'd have to actually see it in order to diagnose the problem.

July 23, 2008 8:41 AM

Duff said:

Just wanted to thank you coz it is now working properly. Indeed, I use 2 domains, one for the website and another one for payments. Again, thanks a lot!

July 24, 2008 11:28 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff: Glad I could help. Thanks for reading!

July 25, 2008 8:08 AM

Tim said:

Hi Sean - I have an old website that we are redirecting all traffic to our new site. I would like to know which specific transactions are coming from the old site. We are using 301 redirects on individual pages. I tried your examples and it is not picking up the old website as the source or medium... Do you have any advice? Thanks

August 26, 2008 3:09 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Tim: I'm pretty sure Jeremy already answered this on a different blog article, but I agree with him that the only real way to do this effectively with Google Analytics is to add a query parameter to the end of the 301 redirect and then use the Site Search report within Google Analytics to see which transactions are coming from customers who were trying to find the old site.

August 28, 2008 7:44 AM

juan cruz aliaga said:

Hi Shawn, great post!
I am arriving late to this one, but I can see how useful could it be to avoid double counting on orders/transactions.
I was just wondering if the associated keywords would be the last ones used on any campaing source and medium. If so, and to keep track of visitors previous visits to purchase, couldn't we also grab the visitor ID (with a new filter) and appends it to the rest of the info??

Rgds,

jc

February 17, 2009 4:25 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Juan:

Just like with normal Google Analytics tracking, the keyword/source/medium reported with the transaction will be the most recent. Also, in regards to your question about visitor ID - that depends on where the ID is stored. There is no built-in visitor ID filter field in Google Analytics for this, but you could send the data from your database to Google Analytics with each transaction using the ecommerce code. If you do this, you'll probably want to read over the Google Analytics Terms of Service just to make sure the information you're passing isn't considered personally identifiable.

February 17, 2009 8:19 AM

liz rz said:

Hi, this is a great filter, but was wondering how i could modify it to show me the transaction date which is a sortable list so i can see which are the most recent orders...with the existing filter i can only sort by revenue, tax, shipping, quantity. I know i can choose date range for the same info, but a sort would be easier. Thanks, this very useful info.

February 19, 2009 10:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

Probably the easiest way to do this is to use Andre Scholten's Table Sorter add-on for Google Analytics (the site is in Dutch). This is also included in the Better Google Analytics Firefox addon from VKI Studios.

February 19, 2009 10:42 AM

liz rz said:

I've added the filters above and now I'd like to export the data to be able to sort the data into a spreadsheet. There is no seperator between the data fields so I can't seperate the referring source and the keyword. Any ideas?

April 20, 2009 10:32 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

It's a little advanced, but you could run a macro on the spreadsheet that splits up the data for you. That's really the only way that I can see doing this quickly. Moving forward, you could modify the filters so that they contain a separator.

April 20, 2009 11:24 AM

liz rz said:

Thanks Shawn! Can you tell me how to add the data separator to the filters, or point toward a resource where I can learn? This is very helpful! Thanks.

April 24, 2009 8:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

In the filters above, you can modify the Output field at the very bottom of each filter to add your own separators. In my example, I use a dash in filter one, parentheses in filter two, and just a space in filter three. You could easily modify these fields to use a different separator (like a comma) that's easier for you.

April 24, 2009 8:46 AM

mp said:

Thank you for great post. We are using Google Analytic about one year. This solution going to change new transactions. Is there is any way to run it on existing data? I'm just wonder is it possible to achieve the same results with advanced reports?
Thank you for your time.

August 6, 2009 1:06 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You could also use the Secondary Segment dropdown in the Transactions report to some extent. With Jeremy's Google Analytics Report Enhancer, you can segment by source/medium. You could use Advanced Segments to look at a specific medium (cpc for example), and then use the Secondary Segment to look at keyword.

I don't think there's a simple way to do all of this in one step, but the information is there, you just may have to dig for it a little.

August 6, 2009 8:12 AM

mp said:

Hello,

I'm trying to add product name to report and result will be like:
tranID | source | medium | keyword | item_name1 item_name2
I'm using the same filters as use I just added new filter that concatenate item name custom_field.
Trans List Mod 1 \x96 same Trans List Mod 1 - separator |
Trans List Mod 2 - same Trans List Mod 2 \x96 separator |
Trans List Mod 3 - add item name to custom field
Field A -> Extract A Custom Field 1 (.*)
Field B -> Extract B E-commerce Item Name (.*)
Output To -> Constructor Custom Field 1 $A1 | $B1
Field A Required Yes
Field B Required Yes/No tried both
Override Output Field Yes
Case Sensitive No
Trans List Mod 4 - same as Trans List Mod 3. \x96 separator |
As a result I'm getting douplicate rows one with item name and another without. Could you please point me the right direction?
Thank you for your time.

August 28, 2009 7:04 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You're going to run into several issues when using any filter that looks at both transactions and products at the same time. The primary issue here is that a single transaction can be associated with more than one product, which means that Google Analytics stores these pieces of data separately within the original database (and maybe even within different databases).

The easiest way to get the product information for a specific transaction is to just click on the ID. You'll then see a list of products in the transaction.

You may also have some success with an opposite approach, although I haven't tried this yet - try adding the transaction ID and source, etc. to the product name (sort of the reverse of what you're doing). As a caution, I would try this in a separate test profile, but it should give you the same kind of report that you were looking for. Hope that helps!

September 1, 2009 10:10 AM

Anagha said:

How can I append the exact search term also to the end of this PPC keyword so I can see which keyword triggered the transaction. What filter should I use

December 14, 2009 2:00 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

Google Analytics does not currently capture the exact search term, so you would have to use a workaround like the one mentioned in this article. Then you would have to modify the filter to include the User Defined variable or whichever field you are using to store the exact search query.

December 14, 2009 9:21 AM

Anagha said:

Thank You for your prompt reply. I wanted to do this using filters and not scripts since I dont have access to the Clients page. So I tried using the filters shown on this page in addition to the filters from http://www.semvironment.com/ppc-management-adwords-keyword-data-exposed-with-google-analytics/.
I applied exact query filters first (referral etc) stored in custom field 2, then applied the filters on this page and appended the custom field 2 to it. But it didnt show the exact keywords for transactions. Am I doing something wrong. Can this be done. Please help

December 14, 2009 8:22 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

I've found those keyword filters from semvironment to not work properly - and also to break conversion and transaction tracking data within the reports. It's actually what prompted us to create the custom script in the first place.

Currently, the only method I've seen to do what you need is to use the custom scripts. This will only change if Google makes the Exact Search Query available within the Google Analytics fields.

December 15, 2009 9:03 AM

Jordan Glogau said:

Shawn:

Its been some time since your described your three filter technique. Do you still think this is the best path to match specific transactions to particular channels?

Do you know anyone that's tried to reconciled this methods with their accounting data. This is something that you can do with Coremetrics?

BTW, I saw you method in Biran Clifton's book and the most important piece of advice he left out, set up a different profile since this stuff can break your data.

Thank you for this helpful post.

August 27, 2011 4:08 PM

Chris said:

Hi Shawn,

We've also done some work with this and also had a lot of head scratching to get the results - great post though and cleared up a couple of areas. Regards

Chris

May 3, 2007 4:56 AM

Shawn Purtell said:

@Chris:

Thanks for the nice comment. Let me know if these new filters work out for you. I've only been using them for a little while, so it would be great to get some feedback.

May 3, 2007 8:42 AM

Mikey said:

Hi Shawn,

Great post mate. Like Chris, I've been scratching my head over this & have a couple of clients that will absolutely love this. Thanks :)

Mikey

May 3, 2007 8:22 PM

Shawn Purtell said:

@Mikey:

Thanks! I hope it turns out to be as useful as I think it might. I'd love to hear feedback from you once you've used the filters with clients.

May 4, 2007 9:05 AM

Krista said:

Great Post. These advanced filters are very usefull. I took your training course on Google Analytics. I was wondering if in the future you are going to offer a whole course on advanced implementation and setup where filters like these are taught and where regular expressions could be learned?

May 17, 2007 10:31 AM

Shawn Purtell said:

@Krista:

Thanks for the compliment. The training course that you took includes the most common advanced implementation options that we've encountered (things like Paypal, cross-domain tracking, etc.). We've also included the general ideas about the types of filters you can create. We're currently revamping the course for our new training series, and it will include more about filters and how you can use them to accomplish specific tasks.

In order to get more specific than that, you really need one-on-one attention, because setting up advanced filters really depends on your site and what kinds of information you want to find. This is one example of something our support plans can do for you on an individual level. We try our best to make this information freely available through our blog.

The same sort of thing applies to regular expressions. Regular expressions can get extremely complex, so we covered the most basic/common ones that you can use in our training course. Again, the more advanced regular expressions are only needed in very specific situations that would require one on one attention.

This brings up another point: Google Analytics is like getting a suit (or dress) fitted - you need to take measurements and personal tastes into consideration when you are setting up analytics. There are some steps that are universally important, but when you start looking at your individual site, no two Google Analytics configurations will be exactly alike.

I hope you found this useful. Thanks again for posting and for taking our course!

May 17, 2007 11:13 AM

Shareen Jordan said:

Hi, Shawn.

I really enjoy reading your blog. Thanks for the information. I was wondering, in the first filter you name the constructor field 'custom field 1' and you call it the same thing in the next filter. But (I think)the second filter refers to the custom filed in the first filter. If they are both named the same thing, does the field from the 1st filter overwrite the field from the second filter? And is there any reason why you wouldn't name them differently? Would there be any benefit in naming them customer field 1 and customer field 2?

Thanks! Shareen

June 5, 2007 3:04 PM

Shawn Purtell said:

@Shareen:

Thanks for the compliments. As far as your question, I only had to use a single custom field across all three filters.

So, filter 1 puts the source and medium into custom field 1.

The second filter reads the custom field from filter 1 and adds the term to what was already there.

The final filter adds the custom field we built in the previous two filters to the transaction id.

This is why the order of these filters is so important. They will not work out of sequence (they also should be next to each other on the filter list).

I didn't use two separate custom fields (although I could have) because I really only needed one.

As far as 'naming' the filter fields, you can't do that. You are given two custom fields you can use. I didn't actually name those, I selected them from the pulldown. Thanks for reading!

June 5, 2007 3:10 PM

Will said:

Great post Shawn - this is gold.

I have a question related to this subject. What I really want to do is to take this info (source and keyword) and pass it into a contact form so that we can implement closed-loop tracking of enquiries.

Do you have any ideas on how that might be done?

Bests,
Will

June 14, 2007 4:05 AM

Shawn Purtell said:

@Will:

It can be done. There are actually two methods I know of to do this. Unfortunately, this kind of thing is too advanced for a blog comment, but feel free to contact us if you want help setting this up.

June 14, 2007 9:07 AM

Al said:

Can this be done for organic traffic ? i.e. finding the keywords that deliver conversions from non-paid natural / SEO sources ? Cheers - Al

July 30, 2007 11:31 AM

Shawn Purtell said:

@Al:

These filters will include organic keywords as well. You can check out the screenshot above for some examples of this.

Thanks for reading!

July 30, 2007 11:50 AM

Brian Hinkle said:

Shawn-

Excellent work. I've just started using GA and was annoyed that there was no built-in functionality for that sort of origin tracking in ecommerce transactions - glad to see it can be added fairly easily!

July 30, 2007 2:38 PM

Shawn Purtell said:

@Brian:

That's the whole idea - making this awesome free tool (GA) more and more useful.

Thanks for the comment!

July 30, 2007 2:50 PM

Fonts said:

I use it and get some interesting (great) results. Some transactions are direct which I assume are bookmarked traffic

#312676 (direct) - (none) ()

and other transactions are like the one below do not have a value for the keyword I suppose since it is another site sending the traffic.

#312632 some-referring-site.com - referral ()

Everything else looks killer!

Thanks.

July 31, 2007 1:48 PM

Shawn Purtell said:

@Fonts:

Thanks for the feedback! Direct sources can mean a couple different things. Usually it means a user typed your URL into the browser directly, but there are some other things that will cause this, like email visits from a program like Outlook.

And you are correct with your second point - referring sites obviously will not have any keyword data, and so the parentheses will be blank.

Thanks again for the feedback!

August 2, 2007 3:58 PM

Nathan Scheffey said:

This is a great use of filters to achieve an extremely useful result. However, I think combining it with your excellent Exact Keyword Matching script really takes it to the next level.
I added another filter to append the User Defined Value (the exact keyword) after the Campaign Term. Now my transaction data shows the exact search string that led to the conversion. Very cool.
Question: is there a place to learn the syntax used in these custom filters (e.g. $A1 ($B1))? It seems pretty straightforward but I can't find any information about it in the GA Help documentation.
Anyway, thank you all for your excellent tools, they really take Google Analytics from good to great.

August 2, 2007 5:55 PM

Shawn Purtell said:

@Nathan:

I agree. If you have Michael's exact keyword tracking script installed, this is a great addition, and we actually do that ourselves.

To be honest, I don't have a specific resource for you concerning regular expression string matching variables, but there are lots of great books and websites on the subject.

August 3, 2007 8:53 AM

Neil said:

Hi Shawn.

I've tried doing this on 2 different analytics accounts, and can't get it to work.

I've copied everything word for word, but the keywords are never added. Could it be because the screenshots are of the previous version of analytics?

August 17, 2007 11:13 AM

Shawn Purtell said:

@Neil:

These filters have been tested and confirmed in the new version of Google Analytics.

I can't say for sure where your problem is occurring, but I can tell you that these filters work fine if used properly.

Is it possible you are having problems with your referring source tracking? Also, remember that keywords only show up for organic and cpc results - not for anything else (referrals, direct, banners, and other sources do not have keywords associated with them).

August 20, 2007 8:51 AM

Prince said:

Great stuff Shawn, very usefull.

Just having 1 problem, the first filter that grabs the source and medium, in the output filed you have $A1 - $B1

Thats exatly how I entered it but in my Transaction I am not getting the "source" I do get the keywords

So I get something like this:
Order27 $A (keyword)

August 21, 2007 12:01 AM

Neil said:

It works! Sort off...

Thanks for your help Shawn. I've just logged into Analytics, and it seems that the filters need to be in place for 24 hours to return anything.

Only wish I should filter on Adwords Campaigns instead of Campaigns (no option that I can see).

August 21, 2007 7:19 AM

Shawn Purtell said:

@Prince:

Looks like there's a problem with one of your filters - the third one I believe (specifically the $A1 part). Make sure there is no space between the $A and the 1. I can tell there is something wrong with your output field because '$A' is showing up in your data, and it should never do that.

August 21, 2007 9:15 AM

Shawn Purtell said:

@Neil:

Glad you got things working. And yeah, Google Analytics data generally takes 24 hours to update completely, so anytime you make a change, you need to give it time.

As to your other wish, I'm not really sure what you're asking. There are filters that can do all kinds of things. If you can be more specific, I may be able to help.

August 21, 2007 9:17 AM

Neil Munn said:

I'm accessing Analytics through my Adwords account. This means all my campaigns are listed under Adword campaigns, which isn't shown in the filters dropdown.

What I'm trying to do is, display the keyword(s) that the user types in to make their transaction eg:

Transaction ID, Source, Medium, (Keyword)

Is this possible?

August 22, 2007 5:59 AM

Shawn Purtell said:

@Neil:

The filter set I provided does this automatically, if the keyword exists. You can see in the image above that the keyword should be present for all organic and cpc (including AdWords) sources.

You should not need any additional filters to achieve this result. If you aren't seeing this data, you may not have the filters set up properly.

*Note - There is a difference between 'what the user types in' and the keyword you are bidding on.

The 'term the user typed in' is called the search term while the keyword you bid on is called the bid term. The bid term is the information you will see.

To find out how to get search term info as well, visit Michael's awesome solution here.

August 22, 2007 9:33 AM

Netmeg said:

Hello - I've been using this filter pretty much since you posted it, and it worked just fine. But I created a new profile for it, and it hasn't worked since. Could it be the new Google Analytics code? I then tried to put it back on the original profile on which I had it, and it *still* doesn't work. I haven't changed any of the code, I have the three filters in the proper order - the only thing that has changed was the Google analytics code. And actually, I'm testing that on still another profile, so I'm not entirely sure what's going on now.

January 22, 2008 11:08 AM

Netmeg said:

As an update to my previous post, I went and checked, and between and my partners, five ecommerce sites that were using this filter ALL stopped displaying the data on January 15th. How weird is that? Google must have changed something.

January 22, 2008 1:34 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

There have actually been reports of all advanced filters breaking around that same date, but many people have also stated that their filters have begun to work again. I'd check the more recent data again. In the meantime, we're conducting our own investigation concerning why advanced filters have had this little hiccup, and we'll let you know if we find anything important.

January 23, 2008 8:59 AM

Netmeg said:

As of today, 1/23/2008, none of our advanced filters are working.

Thanks in advance for anything you find out.

January 23, 2008 10:51 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

After examining some other data and situations with both custom and advanced filters, it seems this is an issue many people are experiencing. From the Google Analytics help group to our own data, we have noticed two things:

Many custom filters seemed to stop functioning for several accounts for a brief period around Jan8th, but resumed working on the 15th. This includes custom includes and other custom filters.

Advanced filters that use custom fields, however, seems to be having more trouble, and in many cases have not worked since the 15th on January. Among these kinds of filters is the filter described in this article.

As soon as we get a good explanation as to what's been causing these errors, I'll be sure to post an update here.

January 29, 2008 10:42 AM

Steve Racicot said:

Is anyone using this advanced filters getting data? Is it working correctly?

I have had this installed for over a week and have seen no changes to my transaction list under Eccommerce -> Transactions.

Steve

February 18, 2008 11:14 AM

Jeremy Aube said:

@Steve

Any advanced filters that use custom fields have not been working since January 15th, including this one. This should be a temporary issues, but in the meantime, we have posted an article on an alternate set of filters you can use that function exactly the same as this set. You can get your filters there, and then refer to Shawn's article here for addition instruction and information.

February 18, 2008 3:55 PM

Imran Khan said:

Really informative post.
One question: Where can I find the Transaction List, the last image. I am using the old version of analytics code.

Thanks in advance

February 20, 2008 6:39 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Imran:

The Transaction list is under the Ecommerce section in Google Analytics, and will only show up if you have turned on Ecommerce in your profile settings. The exact report you're looking for is called Transactions.

As a note here, I realize these filters have not been working correctly since Jan. 15th. The filters are still correct, but there was a bug with custom fields (which these filters use) that is being resolved. Until then, feel free to look at Jeremy's update, which gets around this temporary issue.

February 20, 2008 8:57 AM

Asher said:

Have these filters every returned to working properly? I added them before reading to the bottom of the comments. I'm finding that when I view transactions I get the transaction number followed by the state.

June 9, 2008 10:49 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Asher:

These filters have been working correctly for a while now. These three filters do not affect the state of a user, so I wonder why you are seeing that information within Google Analytics. My hunch is that either there is a problem with the way you've set up the filters in your profile, or you have another filter that's using the Custom Field that's interfering with the transaction filters. Unfortunately, it's hard to tell you exactly what the problem is without seeing your filter setup.

June 9, 2008 1:15 PM

Duff said:

First of all, great post, Shawn.

I'm having a problem though.
I paid for a banner on another website. The link to my website is tagged properly:
http://www.mywebsite.com?utm_source=Other%2BWebsite&utm_medium=Banner&utm_campaign=Other%2BWebsite

I am getting some transactions through this banner but in my transaction list all I can see is:
mytransID mywebsite.com-referral (mywebsite.com)

However, of course I would like to be able to see:
mytransID Other Website-Banner ()

Do you have any idea about what did I do wrong?

July 23, 2008 5:57 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff:

It looks like you're getting what we call 'self-referrals' - meaning Google Analytics is registering visits from your own site. This actually has nothing to do with the filters, as those look like they are working.

Self-referrals can occur for many different reasons, but the three most common are:

1. Some pages on your site are missing Google Analytics code.
2. You use multiple subdomains and haven't set up the Google Analytics code for subdomains.
3. Your site has multiple main domains.

If any of these apply to you, then you've most likely found the reason for your self-referrals. If none of these apply to you, there may be another problem with your Google Analytics installation, and I'd have to actually see it in order to diagnose the problem.

July 23, 2008 8:41 AM

Duff said:

Just wanted to thank you coz it is now working properly. Indeed, I use 2 domains, one for the website and another one for payments. Again, thanks a lot!

July 24, 2008 11:28 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff: Glad I could help. Thanks for reading!

July 25, 2008 8:08 AM

Tim said:

Hi Sean - I have an old website that we are redirecting all traffic to our new site. I would like to know which specific transactions are coming from the old site. We are using 301 redirects on individual pages. I tried your examples and it is not picking up the old website as the source or medium... Do you have any advice? Thanks

August 26, 2008 3:09 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Tim: I'm pretty sure Jeremy already answered this on a different blog article, but I agree with him that the only real way to do this effectively with Google Analytics is to add a query parameter to the end of the 301 redirect and then use the Site Search report within Google Analytics to see which transactions are coming from customers who were trying to find the old site.

August 28, 2008 7:44 AM

juan cruz aliaga said:

Hi Shawn, great post!
I am arriving late to this one, but I can see how useful could it be to avoid double counting on orders/transactions.
I was just wondering if the associated keywords would be the last ones used on any campaing source and medium. If so, and to keep track of visitors previous visits to purchase, couldn't we also grab the visitor ID (with a new filter) and appends it to the rest of the info??

Rgds,

jc

February 17, 2009 4:25 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Juan:

Just like with normal Google Analytics tracking, the keyword/source/medium reported with the transaction will be the most recent. Also, in regards to your question about visitor ID - that depends on where the ID is stored. There is no built-in visitor ID filter field in Google Analytics for this, but you could send the data from your database to Google Analytics with each transaction using the ecommerce code. If you do this, you'll probably want to read over the Google Analytics Terms of Service just to make sure the information you're passing isn't considered personally identifiable.

February 17, 2009 8:19 AM

liz rz said:

Hi, this is a great filter, but was wondering how i could modify it to show me the transaction date which is a sortable list so i can see which are the most recent orders...with the existing filter i can only sort by revenue, tax, shipping, quantity. I know i can choose date range for the same info, but a sort would be easier. Thanks, this very useful info.

February 19, 2009 10:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

Probably the easiest way to do this is to use Andre Scholten's Table Sorter add-on for Google Analytics (the site is in Dutch). This is also included in the Better Google Analytics Firefox addon from VKI Studios.

February 19, 2009 10:42 AM

liz rz said:

I've added the filters above and now I'd like to export the data to be able to sort the data into a spreadsheet. There is no seperator between the data fields so I can't seperate the referring source and the keyword. Any ideas?

April 20, 2009 10:32 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

It's a little advanced, but you could run a macro on the spreadsheet that splits up the data for you. That's really the only way that I can see doing this quickly. Moving forward, you could modify the filters so that they contain a separator.

April 20, 2009 11:24 AM

liz rz said:

Thanks Shawn! Can you tell me how to add the data separator to the filters, or point toward a resource where I can learn? This is very helpful! Thanks.

April 24, 2009 8:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

In the filters above, you can modify the Output field at the very bottom of each filter to add your own separators. In my example, I use a dash in filter one, parentheses in filter two, and just a space in filter three. You could easily modify these fields to use a different separator (like a comma) that's easier for you.

April 24, 2009 8:46 AM

mp said:

Thank you for great post. We are using Google Analytic about one year. This solution going to change new transactions. Is there is any way to run it on existing data? I'm just wonder is it possible to achieve the same results with advanced reports?
Thank you for your time.

August 6, 2009 1:06 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You could also use the Secondary Segment dropdown in the Transactions report to some extent. With Jeremy's Google Analytics Report Enhancer, you can segment by source/medium. You could use Advanced Segments to look at a specific medium (cpc for example), and then use the Secondary Segment to look at keyword.

I don't think there's a simple way to do all of this in one step, but the information is there, you just may have to dig for it a little.

August 6, 2009 8:12 AM

mp said:

Hello,

I'm trying to add product name to report and result will be like:
tranID | source | medium | keyword | item_name1 item_name2
I'm using the same filters as use I just added new filter that concatenate item name custom_field.
Trans List Mod 1 \x96 same Trans List Mod 1 - separator |
Trans List Mod 2 - same Trans List Mod 2 \x96 separator |
Trans List Mod 3 - add item name to custom field
Field A -> Extract A Custom Field 1 (.*)
Field B -> Extract B E-commerce Item Name (.*)
Output To -> Constructor Custom Field 1 $A1 | $B1
Field A Required Yes
Field B Required Yes/No tried both
Override Output Field Yes
Case Sensitive No
Trans List Mod 4 - same as Trans List Mod 3. \x96 separator |
As a result I'm getting douplicate rows one with item name and another without. Could you please point me the right direction?
Thank you for your time.

August 28, 2009 7:04 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You're going to run into several issues when using any filter that looks at both transactions and products at the same time. The primary issue here is that a single transaction can be associated with more than one product, which means that Google Analytics stores these pieces of data separately within the original database (and maybe even within different databases).

The easiest way to get the product information for a specific transaction is to just click on the ID. You'll then see a list of products in the transaction.

You may also have some success with an opposite approach, although I haven't tried this yet - try adding the transaction ID and source, etc. to the product name (sort of the reverse of what you're doing). As a caution, I would try this in a separate test profile, but it should give you the same kind of report that you were looking for. Hope that helps!

September 1, 2009 10:10 AM

Anagha said:

How can I append the exact search term also to the end of this PPC keyword so I can see which keyword triggered the transaction. What filter should I use

December 14, 2009 2:00 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

Google Analytics does not currently capture the exact search term, so you would have to use a workaround like the one mentioned in this article. Then you would have to modify the filter to include the User Defined variable or whichever field you are using to store the exact search query.

December 14, 2009 9:21 AM

Anagha said:

Thank You for your prompt reply. I wanted to do this using filters and not scripts since I dont have access to the Clients page. So I tried using the filters shown on this page in addition to the filters from http://www.semvironment.com/ppc-management-adwords-keyword-data-exposed-with-google-analytics/.
I applied exact query filters first (referral etc) stored in custom field 2, then applied the filters on this page and appended the custom field 2 to it. But it didnt show the exact keywords for transactions. Am I doing something wrong. Can this be done. Please help

December 14, 2009 8:22 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

I've found those keyword filters from semvironment to not work properly - and also to break conversion and transaction tracking data within the reports. It's actually what prompted us to create the custom script in the first place.

Currently, the only method I've seen to do what you need is to use the custom scripts. This will only change if Google makes the Exact Search Query available within the Google Analytics fields.

December 15, 2009 9:03 AM

Jordan Glogau said:

Shawn:

Its been some time since your described your three filter technique. Do you still think this is the best path to match specific transactions to particular channels?

Do you know anyone that's tried to reconciled this methods with their accounting data. This is something that you can do with Coremetrics?

BTW, I saw you method in Biran Clifton's book and the most important piece of advice he left out, set up a different profile since this stuff can break your data.

Thank you for this helpful post.

August 27, 2011 4:08 PM

Chris said:

Hi Shawn,

We've also done some work with this and also had a lot of head scratching to get the results - great post though and cleared up a couple of areas. Regards

Chris

May 3, 2007 4:56 AM

Shawn Purtell said:

@Chris:

Thanks for the nice comment. Let me know if these new filters work out for you. I've only been using them for a little while, so it would be great to get some feedback.

May 3, 2007 8:42 AM

Mikey said:

Hi Shawn,

Great post mate. Like Chris, I've been scratching my head over this & have a couple of clients that will absolutely love this. Thanks :)

Mikey

May 3, 2007 8:22 PM

Shawn Purtell said:

@Mikey:

Thanks! I hope it turns out to be as useful as I think it might. I'd love to hear feedback from you once you've used the filters with clients.

May 4, 2007 9:05 AM

Krista said:

Great Post. These advanced filters are very usefull. I took your training course on Google Analytics. I was wondering if in the future you are going to offer a whole course on advanced implementation and setup where filters like these are taught and where regular expressions could be learned?

May 17, 2007 10:31 AM

Shawn Purtell said:

@Krista:

Thanks for the compliment. The training course that you took includes the most common advanced implementation options that we've encountered (things like Paypal, cross-domain tracking, etc.). We've also included the general ideas about the types of filters you can create. We're currently revamping the course for our new training series, and it will include more about filters and how you can use them to accomplish specific tasks.

In order to get more specific than that, you really need one-on-one attention, because setting up advanced filters really depends on your site and what kinds of information you want to find. This is one example of something our support plans can do for you on an individual level. We try our best to make this information freely available through our blog.

The same sort of thing applies to regular expressions. Regular expressions can get extremely complex, so we covered the most basic/common ones that you can use in our training course. Again, the more advanced regular expressions are only needed in very specific situations that would require one on one attention.

This brings up another point: Google Analytics is like getting a suit (or dress) fitted - you need to take measurements and personal tastes into consideration when you are setting up analytics. There are some steps that are universally important, but when you start looking at your individual site, no two Google Analytics configurations will be exactly alike.

I hope you found this useful. Thanks again for posting and for taking our course!

May 17, 2007 11:13 AM

Shareen Jordan said:

Hi, Shawn.

I really enjoy reading your blog. Thanks for the information. I was wondering, in the first filter you name the constructor field 'custom field 1' and you call it the same thing in the next filter. But (I think)the second filter refers to the custom filed in the first filter. If they are both named the same thing, does the field from the 1st filter overwrite the field from the second filter? And is there any reason why you wouldn't name them differently? Would there be any benefit in naming them customer field 1 and customer field 2?

Thanks! Shareen

June 5, 2007 3:04 PM

Shawn Purtell said:

@Shareen:

Thanks for the compliments. As far as your question, I only had to use a single custom field across all three filters.

So, filter 1 puts the source and medium into custom field 1.

The second filter reads the custom field from filter 1 and adds the term to what was already there.

The final filter adds the custom field we built in the previous two filters to the transaction id.

This is why the order of these filters is so important. They will not work out of sequence (they also should be next to each other on the filter list).

I didn't use two separate custom fields (although I could have) because I really only needed one.

As far as 'naming' the filter fields, you can't do that. You are given two custom fields you can use. I didn't actually name those, I selected them from the pulldown. Thanks for reading!

June 5, 2007 3:10 PM

Will said:

Great post Shawn - this is gold.

I have a question related to this subject. What I really want to do is to take this info (source and keyword) and pass it into a contact form so that we can implement closed-loop tracking of enquiries.

Do you have any ideas on how that might be done?

Bests,
Will

June 14, 2007 4:05 AM

Shawn Purtell said:

@Will:

It can be done. There are actually two methods I know of to do this. Unfortunately, this kind of thing is too advanced for a blog comment, but feel free to contact us if you want help setting this up.

June 14, 2007 9:07 AM

Al said:

Can this be done for organic traffic ? i.e. finding the keywords that deliver conversions from non-paid natural / SEO sources ? Cheers - Al

July 30, 2007 11:31 AM

Shawn Purtell said:

@Al:

These filters will include organic keywords as well. You can check out the screenshot above for some examples of this.

Thanks for reading!

July 30, 2007 11:50 AM

Brian Hinkle said:

Shawn-

Excellent work. I've just started using GA and was annoyed that there was no built-in functionality for that sort of origin tracking in ecommerce transactions - glad to see it can be added fairly easily!

July 30, 2007 2:38 PM

Shawn Purtell said:

@Brian:

That's the whole idea - making this awesome free tool (GA) more and more useful.

Thanks for the comment!

July 30, 2007 2:50 PM

Fonts said:

I use it and get some interesting (great) results. Some transactions are direct which I assume are bookmarked traffic

#312676 (direct) - (none) ()

and other transactions are like the one below do not have a value for the keyword I suppose since it is another site sending the traffic.

#312632 some-referring-site.com - referral ()

Everything else looks killer!

Thanks.

July 31, 2007 1:48 PM

Shawn Purtell said:

@Fonts:

Thanks for the feedback! Direct sources can mean a couple different things. Usually it means a user typed your URL into the browser directly, but there are some other things that will cause this, like email visits from a program like Outlook.

And you are correct with your second point - referring sites obviously will not have any keyword data, and so the parentheses will be blank.

Thanks again for the feedback!

August 2, 2007 3:58 PM

Nathan Scheffey said:

This is a great use of filters to achieve an extremely useful result. However, I think combining it with your excellent Exact Keyword Matching script really takes it to the next level.
I added another filter to append the User Defined Value (the exact keyword) after the Campaign Term. Now my transaction data shows the exact search string that led to the conversion. Very cool.
Question: is there a place to learn the syntax used in these custom filters (e.g. $A1 ($B1))? It seems pretty straightforward but I can't find any information about it in the GA Help documentation.
Anyway, thank you all for your excellent tools, they really take Google Analytics from good to great.

August 2, 2007 5:55 PM

Shawn Purtell said:

@Nathan:

I agree. If you have Michael's exact keyword tracking script installed, this is a great addition, and we actually do that ourselves.

To be honest, I don't have a specific resource for you concerning regular expression string matching variables, but there are lots of great books and websites on the subject.

August 3, 2007 8:53 AM

Neil said:

Hi Shawn.

I've tried doing this on 2 different analytics accounts, and can't get it to work.

I've copied everything word for word, but the keywords are never added. Could it be because the screenshots are of the previous version of analytics?

August 17, 2007 11:13 AM

Shawn Purtell said:

@Neil:

These filters have been tested and confirmed in the new version of Google Analytics.

I can't say for sure where your problem is occurring, but I can tell you that these filters work fine if used properly.

Is it possible you are having problems with your referring source tracking? Also, remember that keywords only show up for organic and cpc results - not for anything else (referrals, direct, banners, and other sources do not have keywords associated with them).

August 20, 2007 8:51 AM

Prince said:

Great stuff Shawn, very usefull.

Just having 1 problem, the first filter that grabs the source and medium, in the output filed you have $A1 - $B1

Thats exatly how I entered it but in my Transaction I am not getting the "source" I do get the keywords

So I get something like this:
Order27 $A (keyword)

August 21, 2007 12:01 AM

Neil said:

It works! Sort off...

Thanks for your help Shawn. I've just logged into Analytics, and it seems that the filters need to be in place for 24 hours to return anything.

Only wish I should filter on Adwords Campaigns instead of Campaigns (no option that I can see).

August 21, 2007 7:19 AM

Shawn Purtell said:

@Prince:

Looks like there's a problem with one of your filters - the third one I believe (specifically the $A1 part). Make sure there is no space between the $A and the 1. I can tell there is something wrong with your output field because '$A' is showing up in your data, and it should never do that.

August 21, 2007 9:15 AM

Shawn Purtell said:

@Neil:

Glad you got things working. And yeah, Google Analytics data generally takes 24 hours to update completely, so anytime you make a change, you need to give it time.

As to your other wish, I'm not really sure what you're asking. There are filters that can do all kinds of things. If you can be more specific, I may be able to help.

August 21, 2007 9:17 AM

Neil Munn said:

I'm accessing Analytics through my Adwords account. This means all my campaigns are listed under Adword campaigns, which isn't shown in the filters dropdown.

What I'm trying to do is, display the keyword(s) that the user types in to make their transaction eg:

Transaction ID, Source, Medium, (Keyword)

Is this possible?

August 22, 2007 5:59 AM

Shawn Purtell said:

@Neil:

The filter set I provided does this automatically, if the keyword exists. You can see in the image above that the keyword should be present for all organic and cpc (including AdWords) sources.

You should not need any additional filters to achieve this result. If you aren't seeing this data, you may not have the filters set up properly.

*Note - There is a difference between 'what the user types in' and the keyword you are bidding on.

The 'term the user typed in' is called the search term while the keyword you bid on is called the bid term. The bid term is the information you will see.

To find out how to get search term info as well, visit Michael's awesome solution here.

August 22, 2007 9:33 AM

Netmeg said:

Hello - I've been using this filter pretty much since you posted it, and it worked just fine. But I created a new profile for it, and it hasn't worked since. Could it be the new Google Analytics code? I then tried to put it back on the original profile on which I had it, and it *still* doesn't work. I haven't changed any of the code, I have the three filters in the proper order - the only thing that has changed was the Google analytics code. And actually, I'm testing that on still another profile, so I'm not entirely sure what's going on now.

January 22, 2008 11:08 AM

Netmeg said:

As an update to my previous post, I went and checked, and between and my partners, five ecommerce sites that were using this filter ALL stopped displaying the data on January 15th. How weird is that? Google must have changed something.

January 22, 2008 1:34 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

There have actually been reports of all advanced filters breaking around that same date, but many people have also stated that their filters have begun to work again. I'd check the more recent data again. In the meantime, we're conducting our own investigation concerning why advanced filters have had this little hiccup, and we'll let you know if we find anything important.

January 23, 2008 8:59 AM

Netmeg said:

As of today, 1/23/2008, none of our advanced filters are working.

Thanks in advance for anything you find out.

January 23, 2008 10:51 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

After examining some other data and situations with both custom and advanced filters, it seems this is an issue many people are experiencing. From the Google Analytics help group to our own data, we have noticed two things:

Many custom filters seemed to stop functioning for several accounts for a brief period around Jan8th, but resumed working on the 15th. This includes custom includes and other custom filters.

Advanced filters that use custom fields, however, seems to be having more trouble, and in many cases have not worked since the 15th on January. Among these kinds of filters is the filter described in this article.

As soon as we get a good explanation as to what's been causing these errors, I'll be sure to post an update here.

January 29, 2008 10:42 AM

Steve Racicot said:

Is anyone using this advanced filters getting data? Is it working correctly?

I have had this installed for over a week and have seen no changes to my transaction list under Eccommerce -> Transactions.

Steve

February 18, 2008 11:14 AM

Jeremy Aube said:

@Steve

Any advanced filters that use custom fields have not been working since January 15th, including this one. This should be a temporary issues, but in the meantime, we have posted an article on an alternate set of filters you can use that function exactly the same as this set. You can get your filters there, and then refer to Shawn's article here for addition instruction and information.

February 18, 2008 3:55 PM

Imran Khan said:

Really informative post.
One question: Where can I find the Transaction List, the last image. I am using the old version of analytics code.

Thanks in advance

February 20, 2008 6:39 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Imran:

The Transaction list is under the Ecommerce section in Google Analytics, and will only show up if you have turned on Ecommerce in your profile settings. The exact report you're looking for is called Transactions.

As a note here, I realize these filters have not been working correctly since Jan. 15th. The filters are still correct, but there was a bug with custom fields (which these filters use) that is being resolved. Until then, feel free to look at Jeremy's update, which gets around this temporary issue.

February 20, 2008 8:57 AM

Asher said:

Have these filters every returned to working properly? I added them before reading to the bottom of the comments. I'm finding that when I view transactions I get the transaction number followed by the state.

June 9, 2008 10:49 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Asher:

These filters have been working correctly for a while now. These three filters do not affect the state of a user, so I wonder why you are seeing that information within Google Analytics. My hunch is that either there is a problem with the way you've set up the filters in your profile, or you have another filter that's using the Custom Field that's interfering with the transaction filters. Unfortunately, it's hard to tell you exactly what the problem is without seeing your filter setup.

June 9, 2008 1:15 PM

Duff said:

First of all, great post, Shawn.

I'm having a problem though.
I paid for a banner on another website. The link to my website is tagged properly:
http://www.mywebsite.com?utm_source=Other%2BWebsite&utm_medium=Banner&utm_campaign=Other%2BWebsite

I am getting some transactions through this banner but in my transaction list all I can see is:
mytransID mywebsite.com-referral (mywebsite.com)

However, of course I would like to be able to see:
mytransID Other Website-Banner ()

Do you have any idea about what did I do wrong?

July 23, 2008 5:57 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff:

It looks like you're getting what we call 'self-referrals' - meaning Google Analytics is registering visits from your own site. This actually has nothing to do with the filters, as those look like they are working.

Self-referrals can occur for many different reasons, but the three most common are:

1. Some pages on your site are missing Google Analytics code.
2. You use multiple subdomains and haven't set up the Google Analytics code for subdomains.
3. Your site has multiple main domains.

If any of these apply to you, then you've most likely found the reason for your self-referrals. If none of these apply to you, there may be another problem with your Google Analytics installation, and I'd have to actually see it in order to diagnose the problem.

July 23, 2008 8:41 AM

Duff said:

Just wanted to thank you coz it is now working properly. Indeed, I use 2 domains, one for the website and another one for payments. Again, thanks a lot!

July 24, 2008 11:28 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff: Glad I could help. Thanks for reading!

July 25, 2008 8:08 AM

Tim said:

Hi Sean - I have an old website that we are redirecting all traffic to our new site. I would like to know which specific transactions are coming from the old site. We are using 301 redirects on individual pages. I tried your examples and it is not picking up the old website as the source or medium... Do you have any advice? Thanks

August 26, 2008 3:09 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Tim: I'm pretty sure Jeremy already answered this on a different blog article, but I agree with him that the only real way to do this effectively with Google Analytics is to add a query parameter to the end of the 301 redirect and then use the Site Search report within Google Analytics to see which transactions are coming from customers who were trying to find the old site.

August 28, 2008 7:44 AM

juan cruz aliaga said:

Hi Shawn, great post!
I am arriving late to this one, but I can see how useful could it be to avoid double counting on orders/transactions.
I was just wondering if the associated keywords would be the last ones used on any campaing source and medium. If so, and to keep track of visitors previous visits to purchase, couldn't we also grab the visitor ID (with a new filter) and appends it to the rest of the info??

Rgds,

jc

February 17, 2009 4:25 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Juan:

Just like with normal Google Analytics tracking, the keyword/source/medium reported with the transaction will be the most recent. Also, in regards to your question about visitor ID - that depends on where the ID is stored. There is no built-in visitor ID filter field in Google Analytics for this, but you could send the data from your database to Google Analytics with each transaction using the ecommerce code. If you do this, you'll probably want to read over the Google Analytics Terms of Service just to make sure the information you're passing isn't considered personally identifiable.

February 17, 2009 8:19 AM

liz rz said:

Hi, this is a great filter, but was wondering how i could modify it to show me the transaction date which is a sortable list so i can see which are the most recent orders...with the existing filter i can only sort by revenue, tax, shipping, quantity. I know i can choose date range for the same info, but a sort would be easier. Thanks, this very useful info.

February 19, 2009 10:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

Probably the easiest way to do this is to use Andre Scholten's Table Sorter add-on for Google Analytics (the site is in Dutch). This is also included in the Better Google Analytics Firefox addon from VKI Studios.

February 19, 2009 10:42 AM

liz rz said:

I've added the filters above and now I'd like to export the data to be able to sort the data into a spreadsheet. There is no seperator between the data fields so I can't seperate the referring source and the keyword. Any ideas?

April 20, 2009 10:32 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

It's a little advanced, but you could run a macro on the spreadsheet that splits up the data for you. That's really the only way that I can see doing this quickly. Moving forward, you could modify the filters so that they contain a separator.

April 20, 2009 11:24 AM

liz rz said:

Thanks Shawn! Can you tell me how to add the data separator to the filters, or point toward a resource where I can learn? This is very helpful! Thanks.

April 24, 2009 8:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

In the filters above, you can modify the Output field at the very bottom of each filter to add your own separators. In my example, I use a dash in filter one, parentheses in filter two, and just a space in filter three. You could easily modify these fields to use a different separator (like a comma) that's easier for you.

April 24, 2009 8:46 AM

mp said:

Thank you for great post. We are using Google Analytic about one year. This solution going to change new transactions. Is there is any way to run it on existing data? I'm just wonder is it possible to achieve the same results with advanced reports?
Thank you for your time.

August 6, 2009 1:06 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You could also use the Secondary Segment dropdown in the Transactions report to some extent. With Jeremy's Google Analytics Report Enhancer, you can segment by source/medium. You could use Advanced Segments to look at a specific medium (cpc for example), and then use the Secondary Segment to look at keyword.

I don't think there's a simple way to do all of this in one step, but the information is there, you just may have to dig for it a little.

August 6, 2009 8:12 AM

mp said:

Hello,

I'm trying to add product name to report and result will be like:
tranID | source | medium | keyword | item_name1 item_name2
I'm using the same filters as use I just added new filter that concatenate item name custom_field.
Trans List Mod 1 \x96 same Trans List Mod 1 - separator |
Trans List Mod 2 - same Trans List Mod 2 \x96 separator |
Trans List Mod 3 - add item name to custom field
Field A -> Extract A Custom Field 1 (.*)
Field B -> Extract B E-commerce Item Name (.*)
Output To -> Constructor Custom Field 1 $A1 | $B1
Field A Required Yes
Field B Required Yes/No tried both
Override Output Field Yes
Case Sensitive No
Trans List Mod 4 - same as Trans List Mod 3. \x96 separator |
As a result I'm getting douplicate rows one with item name and another without. Could you please point me the right direction?
Thank you for your time.

August 28, 2009 7:04 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You're going to run into several issues when using any filter that looks at both transactions and products at the same time. The primary issue here is that a single transaction can be associated with more than one product, which means that Google Analytics stores these pieces of data separately within the original database (and maybe even within different databases).

The easiest way to get the product information for a specific transaction is to just click on the ID. You'll then see a list of products in the transaction.

You may also have some success with an opposite approach, although I haven't tried this yet - try adding the transaction ID and source, etc. to the product name (sort of the reverse of what you're doing). As a caution, I would try this in a separate test profile, but it should give you the same kind of report that you were looking for. Hope that helps!

September 1, 2009 10:10 AM

Anagha said:

How can I append the exact search term also to the end of this PPC keyword so I can see which keyword triggered the transaction. What filter should I use

December 14, 2009 2:00 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

Google Analytics does not currently capture the exact search term, so you would have to use a workaround like the one mentioned in this article. Then you would have to modify the filter to include the User Defined variable or whichever field you are using to store the exact search query.

December 14, 2009 9:21 AM

Anagha said:

Thank You for your prompt reply. I wanted to do this using filters and not scripts since I dont have access to the Clients page. So I tried using the filters shown on this page in addition to the filters from http://www.semvironment.com/ppc-management-adwords-keyword-data-exposed-with-google-analytics/.
I applied exact query filters first (referral etc) stored in custom field 2, then applied the filters on this page and appended the custom field 2 to it. But it didnt show the exact keywords for transactions. Am I doing something wrong. Can this be done. Please help

December 14, 2009 8:22 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

I've found those keyword filters from semvironment to not work properly - and also to break conversion and transaction tracking data within the reports. It's actually what prompted us to create the custom script in the first place.

Currently, the only method I've seen to do what you need is to use the custom scripts. This will only change if Google makes the Exact Search Query available within the Google Analytics fields.

December 15, 2009 9:03 AM

Jordan Glogau said:

Shawn:

Its been some time since your described your three filter technique. Do you still think this is the best path to match specific transactions to particular channels?

Do you know anyone that's tried to reconciled this methods with their accounting data. This is something that you can do with Coremetrics?

BTW, I saw you method in Biran Clifton's book and the most important piece of advice he left out, set up a different profile since this stuff can break your data.

Thank you for this helpful post.

August 27, 2011 4:08 PM

Chris said:

Hi Shawn,

We've also done some work with this and also had a lot of head scratching to get the results - great post though and cleared up a couple of areas. Regards

Chris

May 3, 2007 4:56 AM

Shawn Purtell said:

@Chris:

Thanks for the nice comment. Let me know if these new filters work out for you. I've only been using them for a little while, so it would be great to get some feedback.

May 3, 2007 8:42 AM

Mikey said:

Hi Shawn,

Great post mate. Like Chris, I've been scratching my head over this & have a couple of clients that will absolutely love this. Thanks :)

Mikey

May 3, 2007 8:22 PM

Shawn Purtell said:

@Mikey:

Thanks! I hope it turns out to be as useful as I think it might. I'd love to hear feedback from you once you've used the filters with clients.

May 4, 2007 9:05 AM

Krista said:

Great Post. These advanced filters are very usefull. I took your training course on Google Analytics. I was wondering if in the future you are going to offer a whole course on advanced implementation and setup where filters like these are taught and where regular expressions could be learned?

May 17, 2007 10:31 AM

Shawn Purtell said:

@Krista:

Thanks for the compliment. The training course that you took includes the most common advanced implementation options that we've encountered (things like Paypal, cross-domain tracking, etc.). We've also included the general ideas about the types of filters you can create. We're currently revamping the course for our new training series, and it will include more about filters and how you can use them to accomplish specific tasks.

In order to get more specific than that, you really need one-on-one attention, because setting up advanced filters really depends on your site and what kinds of information you want to find. This is one example of something our support plans can do for you on an individual level. We try our best to make this information freely available through our blog.

The same sort of thing applies to regular expressions. Regular expressions can get extremely complex, so we covered the most basic/common ones that you can use in our training course. Again, the more advanced regular expressions are only needed in very specific situations that would require one on one attention.

This brings up another point: Google Analytics is like getting a suit (or dress) fitted - you need to take measurements and personal tastes into consideration when you are setting up analytics. There are some steps that are universally important, but when you start looking at your individual site, no two Google Analytics configurations will be exactly alike.

I hope you found this useful. Thanks again for posting and for taking our course!

May 17, 2007 11:13 AM

Shareen Jordan said:

Hi, Shawn.

I really enjoy reading your blog. Thanks for the information. I was wondering, in the first filter you name the constructor field 'custom field 1' and you call it the same thing in the next filter. But (I think)the second filter refers to the custom filed in the first filter. If they are both named the same thing, does the field from the 1st filter overwrite the field from the second filter? And is there any reason why you wouldn't name them differently? Would there be any benefit in naming them customer field 1 and customer field 2?

Thanks! Shareen

June 5, 2007 3:04 PM

Shawn Purtell said:

@Shareen:

Thanks for the compliments. As far as your question, I only had to use a single custom field across all three filters.

So, filter 1 puts the source and medium into custom field 1.

The second filter reads the custom field from filter 1 and adds the term to what was already there.

The final filter adds the custom field we built in the previous two filters to the transaction id.

This is why the order of these filters is so important. They will not work out of sequence (they also should be next to each other on the filter list).

I didn't use two separate custom fields (although I could have) because I really only needed one.

As far as 'naming' the filter fields, you can't do that. You are given two custom fields you can use. I didn't actually name those, I selected them from the pulldown. Thanks for reading!

June 5, 2007 3:10 PM

Will said:

Great post Shawn - this is gold.

I have a question related to this subject. What I really want to do is to take this info (source and keyword) and pass it into a contact form so that we can implement closed-loop tracking of enquiries.

Do you have any ideas on how that might be done?

Bests,
Will

June 14, 2007 4:05 AM

Shawn Purtell said:

@Will:

It can be done. There are actually two methods I know of to do this. Unfortunately, this kind of thing is too advanced for a blog comment, but feel free to contact us if you want help setting this up.

June 14, 2007 9:07 AM

Al said:

Can this be done for organic traffic ? i.e. finding the keywords that deliver conversions from non-paid natural / SEO sources ? Cheers - Al

July 30, 2007 11:31 AM

Shawn Purtell said:

@Al:

These filters will include organic keywords as well. You can check out the screenshot above for some examples of this.

Thanks for reading!

July 30, 2007 11:50 AM

Brian Hinkle said:

Shawn-

Excellent work. I've just started using GA and was annoyed that there was no built-in functionality for that sort of origin tracking in ecommerce transactions - glad to see it can be added fairly easily!

July 30, 2007 2:38 PM

Shawn Purtell said:

@Brian:

That's the whole idea - making this awesome free tool (GA) more and more useful.

Thanks for the comment!

July 30, 2007 2:50 PM

Fonts said:

I use it and get some interesting (great) results. Some transactions are direct which I assume are bookmarked traffic

#312676 (direct) - (none) ()

and other transactions are like the one below do not have a value for the keyword I suppose since it is another site sending the traffic.

#312632 some-referring-site.com - referral ()

Everything else looks killer!

Thanks.

July 31, 2007 1:48 PM

Shawn Purtell said:

@Fonts:

Thanks for the feedback! Direct sources can mean a couple different things. Usually it means a user typed your URL into the browser directly, but there are some other things that will cause this, like email visits from a program like Outlook.

And you are correct with your second point - referring sites obviously will not have any keyword data, and so the parentheses will be blank.

Thanks again for the feedback!

August 2, 2007 3:58 PM

Nathan Scheffey said:

This is a great use of filters to achieve an extremely useful result. However, I think combining it with your excellent Exact Keyword Matching script really takes it to the next level.
I added another filter to append the User Defined Value (the exact keyword) after the Campaign Term. Now my transaction data shows the exact search string that led to the conversion. Very cool.
Question: is there a place to learn the syntax used in these custom filters (e.g. $A1 ($B1))? It seems pretty straightforward but I can't find any information about it in the GA Help documentation.
Anyway, thank you all for your excellent tools, they really take Google Analytics from good to great.

August 2, 2007 5:55 PM

Shawn Purtell said:

@Nathan:

I agree. If you have Michael's exact keyword tracking script installed, this is a great addition, and we actually do that ourselves.

To be honest, I don't have a specific resource for you concerning regular expression string matching variables, but there are lots of great books and websites on the subject.

August 3, 2007 8:53 AM

Neil said:

Hi Shawn.

I've tried doing this on 2 different analytics accounts, and can't get it to work.

I've copied everything word for word, but the keywords are never added. Could it be because the screenshots are of the previous version of analytics?

August 17, 2007 11:13 AM

Shawn Purtell said:

@Neil:

These filters have been tested and confirmed in the new version of Google Analytics.

I can't say for sure where your problem is occurring, but I can tell you that these filters work fine if used properly.

Is it possible you are having problems with your referring source tracking? Also, remember that keywords only show up for organic and cpc results - not for anything else (referrals, direct, banners, and other sources do not have keywords associated with them).

August 20, 2007 8:51 AM

Prince said:

Great stuff Shawn, very usefull.

Just having 1 problem, the first filter that grabs the source and medium, in the output filed you have $A1 - $B1

Thats exatly how I entered it but in my Transaction I am not getting the "source" I do get the keywords

So I get something like this:
Order27 $A (keyword)

August 21, 2007 12:01 AM

Neil said:

It works! Sort off...

Thanks for your help Shawn. I've just logged into Analytics, and it seems that the filters need to be in place for 24 hours to return anything.

Only wish I should filter on Adwords Campaigns instead of Campaigns (no option that I can see).

August 21, 2007 7:19 AM

Shawn Purtell said:

@Prince:

Looks like there's a problem with one of your filters - the third one I believe (specifically the $A1 part). Make sure there is no space between the $A and the 1. I can tell there is something wrong with your output field because '$A' is showing up in your data, and it should never do that.

August 21, 2007 9:15 AM

Shawn Purtell said:

@Neil:

Glad you got things working. And yeah, Google Analytics data generally takes 24 hours to update completely, so anytime you make a change, you need to give it time.

As to your other wish, I'm not really sure what you're asking. There are filters that can do all kinds of things. If you can be more specific, I may be able to help.

August 21, 2007 9:17 AM

Neil Munn said:

I'm accessing Analytics through my Adwords account. This means all my campaigns are listed under Adword campaigns, which isn't shown in the filters dropdown.

What I'm trying to do is, display the keyword(s) that the user types in to make their transaction eg:

Transaction ID, Source, Medium, (Keyword)

Is this possible?

August 22, 2007 5:59 AM

Shawn Purtell said:

@Neil:

The filter set I provided does this automatically, if the keyword exists. You can see in the image above that the keyword should be present for all organic and cpc (including AdWords) sources.

You should not need any additional filters to achieve this result. If you aren't seeing this data, you may not have the filters set up properly.

*Note - There is a difference between 'what the user types in' and the keyword you are bidding on.

The 'term the user typed in' is called the search term while the keyword you bid on is called the bid term. The bid term is the information you will see.

To find out how to get search term info as well, visit Michael's awesome solution here.

August 22, 2007 9:33 AM

Netmeg said:

Hello - I've been using this filter pretty much since you posted it, and it worked just fine. But I created a new profile for it, and it hasn't worked since. Could it be the new Google Analytics code? I then tried to put it back on the original profile on which I had it, and it *still* doesn't work. I haven't changed any of the code, I have the three filters in the proper order - the only thing that has changed was the Google analytics code. And actually, I'm testing that on still another profile, so I'm not entirely sure what's going on now.

January 22, 2008 11:08 AM

Netmeg said:

As an update to my previous post, I went and checked, and between and my partners, five ecommerce sites that were using this filter ALL stopped displaying the data on January 15th. How weird is that? Google must have changed something.

January 22, 2008 1:34 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

There have actually been reports of all advanced filters breaking around that same date, but many people have also stated that their filters have begun to work again. I'd check the more recent data again. In the meantime, we're conducting our own investigation concerning why advanced filters have had this little hiccup, and we'll let you know if we find anything important.

January 23, 2008 8:59 AM

Netmeg said:

As of today, 1/23/2008, none of our advanced filters are working.

Thanks in advance for anything you find out.

January 23, 2008 10:51 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

After examining some other data and situations with both custom and advanced filters, it seems this is an issue many people are experiencing. From the Google Analytics help group to our own data, we have noticed two things:

Many custom filters seemed to stop functioning for several accounts for a brief period around Jan8th, but resumed working on the 15th. This includes custom includes and other custom filters.

Advanced filters that use custom fields, however, seems to be having more trouble, and in many cases have not worked since the 15th on January. Among these kinds of filters is the filter described in this article.

As soon as we get a good explanation as to what's been causing these errors, I'll be sure to post an update here.

January 29, 2008 10:42 AM

Steve Racicot said:

Is anyone using this advanced filters getting data? Is it working correctly?

I have had this installed for over a week and have seen no changes to my transaction list under Eccommerce -> Transactions.

Steve

February 18, 2008 11:14 AM

Jeremy Aube said:

@Steve

Any advanced filters that use custom fields have not been working since January 15th, including this one. This should be a temporary issues, but in the meantime, we have posted an article on an alternate set of filters you can use that function exactly the same as this set. You can get your filters there, and then refer to Shawn's article here for addition instruction and information.

February 18, 2008 3:55 PM

Imran Khan said:

Really informative post.
One question: Where can I find the Transaction List, the last image. I am using the old version of analytics code.

Thanks in advance

February 20, 2008 6:39 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Imran:

The Transaction list is under the Ecommerce section in Google Analytics, and will only show up if you have turned on Ecommerce in your profile settings. The exact report you're looking for is called Transactions.

As a note here, I realize these filters have not been working correctly since Jan. 15th. The filters are still correct, but there was a bug with custom fields (which these filters use) that is being resolved. Until then, feel free to look at Jeremy's update, which gets around this temporary issue.

February 20, 2008 8:57 AM

Asher said:

Have these filters every returned to working properly? I added them before reading to the bottom of the comments. I'm finding that when I view transactions I get the transaction number followed by the state.

June 9, 2008 10:49 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Asher:

These filters have been working correctly for a while now. These three filters do not affect the state of a user, so I wonder why you are seeing that information within Google Analytics. My hunch is that either there is a problem with the way you've set up the filters in your profile, or you have another filter that's using the Custom Field that's interfering with the transaction filters. Unfortunately, it's hard to tell you exactly what the problem is without seeing your filter setup.

June 9, 2008 1:15 PM

Duff said:

First of all, great post, Shawn.

I'm having a problem though.
I paid for a banner on another website. The link to my website is tagged properly:
http://www.mywebsite.com?utm_source=Other%2BWebsite&utm_medium=Banner&utm_campaign=Other%2BWebsite

I am getting some transactions through this banner but in my transaction list all I can see is:
mytransID mywebsite.com-referral (mywebsite.com)

However, of course I would like to be able to see:
mytransID Other Website-Banner ()

Do you have any idea about what did I do wrong?

July 23, 2008 5:57 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff:

It looks like you're getting what we call 'self-referrals' - meaning Google Analytics is registering visits from your own site. This actually has nothing to do with the filters, as those look like they are working.

Self-referrals can occur for many different reasons, but the three most common are:

1. Some pages on your site are missing Google Analytics code.
2. You use multiple subdomains and haven't set up the Google Analytics code for subdomains.
3. Your site has multiple main domains.

If any of these apply to you, then you've most likely found the reason for your self-referrals. If none of these apply to you, there may be another problem with your Google Analytics installation, and I'd have to actually see it in order to diagnose the problem.

July 23, 2008 8:41 AM

Duff said:

Just wanted to thank you coz it is now working properly. Indeed, I use 2 domains, one for the website and another one for payments. Again, thanks a lot!

July 24, 2008 11:28 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff: Glad I could help. Thanks for reading!

July 25, 2008 8:08 AM

Tim said:

Hi Sean - I have an old website that we are redirecting all traffic to our new site. I would like to know which specific transactions are coming from the old site. We are using 301 redirects on individual pages. I tried your examples and it is not picking up the old website as the source or medium... Do you have any advice? Thanks

August 26, 2008 3:09 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Tim: I'm pretty sure Jeremy already answered this on a different blog article, but I agree with him that the only real way to do this effectively with Google Analytics is to add a query parameter to the end of the 301 redirect and then use the Site Search report within Google Analytics to see which transactions are coming from customers who were trying to find the old site.

August 28, 2008 7:44 AM

juan cruz aliaga said:

Hi Shawn, great post!
I am arriving late to this one, but I can see how useful could it be to avoid double counting on orders/transactions.
I was just wondering if the associated keywords would be the last ones used on any campaing source and medium. If so, and to keep track of visitors previous visits to purchase, couldn't we also grab the visitor ID (with a new filter) and appends it to the rest of the info??

Rgds,

jc

February 17, 2009 4:25 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Juan:

Just like with normal Google Analytics tracking, the keyword/source/medium reported with the transaction will be the most recent. Also, in regards to your question about visitor ID - that depends on where the ID is stored. There is no built-in visitor ID filter field in Google Analytics for this, but you could send the data from your database to Google Analytics with each transaction using the ecommerce code. If you do this, you'll probably want to read over the Google Analytics Terms of Service just to make sure the information you're passing isn't considered personally identifiable.

February 17, 2009 8:19 AM

liz rz said:

Hi, this is a great filter, but was wondering how i could modify it to show me the transaction date which is a sortable list so i can see which are the most recent orders...with the existing filter i can only sort by revenue, tax, shipping, quantity. I know i can choose date range for the same info, but a sort would be easier. Thanks, this very useful info.

February 19, 2009 10:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

Probably the easiest way to do this is to use Andre Scholten's Table Sorter add-on for Google Analytics (the site is in Dutch). This is also included in the Better Google Analytics Firefox addon from VKI Studios.

February 19, 2009 10:42 AM

liz rz said:

I've added the filters above and now I'd like to export the data to be able to sort the data into a spreadsheet. There is no seperator between the data fields so I can't seperate the referring source and the keyword. Any ideas?

April 20, 2009 10:32 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

It's a little advanced, but you could run a macro on the spreadsheet that splits up the data for you. That's really the only way that I can see doing this quickly. Moving forward, you could modify the filters so that they contain a separator.

April 20, 2009 11:24 AM

liz rz said:

Thanks Shawn! Can you tell me how to add the data separator to the filters, or point toward a resource where I can learn? This is very helpful! Thanks.

April 24, 2009 8:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

In the filters above, you can modify the Output field at the very bottom of each filter to add your own separators. In my example, I use a dash in filter one, parentheses in filter two, and just a space in filter three. You could easily modify these fields to use a different separator (like a comma) that's easier for you.

April 24, 2009 8:46 AM

mp said:

Thank you for great post. We are using Google Analytic about one year. This solution going to change new transactions. Is there is any way to run it on existing data? I'm just wonder is it possible to achieve the same results with advanced reports?
Thank you for your time.

August 6, 2009 1:06 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You could also use the Secondary Segment dropdown in the Transactions report to some extent. With Jeremy's Google Analytics Report Enhancer, you can segment by source/medium. You could use Advanced Segments to look at a specific medium (cpc for example), and then use the Secondary Segment to look at keyword.

I don't think there's a simple way to do all of this in one step, but the information is there, you just may have to dig for it a little.

August 6, 2009 8:12 AM

mp said:

Hello,

I'm trying to add product name to report and result will be like:
tranID | source | medium | keyword | item_name1 item_name2
I'm using the same filters as use I just added new filter that concatenate item name custom_field.
Trans List Mod 1 \x96 same Trans List Mod 1 - separator |
Trans List Mod 2 - same Trans List Mod 2 \x96 separator |
Trans List Mod 3 - add item name to custom field
Field A -> Extract A Custom Field 1 (.*)
Field B -> Extract B E-commerce Item Name (.*)
Output To -> Constructor Custom Field 1 $A1 | $B1
Field A Required Yes
Field B Required Yes/No tried both
Override Output Field Yes
Case Sensitive No
Trans List Mod 4 - same as Trans List Mod 3. \x96 separator |
As a result I'm getting douplicate rows one with item name and another without. Could you please point me the right direction?
Thank you for your time.

August 28, 2009 7:04 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You're going to run into several issues when using any filter that looks at both transactions and products at the same time. The primary issue here is that a single transaction can be associated with more than one product, which means that Google Analytics stores these pieces of data separately within the original database (and maybe even within different databases).

The easiest way to get the product information for a specific transaction is to just click on the ID. You'll then see a list of products in the transaction.

You may also have some success with an opposite approach, although I haven't tried this yet - try adding the transaction ID and source, etc. to the product name (sort of the reverse of what you're doing). As a caution, I would try this in a separate test profile, but it should give you the same kind of report that you were looking for. Hope that helps!

September 1, 2009 10:10 AM

Anagha said:

How can I append the exact search term also to the end of this PPC keyword so I can see which keyword triggered the transaction. What filter should I use

December 14, 2009 2:00 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

Google Analytics does not currently capture the exact search term, so you would have to use a workaround like the one mentioned in this article. Then you would have to modify the filter to include the User Defined variable or whichever field you are using to store the exact search query.

December 14, 2009 9:21 AM

Anagha said:

Thank You for your prompt reply. I wanted to do this using filters and not scripts since I dont have access to the Clients page. So I tried using the filters shown on this page in addition to the filters from http://www.semvironment.com/ppc-management-adwords-keyword-data-exposed-with-google-analytics/.
I applied exact query filters first (referral etc) stored in custom field 2, then applied the filters on this page and appended the custom field 2 to it. But it didnt show the exact keywords for transactions. Am I doing something wrong. Can this be done. Please help

December 14, 2009 8:22 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

I've found those keyword filters from semvironment to not work properly - and also to break conversion and transaction tracking data within the reports. It's actually what prompted us to create the custom script in the first place.

Currently, the only method I've seen to do what you need is to use the custom scripts. This will only change if Google makes the Exact Search Query available within the Google Analytics fields.

December 15, 2009 9:03 AM

Jordan Glogau said:

Shawn:

Its been some time since your described your three filter technique. Do you still think this is the best path to match specific transactions to particular channels?

Do you know anyone that's tried to reconciled this methods with their accounting data. This is something that you can do with Coremetrics?

BTW, I saw you method in Biran Clifton's book and the most important piece of advice he left out, set up a different profile since this stuff can break your data.

Thank you for this helpful post.

August 27, 2011 4:08 PM

Chris said:

Hi Shawn,

We've also done some work with this and also had a lot of head scratching to get the results - great post though and cleared up a couple of areas. Regards

Chris

May 3, 2007 4:56 AM

Shawn Purtell said:

@Chris:

Thanks for the nice comment. Let me know if these new filters work out for you. I've only been using them for a little while, so it would be great to get some feedback.

May 3, 2007 8:42 AM

Mikey said:

Hi Shawn,

Great post mate. Like Chris, I've been scratching my head over this & have a couple of clients that will absolutely love this. Thanks :)

Mikey

May 3, 2007 8:22 PM

Shawn Purtell said:

@Mikey:

Thanks! I hope it turns out to be as useful as I think it might. I'd love to hear feedback from you once you've used the filters with clients.

May 4, 2007 9:05 AM

Krista said:

Great Post. These advanced filters are very usefull. I took your training course on Google Analytics. I was wondering if in the future you are going to offer a whole course on advanced implementation and setup where filters like these are taught and where regular expressions could be learned?

May 17, 2007 10:31 AM

Shawn Purtell said:

@Krista:

Thanks for the compliment. The training course that you took includes the most common advanced implementation options that we've encountered (things like Paypal, cross-domain tracking, etc.). We've also included the general ideas about the types of filters you can create. We're currently revamping the course for our new training series, and it will include more about filters and how you can use them to accomplish specific tasks.

In order to get more specific than that, you really need one-on-one attention, because setting up advanced filters really depends on your site and what kinds of information you want to find. This is one example of something our support plans can do for you on an individual level. We try our best to make this information freely available through our blog.

The same sort of thing applies to regular expressions. Regular expressions can get extremely complex, so we covered the most basic/common ones that you can use in our training course. Again, the more advanced regular expressions are only needed in very specific situations that would require one on one attention.

This brings up another point: Google Analytics is like getting a suit (or dress) fitted - you need to take measurements and personal tastes into consideration when you are setting up analytics. There are some steps that are universally important, but when you start looking at your individual site, no two Google Analytics configurations will be exactly alike.

I hope you found this useful. Thanks again for posting and for taking our course!

May 17, 2007 11:13 AM

Shareen Jordan said:

Hi, Shawn.

I really enjoy reading your blog. Thanks for the information. I was wondering, in the first filter you name the constructor field 'custom field 1' and you call it the same thing in the next filter. But (I think)the second filter refers to the custom filed in the first filter. If they are both named the same thing, does the field from the 1st filter overwrite the field from the second filter? And is there any reason why you wouldn't name them differently? Would there be any benefit in naming them customer field 1 and customer field 2?

Thanks! Shareen

June 5, 2007 3:04 PM

Shawn Purtell said:

@Shareen:

Thanks for the compliments. As far as your question, I only had to use a single custom field across all three filters.

So, filter 1 puts the source and medium into custom field 1.

The second filter reads the custom field from filter 1 and adds the term to what was already there.

The final filter adds the custom field we built in the previous two filters to the transaction id.

This is why the order of these filters is so important. They will not work out of sequence (they also should be next to each other on the filter list).

I didn't use two separate custom fields (although I could have) because I really only needed one.

As far as 'naming' the filter fields, you can't do that. You are given two custom fields you can use. I didn't actually name those, I selected them from the pulldown. Thanks for reading!

June 5, 2007 3:10 PM

Will said:

Great post Shawn - this is gold.

I have a question related to this subject. What I really want to do is to take this info (source and keyword) and pass it into a contact form so that we can implement closed-loop tracking of enquiries.

Do you have any ideas on how that might be done?

Bests,
Will

June 14, 2007 4:05 AM

Shawn Purtell said:

@Will:

It can be done. There are actually two methods I know of to do this. Unfortunately, this kind of thing is too advanced for a blog comment, but feel free to contact us if you want help setting this up.

June 14, 2007 9:07 AM

Al said:

Can this be done for organic traffic ? i.e. finding the keywords that deliver conversions from non-paid natural / SEO sources ? Cheers - Al

July 30, 2007 11:31 AM

Shawn Purtell said:

@Al:

These filters will include organic keywords as well. You can check out the screenshot above for some examples of this.

Thanks for reading!

July 30, 2007 11:50 AM

Brian Hinkle said:

Shawn-

Excellent work. I've just started using GA and was annoyed that there was no built-in functionality for that sort of origin tracking in ecommerce transactions - glad to see it can be added fairly easily!

July 30, 2007 2:38 PM

Shawn Purtell said:

@Brian:

That's the whole idea - making this awesome free tool (GA) more and more useful.

Thanks for the comment!

July 30, 2007 2:50 PM

Fonts said:

I use it and get some interesting (great) results. Some transactions are direct which I assume are bookmarked traffic

#312676 (direct) - (none) ()

and other transactions are like the one below do not have a value for the keyword I suppose since it is another site sending the traffic.

#312632 some-referring-site.com - referral ()

Everything else looks killer!

Thanks.

July 31, 2007 1:48 PM

Shawn Purtell said:

@Fonts:

Thanks for the feedback! Direct sources can mean a couple different things. Usually it means a user typed your URL into the browser directly, but there are some other things that will cause this, like email visits from a program like Outlook.

And you are correct with your second point - referring sites obviously will not have any keyword data, and so the parentheses will be blank.

Thanks again for the feedback!

August 2, 2007 3:58 PM

Nathan Scheffey said:

This is a great use of filters to achieve an extremely useful result. However, I think combining it with your excellent Exact Keyword Matching script really takes it to the next level.
I added another filter to append the User Defined Value (the exact keyword) after the Campaign Term. Now my transaction data shows the exact search string that led to the conversion. Very cool.
Question: is there a place to learn the syntax used in these custom filters (e.g. $A1 ($B1))? It seems pretty straightforward but I can't find any information about it in the GA Help documentation.
Anyway, thank you all for your excellent tools, they really take Google Analytics from good to great.

August 2, 2007 5:55 PM

Shawn Purtell said:

@Nathan:

I agree. If you have Michael's exact keyword tracking script installed, this is a great addition, and we actually do that ourselves.

To be honest, I don't have a specific resource for you concerning regular expression string matching variables, but there are lots of great books and websites on the subject.

August 3, 2007 8:53 AM

Neil said:

Hi Shawn.

I've tried doing this on 2 different analytics accounts, and can't get it to work.

I've copied everything word for word, but the keywords are never added. Could it be because the screenshots are of the previous version of analytics?

August 17, 2007 11:13 AM

Shawn Purtell said:

@Neil:

These filters have been tested and confirmed in the new version of Google Analytics.

I can't say for sure where your problem is occurring, but I can tell you that these filters work fine if used properly.

Is it possible you are having problems with your referring source tracking? Also, remember that keywords only show up for organic and cpc results - not for anything else (referrals, direct, banners, and other sources do not have keywords associated with them).

August 20, 2007 8:51 AM

Prince said:

Great stuff Shawn, very usefull.

Just having 1 problem, the first filter that grabs the source and medium, in the output filed you have $A1 - $B1

Thats exatly how I entered it but in my Transaction I am not getting the "source" I do get the keywords

So I get something like this:
Order27 $A (keyword)

August 21, 2007 12:01 AM

Neil said:

It works! Sort off...

Thanks for your help Shawn. I've just logged into Analytics, and it seems that the filters need to be in place for 24 hours to return anything.

Only wish I should filter on Adwords Campaigns instead of Campaigns (no option that I can see).

August 21, 2007 7:19 AM

Shawn Purtell said:

@Prince:

Looks like there's a problem with one of your filters - the third one I believe (specifically the $A1 part). Make sure there is no space between the $A and the 1. I can tell there is something wrong with your output field because '$A' is showing up in your data, and it should never do that.

August 21, 2007 9:15 AM

Shawn Purtell said:

@Neil:

Glad you got things working. And yeah, Google Analytics data generally takes 24 hours to update completely, so anytime you make a change, you need to give it time.

As to your other wish, I'm not really sure what you're asking. There are filters that can do all kinds of things. If you can be more specific, I may be able to help.

August 21, 2007 9:17 AM

Neil Munn said:

I'm accessing Analytics through my Adwords account. This means all my campaigns are listed under Adword campaigns, which isn't shown in the filters dropdown.

What I'm trying to do is, display the keyword(s) that the user types in to make their transaction eg:

Transaction ID, Source, Medium, (Keyword)

Is this possible?

August 22, 2007 5:59 AM

Shawn Purtell said:

@Neil:

The filter set I provided does this automatically, if the keyword exists. You can see in the image above that the keyword should be present for all organic and cpc (including AdWords) sources.

You should not need any additional filters to achieve this result. If you aren't seeing this data, you may not have the filters set up properly.

*Note - There is a difference between 'what the user types in' and the keyword you are bidding on.

The 'term the user typed in' is called the search term while the keyword you bid on is called the bid term. The bid term is the information you will see.

To find out how to get search term info as well, visit Michael's awesome solution here.

August 22, 2007 9:33 AM

Netmeg said:

Hello - I've been using this filter pretty much since you posted it, and it worked just fine. But I created a new profile for it, and it hasn't worked since. Could it be the new Google Analytics code? I then tried to put it back on the original profile on which I had it, and it *still* doesn't work. I haven't changed any of the code, I have the three filters in the proper order - the only thing that has changed was the Google analytics code. And actually, I'm testing that on still another profile, so I'm not entirely sure what's going on now.

January 22, 2008 11:08 AM

Netmeg said:

As an update to my previous post, I went and checked, and between and my partners, five ecommerce sites that were using this filter ALL stopped displaying the data on January 15th. How weird is that? Google must have changed something.

January 22, 2008 1:34 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

There have actually been reports of all advanced filters breaking around that same date, but many people have also stated that their filters have begun to work again. I'd check the more recent data again. In the meantime, we're conducting our own investigation concerning why advanced filters have had this little hiccup, and we'll let you know if we find anything important.

January 23, 2008 8:59 AM

Netmeg said:

As of today, 1/23/2008, none of our advanced filters are working.

Thanks in advance for anything you find out.

January 23, 2008 10:51 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

After examining some other data and situations with both custom and advanced filters, it seems this is an issue many people are experiencing. From the Google Analytics help group to our own data, we have noticed two things:

Many custom filters seemed to stop functioning for several accounts for a brief period around Jan8th, but resumed working on the 15th. This includes custom includes and other custom filters.

Advanced filters that use custom fields, however, seems to be having more trouble, and in many cases have not worked since the 15th on January. Among these kinds of filters is the filter described in this article.

As soon as we get a good explanation as to what's been causing these errors, I'll be sure to post an update here.

January 29, 2008 10:42 AM

Steve Racicot said:

Is anyone using this advanced filters getting data? Is it working correctly?

I have had this installed for over a week and have seen no changes to my transaction list under Eccommerce -> Transactions.

Steve

February 18, 2008 11:14 AM

Jeremy Aube said:

@Steve

Any advanced filters that use custom fields have not been working since January 15th, including this one. This should be a temporary issues, but in the meantime, we have posted an article on an alternate set of filters you can use that function exactly the same as this set. You can get your filters there, and then refer to Shawn's article here for addition instruction and information.

February 18, 2008 3:55 PM

Imran Khan said:

Really informative post.
One question: Where can I find the Transaction List, the last image. I am using the old version of analytics code.

Thanks in advance

February 20, 2008 6:39 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Imran:

The Transaction list is under the Ecommerce section in Google Analytics, and will only show up if you have turned on Ecommerce in your profile settings. The exact report you're looking for is called Transactions.

As a note here, I realize these filters have not been working correctly since Jan. 15th. The filters are still correct, but there was a bug with custom fields (which these filters use) that is being resolved. Until then, feel free to look at Jeremy's update, which gets around this temporary issue.

February 20, 2008 8:57 AM

Asher said:

Have these filters every returned to working properly? I added them before reading to the bottom of the comments. I'm finding that when I view transactions I get the transaction number followed by the state.

June 9, 2008 10:49 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Asher:

These filters have been working correctly for a while now. These three filters do not affect the state of a user, so I wonder why you are seeing that information within Google Analytics. My hunch is that either there is a problem with the way you've set up the filters in your profile, or you have another filter that's using the Custom Field that's interfering with the transaction filters. Unfortunately, it's hard to tell you exactly what the problem is without seeing your filter setup.

June 9, 2008 1:15 PM

Duff said:

First of all, great post, Shawn.

I'm having a problem though.
I paid for a banner on another website. The link to my website is tagged properly:
http://www.mywebsite.com?utm_source=Other%2BWebsite&utm_medium=Banner&utm_campaign=Other%2BWebsite

I am getting some transactions through this banner but in my transaction list all I can see is:
mytransID mywebsite.com-referral (mywebsite.com)

However, of course I would like to be able to see:
mytransID Other Website-Banner ()

Do you have any idea about what did I do wrong?

July 23, 2008 5:57 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff:

It looks like you're getting what we call 'self-referrals' - meaning Google Analytics is registering visits from your own site. This actually has nothing to do with the filters, as those look like they are working.

Self-referrals can occur for many different reasons, but the three most common are:

1. Some pages on your site are missing Google Analytics code.
2. You use multiple subdomains and haven't set up the Google Analytics code for subdomains.
3. Your site has multiple main domains.

If any of these apply to you, then you've most likely found the reason for your self-referrals. If none of these apply to you, there may be another problem with your Google Analytics installation, and I'd have to actually see it in order to diagnose the problem.

July 23, 2008 8:41 AM

Duff said:

Just wanted to thank you coz it is now working properly. Indeed, I use 2 domains, one for the website and another one for payments. Again, thanks a lot!

July 24, 2008 11:28 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff: Glad I could help. Thanks for reading!

July 25, 2008 8:08 AM

Tim said:

Hi Sean - I have an old website that we are redirecting all traffic to our new site. I would like to know which specific transactions are coming from the old site. We are using 301 redirects on individual pages. I tried your examples and it is not picking up the old website as the source or medium... Do you have any advice? Thanks

August 26, 2008 3:09 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Tim: I'm pretty sure Jeremy already answered this on a different blog article, but I agree with him that the only real way to do this effectively with Google Analytics is to add a query parameter to the end of the 301 redirect and then use the Site Search report within Google Analytics to see which transactions are coming from customers who were trying to find the old site.

August 28, 2008 7:44 AM

juan cruz aliaga said:

Hi Shawn, great post!
I am arriving late to this one, but I can see how useful could it be to avoid double counting on orders/transactions.
I was just wondering if the associated keywords would be the last ones used on any campaing source and medium. If so, and to keep track of visitors previous visits to purchase, couldn't we also grab the visitor ID (with a new filter) and appends it to the rest of the info??

Rgds,

jc

February 17, 2009 4:25 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Juan:

Just like with normal Google Analytics tracking, the keyword/source/medium reported with the transaction will be the most recent. Also, in regards to your question about visitor ID - that depends on where the ID is stored. There is no built-in visitor ID filter field in Google Analytics for this, but you could send the data from your database to Google Analytics with each transaction using the ecommerce code. If you do this, you'll probably want to read over the Google Analytics Terms of Service just to make sure the information you're passing isn't considered personally identifiable.

February 17, 2009 8:19 AM

liz rz said:

Hi, this is a great filter, but was wondering how i could modify it to show me the transaction date which is a sortable list so i can see which are the most recent orders...with the existing filter i can only sort by revenue, tax, shipping, quantity. I know i can choose date range for the same info, but a sort would be easier. Thanks, this very useful info.

February 19, 2009 10:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

Probably the easiest way to do this is to use Andre Scholten's Table Sorter add-on for Google Analytics (the site is in Dutch). This is also included in the Better Google Analytics Firefox addon from VKI Studios.

February 19, 2009 10:42 AM

liz rz said:

I've added the filters above and now I'd like to export the data to be able to sort the data into a spreadsheet. There is no seperator between the data fields so I can't seperate the referring source and the keyword. Any ideas?

April 20, 2009 10:32 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

It's a little advanced, but you could run a macro on the spreadsheet that splits up the data for you. That's really the only way that I can see doing this quickly. Moving forward, you could modify the filters so that they contain a separator.

April 20, 2009 11:24 AM

liz rz said:

Thanks Shawn! Can you tell me how to add the data separator to the filters, or point toward a resource where I can learn? This is very helpful! Thanks.

April 24, 2009 8:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

In the filters above, you can modify the Output field at the very bottom of each filter to add your own separators. In my example, I use a dash in filter one, parentheses in filter two, and just a space in filter three. You could easily modify these fields to use a different separator (like a comma) that's easier for you.

April 24, 2009 8:46 AM

mp said:

Thank you for great post. We are using Google Analytic about one year. This solution going to change new transactions. Is there is any way to run it on existing data? I'm just wonder is it possible to achieve the same results with advanced reports?
Thank you for your time.

August 6, 2009 1:06 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You could also use the Secondary Segment dropdown in the Transactions report to some extent. With Jeremy's Google Analytics Report Enhancer, you can segment by source/medium. You could use Advanced Segments to look at a specific medium (cpc for example), and then use the Secondary Segment to look at keyword.

I don't think there's a simple way to do all of this in one step, but the information is there, you just may have to dig for it a little.

August 6, 2009 8:12 AM

mp said:

Hello,

I'm trying to add product name to report and result will be like:
tranID | source | medium | keyword | item_name1 item_name2
I'm using the same filters as use I just added new filter that concatenate item name custom_field.
Trans List Mod 1 \x96 same Trans List Mod 1 - separator |
Trans List Mod 2 - same Trans List Mod 2 \x96 separator |
Trans List Mod 3 - add item name to custom field
Field A -> Extract A Custom Field 1 (.*)
Field B -> Extract B E-commerce Item Name (.*)
Output To -> Constructor Custom Field 1 $A1 | $B1
Field A Required Yes
Field B Required Yes/No tried both
Override Output Field Yes
Case Sensitive No
Trans List Mod 4 - same as Trans List Mod 3. \x96 separator |
As a result I'm getting douplicate rows one with item name and another without. Could you please point me the right direction?
Thank you for your time.

August 28, 2009 7:04 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You're going to run into several issues when using any filter that looks at both transactions and products at the same time. The primary issue here is that a single transaction can be associated with more than one product, which means that Google Analytics stores these pieces of data separately within the original database (and maybe even within different databases).

The easiest way to get the product information for a specific transaction is to just click on the ID. You'll then see a list of products in the transaction.

You may also have some success with an opposite approach, although I haven't tried this yet - try adding the transaction ID and source, etc. to the product name (sort of the reverse of what you're doing). As a caution, I would try this in a separate test profile, but it should give you the same kind of report that you were looking for. Hope that helps!

September 1, 2009 10:10 AM

Anagha said:

How can I append the exact search term also to the end of this PPC keyword so I can see which keyword triggered the transaction. What filter should I use

December 14, 2009 2:00 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

Google Analytics does not currently capture the exact search term, so you would have to use a workaround like the one mentioned in this article. Then you would have to modify the filter to include the User Defined variable or whichever field you are using to store the exact search query.

December 14, 2009 9:21 AM

Anagha said:

Thank You for your prompt reply. I wanted to do this using filters and not scripts since I dont have access to the Clients page. So I tried using the filters shown on this page in addition to the filters from http://www.semvironment.com/ppc-management-adwords-keyword-data-exposed-with-google-analytics/.
I applied exact query filters first (referral etc) stored in custom field 2, then applied the filters on this page and appended the custom field 2 to it. But it didnt show the exact keywords for transactions. Am I doing something wrong. Can this be done. Please help

December 14, 2009 8:22 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

I've found those keyword filters from semvironment to not work properly - and also to break conversion and transaction tracking data within the reports. It's actually what prompted us to create the custom script in the first place.

Currently, the only method I've seen to do what you need is to use the custom scripts. This will only change if Google makes the Exact Search Query available within the Google Analytics fields.

December 15, 2009 9:03 AM

Jordan Glogau said:

Shawn:

Its been some time since your described your three filter technique. Do you still think this is the best path to match specific transactions to particular channels?

Do you know anyone that's tried to reconciled this methods with their accounting data. This is something that you can do with Coremetrics?

BTW, I saw you method in Biran Clifton's book and the most important piece of advice he left out, set up a different profile since this stuff can break your data.

Thank you for this helpful post.

August 27, 2011 4:08 PM

Chris said:

Hi Shawn,

We've also done some work with this and also had a lot of head scratching to get the results - great post though and cleared up a couple of areas. Regards

Chris

May 3, 2007 4:56 AM

Shawn Purtell said:

@Chris:

Thanks for the nice comment. Let me know if these new filters work out for you. I've only been using them for a little while, so it would be great to get some feedback.

May 3, 2007 8:42 AM

Mikey said:

Hi Shawn,

Great post mate. Like Chris, I've been scratching my head over this & have a couple of clients that will absolutely love this. Thanks :)

Mikey

May 3, 2007 8:22 PM

Shawn Purtell said:

@Mikey:

Thanks! I hope it turns out to be as useful as I think it might. I'd love to hear feedback from you once you've used the filters with clients.

May 4, 2007 9:05 AM

Krista said:

Great Post. These advanced filters are very usefull. I took your training course on Google Analytics. I was wondering if in the future you are going to offer a whole course on advanced implementation and setup where filters like these are taught and where regular expressions could be learned?

May 17, 2007 10:31 AM

Shawn Purtell said:

@Krista:

Thanks for the compliment. The training course that you took includes the most common advanced implementation options that we've encountered (things like Paypal, cross-domain tracking, etc.). We've also included the general ideas about the types of filters you can create. We're currently revamping the course for our new training series, and it will include more about filters and how you can use them to accomplish specific tasks.

In order to get more specific than that, you really need one-on-one attention, because setting up advanced filters really depends on your site and what kinds of information you want to find. This is one example of something our support plans can do for you on an individual level. We try our best to make this information freely available through our blog.

The same sort of thing applies to regular expressions. Regular expressions can get extremely complex, so we covered the most basic/common ones that you can use in our training course. Again, the more advanced regular expressions are only needed in very specific situations that would require one on one attention.

This brings up another point: Google Analytics is like getting a suit (or dress) fitted - you need to take measurements and personal tastes into consideration when you are setting up analytics. There are some steps that are universally important, but when you start looking at your individual site, no two Google Analytics configurations will be exactly alike.

I hope you found this useful. Thanks again for posting and for taking our course!

May 17, 2007 11:13 AM

Shareen Jordan said:

Hi, Shawn.

I really enjoy reading your blog. Thanks for the information. I was wondering, in the first filter you name the constructor field 'custom field 1' and you call it the same thing in the next filter. But (I think)the second filter refers to the custom filed in the first filter. If they are both named the same thing, does the field from the 1st filter overwrite the field from the second filter? And is there any reason why you wouldn't name them differently? Would there be any benefit in naming them customer field 1 and customer field 2?

Thanks! Shareen

June 5, 2007 3:04 PM

Shawn Purtell said:

@Shareen:

Thanks for the compliments. As far as your question, I only had to use a single custom field across all three filters.

So, filter 1 puts the source and medium into custom field 1.

The second filter reads the custom field from filter 1 and adds the term to what was already there.

The final filter adds the custom field we built in the previous two filters to the transaction id.

This is why the order of these filters is so important. They will not work out of sequence (they also should be next to each other on the filter list).

I didn't use two separate custom fields (although I could have) because I really only needed one.

As far as 'naming' the filter fields, you can't do that. You are given two custom fields you can use. I didn't actually name those, I selected them from the pulldown. Thanks for reading!

June 5, 2007 3:10 PM

Will said:

Great post Shawn - this is gold.

I have a question related to this subject. What I really want to do is to take this info (source and keyword) and pass it into a contact form so that we can implement closed-loop tracking of enquiries.

Do you have any ideas on how that might be done?

Bests,
Will

June 14, 2007 4:05 AM

Shawn Purtell said:

@Will:

It can be done. There are actually two methods I know of to do this. Unfortunately, this kind of thing is too advanced for a blog comment, but feel free to contact us if you want help setting this up.

June 14, 2007 9:07 AM

Al said:

Can this be done for organic traffic ? i.e. finding the keywords that deliver conversions from non-paid natural / SEO sources ? Cheers - Al

July 30, 2007 11:31 AM

Shawn Purtell said:

@Al:

These filters will include organic keywords as well. You can check out the screenshot above for some examples of this.

Thanks for reading!

July 30, 2007 11:50 AM

Brian Hinkle said:

Shawn-

Excellent work. I've just started using GA and was annoyed that there was no built-in functionality for that sort of origin tracking in ecommerce transactions - glad to see it can be added fairly easily!

July 30, 2007 2:38 PM

Shawn Purtell said:

@Brian:

That's the whole idea - making this awesome free tool (GA) more and more useful.

Thanks for the comment!

July 30, 2007 2:50 PM

Fonts said:

I use it and get some interesting (great) results. Some transactions are direct which I assume are bookmarked traffic

#312676 (direct) - (none) ()

and other transactions are like the one below do not have a value for the keyword I suppose since it is another site sending the traffic.

#312632 some-referring-site.com - referral ()

Everything else looks killer!

Thanks.

July 31, 2007 1:48 PM

Shawn Purtell said:

@Fonts:

Thanks for the feedback! Direct sources can mean a couple different things. Usually it means a user typed your URL into the browser directly, but there are some other things that will cause this, like email visits from a program like Outlook.

And you are correct with your second point - referring sites obviously will not have any keyword data, and so the parentheses will be blank.

Thanks again for the feedback!

August 2, 2007 3:58 PM

Nathan Scheffey said:

This is a great use of filters to achieve an extremely useful result. However, I think combining it with your excellent Exact Keyword Matching script really takes it to the next level.
I added another filter to append the User Defined Value (the exact keyword) after the Campaign Term. Now my transaction data shows the exact search string that led to the conversion. Very cool.
Question: is there a place to learn the syntax used in these custom filters (e.g. $A1 ($B1))? It seems pretty straightforward but I can't find any information about it in the GA Help documentation.
Anyway, thank you all for your excellent tools, they really take Google Analytics from good to great.

August 2, 2007 5:55 PM

Shawn Purtell said:

@Nathan:

I agree. If you have Michael's exact keyword tracking script installed, this is a great addition, and we actually do that ourselves.

To be honest, I don't have a specific resource for you concerning regular expression string matching variables, but there are lots of great books and websites on the subject.

August 3, 2007 8:53 AM

Neil said:

Hi Shawn.

I've tried doing this on 2 different analytics accounts, and can't get it to work.

I've copied everything word for word, but the keywords are never added. Could it be because the screenshots are of the previous version of analytics?

August 17, 2007 11:13 AM

Shawn Purtell said:

@Neil:

These filters have been tested and confirmed in the new version of Google Analytics.

I can't say for sure where your problem is occurring, but I can tell you that these filters work fine if used properly.

Is it possible you are having problems with your referring source tracking? Also, remember that keywords only show up for organic and cpc results - not for anything else (referrals, direct, banners, and other sources do not have keywords associated with them).

August 20, 2007 8:51 AM

Prince said:

Great stuff Shawn, very usefull.

Just having 1 problem, the first filter that grabs the source and medium, in the output filed you have $A1 - $B1

Thats exatly how I entered it but in my Transaction I am not getting the "source" I do get the keywords

So I get something like this:
Order27 $A (keyword)

August 21, 2007 12:01 AM

Neil said:

It works! Sort off...

Thanks for your help Shawn. I've just logged into Analytics, and it seems that the filters need to be in place for 24 hours to return anything.

Only wish I should filter on Adwords Campaigns instead of Campaigns (no option that I can see).

August 21, 2007 7:19 AM

Shawn Purtell said:

@Prince:

Looks like there's a problem with one of your filters - the third one I believe (specifically the $A1 part). Make sure there is no space between the $A and the 1. I can tell there is something wrong with your output field because '$A' is showing up in your data, and it should never do that.

August 21, 2007 9:15 AM

Shawn Purtell said:

@Neil:

Glad you got things working. And yeah, Google Analytics data generally takes 24 hours to update completely, so anytime you make a change, you need to give it time.

As to your other wish, I'm not really sure what you're asking. There are filters that can do all kinds of things. If you can be more specific, I may be able to help.

August 21, 2007 9:17 AM

Neil Munn said:

I'm accessing Analytics through my Adwords account. This means all my campaigns are listed under Adword campaigns, which isn't shown in the filters dropdown.

What I'm trying to do is, display the keyword(s) that the user types in to make their transaction eg:

Transaction ID, Source, Medium, (Keyword)

Is this possible?

August 22, 2007 5:59 AM

Shawn Purtell said:

@Neil:

The filter set I provided does this automatically, if the keyword exists. You can see in the image above that the keyword should be present for all organic and cpc (including AdWords) sources.

You should not need any additional filters to achieve this result. If you aren't seeing this data, you may not have the filters set up properly.

*Note - There is a difference between 'what the user types in' and the keyword you are bidding on.

The 'term the user typed in' is called the search term while the keyword you bid on is called the bid term. The bid term is the information you will see.

To find out how to get search term info as well, visit Michael's awesome solution here.

August 22, 2007 9:33 AM

Netmeg said:

Hello - I've been using this filter pretty much since you posted it, and it worked just fine. But I created a new profile for it, and it hasn't worked since. Could it be the new Google Analytics code? I then tried to put it back on the original profile on which I had it, and it *still* doesn't work. I haven't changed any of the code, I have the three filters in the proper order - the only thing that has changed was the Google analytics code. And actually, I'm testing that on still another profile, so I'm not entirely sure what's going on now.

January 22, 2008 11:08 AM

Netmeg said:

As an update to my previous post, I went and checked, and between and my partners, five ecommerce sites that were using this filter ALL stopped displaying the data on January 15th. How weird is that? Google must have changed something.

January 22, 2008 1:34 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

There have actually been reports of all advanced filters breaking around that same date, but many people have also stated that their filters have begun to work again. I'd check the more recent data again. In the meantime, we're conducting our own investigation concerning why advanced filters have had this little hiccup, and we'll let you know if we find anything important.

January 23, 2008 8:59 AM

Netmeg said:

As of today, 1/23/2008, none of our advanced filters are working.

Thanks in advance for anything you find out.

January 23, 2008 10:51 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

After examining some other data and situations with both custom and advanced filters, it seems this is an issue many people are experiencing. From the Google Analytics help group to our own data, we have noticed two things:

Many custom filters seemed to stop functioning for several accounts for a brief period around Jan8th, but resumed working on the 15th. This includes custom includes and other custom filters.

Advanced filters that use custom fields, however, seems to be having more trouble, and in many cases have not worked since the 15th on January. Among these kinds of filters is the filter described in this article.

As soon as we get a good explanation as to what's been causing these errors, I'll be sure to post an update here.

January 29, 2008 10:42 AM

Steve Racicot said:

Is anyone using this advanced filters getting data? Is it working correctly?

I have had this installed for over a week and have seen no changes to my transaction list under Eccommerce -> Transactions.

Steve

February 18, 2008 11:14 AM

Jeremy Aube said:

@Steve

Any advanced filters that use custom fields have not been working since January 15th, including this one. This should be a temporary issues, but in the meantime, we have posted an article on an alternate set of filters you can use that function exactly the same as this set. You can get your filters there, and then refer to Shawn's article here for addition instruction and information.

February 18, 2008 3:55 PM

Imran Khan said:

Really informative post.
One question: Where can I find the Transaction List, the last image. I am using the old version of analytics code.

Thanks in advance

February 20, 2008 6:39 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Imran:

The Transaction list is under the Ecommerce section in Google Analytics, and will only show up if you have turned on Ecommerce in your profile settings. The exact report you're looking for is called Transactions.

As a note here, I realize these filters have not been working correctly since Jan. 15th. The filters are still correct, but there was a bug with custom fields (which these filters use) that is being resolved. Until then, feel free to look at Jeremy's update, which gets around this temporary issue.

February 20, 2008 8:57 AM

Asher said:

Have these filters every returned to working properly? I added them before reading to the bottom of the comments. I'm finding that when I view transactions I get the transaction number followed by the state.

June 9, 2008 10:49 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Asher:

These filters have been working correctly for a while now. These three filters do not affect the state of a user, so I wonder why you are seeing that information within Google Analytics. My hunch is that either there is a problem with the way you've set up the filters in your profile, or you have another filter that's using the Custom Field that's interfering with the transaction filters. Unfortunately, it's hard to tell you exactly what the problem is without seeing your filter setup.

June 9, 2008 1:15 PM

Duff said:

First of all, great post, Shawn.

I'm having a problem though.
I paid for a banner on another website. The link to my website is tagged properly:
http://www.mywebsite.com?utm_source=Other%2BWebsite&utm_medium=Banner&utm_campaign=Other%2BWebsite

I am getting some transactions through this banner but in my transaction list all I can see is:
mytransID mywebsite.com-referral (mywebsite.com)

However, of course I would like to be able to see:
mytransID Other Website-Banner ()

Do you have any idea about what did I do wrong?

July 23, 2008 5:57 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff:

It looks like you're getting what we call 'self-referrals' - meaning Google Analytics is registering visits from your own site. This actually has nothing to do with the filters, as those look like they are working.

Self-referrals can occur for many different reasons, but the three most common are:

1. Some pages on your site are missing Google Analytics code.
2. You use multiple subdomains and haven't set up the Google Analytics code for subdomains.
3. Your site has multiple main domains.

If any of these apply to you, then you've most likely found the reason for your self-referrals. If none of these apply to you, there may be another problem with your Google Analytics installation, and I'd have to actually see it in order to diagnose the problem.

July 23, 2008 8:41 AM

Duff said:

Just wanted to thank you coz it is now working properly. Indeed, I use 2 domains, one for the website and another one for payments. Again, thanks a lot!

July 24, 2008 11:28 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff: Glad I could help. Thanks for reading!

July 25, 2008 8:08 AM

Tim said:

Hi Sean - I have an old website that we are redirecting all traffic to our new site. I would like to know which specific transactions are coming from the old site. We are using 301 redirects on individual pages. I tried your examples and it is not picking up the old website as the source or medium... Do you have any advice? Thanks

August 26, 2008 3:09 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Tim: I'm pretty sure Jeremy already answered this on a different blog article, but I agree with him that the only real way to do this effectively with Google Analytics is to add a query parameter to the end of the 301 redirect and then use the Site Search report within Google Analytics to see which transactions are coming from customers who were trying to find the old site.

August 28, 2008 7:44 AM

juan cruz aliaga said:

Hi Shawn, great post!
I am arriving late to this one, but I can see how useful could it be to avoid double counting on orders/transactions.
I was just wondering if the associated keywords would be the last ones used on any campaing source and medium. If so, and to keep track of visitors previous visits to purchase, couldn't we also grab the visitor ID (with a new filter) and appends it to the rest of the info??

Rgds,

jc

February 17, 2009 4:25 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Juan:

Just like with normal Google Analytics tracking, the keyword/source/medium reported with the transaction will be the most recent. Also, in regards to your question about visitor ID - that depends on where the ID is stored. There is no built-in visitor ID filter field in Google Analytics for this, but you could send the data from your database to Google Analytics with each transaction using the ecommerce code. If you do this, you'll probably want to read over the Google Analytics Terms of Service just to make sure the information you're passing isn't considered personally identifiable.

February 17, 2009 8:19 AM

liz rz said:

Hi, this is a great filter, but was wondering how i could modify it to show me the transaction date which is a sortable list so i can see which are the most recent orders...with the existing filter i can only sort by revenue, tax, shipping, quantity. I know i can choose date range for the same info, but a sort would be easier. Thanks, this very useful info.

February 19, 2009 10:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

Probably the easiest way to do this is to use Andre Scholten's Table Sorter add-on for Google Analytics (the site is in Dutch). This is also included in the Better Google Analytics Firefox addon from VKI Studios.

February 19, 2009 10:42 AM

liz rz said:

I've added the filters above and now I'd like to export the data to be able to sort the data into a spreadsheet. There is no seperator between the data fields so I can't seperate the referring source and the keyword. Any ideas?

April 20, 2009 10:32 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

It's a little advanced, but you could run a macro on the spreadsheet that splits up the data for you. That's really the only way that I can see doing this quickly. Moving forward, you could modify the filters so that they contain a separator.

April 20, 2009 11:24 AM

liz rz said:

Thanks Shawn! Can you tell me how to add the data separator to the filters, or point toward a resource where I can learn? This is very helpful! Thanks.

April 24, 2009 8:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

In the filters above, you can modify the Output field at the very bottom of each filter to add your own separators. In my example, I use a dash in filter one, parentheses in filter two, and just a space in filter three. You could easily modify these fields to use a different separator (like a comma) that's easier for you.

April 24, 2009 8:46 AM

mp said:

Thank you for great post. We are using Google Analytic about one year. This solution going to change new transactions. Is there is any way to run it on existing data? I'm just wonder is it possible to achieve the same results with advanced reports?
Thank you for your time.

August 6, 2009 1:06 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You could also use the Secondary Segment dropdown in the Transactions report to some extent. With Jeremy's Google Analytics Report Enhancer, you can segment by source/medium. You could use Advanced Segments to look at a specific medium (cpc for example), and then use the Secondary Segment to look at keyword.

I don't think there's a simple way to do all of this in one step, but the information is there, you just may have to dig for it a little.

August 6, 2009 8:12 AM

mp said:

Hello,

I'm trying to add product name to report and result will be like:
tranID | source | medium | keyword | item_name1 item_name2
I'm using the same filters as use I just added new filter that concatenate item name custom_field.
Trans List Mod 1 \x96 same Trans List Mod 1 - separator |
Trans List Mod 2 - same Trans List Mod 2 \x96 separator |
Trans List Mod 3 - add item name to custom field
Field A -> Extract A Custom Field 1 (.*)
Field B -> Extract B E-commerce Item Name (.*)
Output To -> Constructor Custom Field 1 $A1 | $B1
Field A Required Yes
Field B Required Yes/No tried both
Override Output Field Yes
Case Sensitive No
Trans List Mod 4 - same as Trans List Mod 3. \x96 separator |
As a result I'm getting douplicate rows one with item name and another without. Could you please point me the right direction?
Thank you for your time.

August 28, 2009 7:04 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You're going to run into several issues when using any filter that looks at both transactions and products at the same time. The primary issue here is that a single transaction can be associated with more than one product, which means that Google Analytics stores these pieces of data separately within the original database (and maybe even within different databases).

The easiest way to get the product information for a specific transaction is to just click on the ID. You'll then see a list of products in the transaction.

You may also have some success with an opposite approach, although I haven't tried this yet - try adding the transaction ID and source, etc. to the product name (sort of the reverse of what you're doing). As a caution, I would try this in a separate test profile, but it should give you the same kind of report that you were looking for. Hope that helps!

September 1, 2009 10:10 AM

Anagha said:

How can I append the exact search term also to the end of this PPC keyword so I can see which keyword triggered the transaction. What filter should I use

December 14, 2009 2:00 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

Google Analytics does not currently capture the exact search term, so you would have to use a workaround like the one mentioned in this article. Then you would have to modify the filter to include the User Defined variable or whichever field you are using to store the exact search query.

December 14, 2009 9:21 AM

Anagha said:

Thank You for your prompt reply. I wanted to do this using filters and not scripts since I dont have access to the Clients page. So I tried using the filters shown on this page in addition to the filters from http://www.semvironment.com/ppc-management-adwords-keyword-data-exposed-with-google-analytics/.
I applied exact query filters first (referral etc) stored in custom field 2, then applied the filters on this page and appended the custom field 2 to it. But it didnt show the exact keywords for transactions. Am I doing something wrong. Can this be done. Please help

December 14, 2009 8:22 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

I've found those keyword filters from semvironment to not work properly - and also to break conversion and transaction tracking data within the reports. It's actually what prompted us to create the custom script in the first place.

Currently, the only method I've seen to do what you need is to use the custom scripts. This will only change if Google makes the Exact Search Query available within the Google Analytics fields.

December 15, 2009 9:03 AM

Jordan Glogau said:

Shawn:

Its been some time since your described your three filter technique. Do you still think this is the best path to match specific transactions to particular channels?

Do you know anyone that's tried to reconciled this methods with their accounting data. This is something that you can do with Coremetrics?

BTW, I saw you method in Biran Clifton's book and the most important piece of advice he left out, set up a different profile since this stuff can break your data.

Thank you for this helpful post.

August 27, 2011 4:08 PM

Chris said:

Hi Shawn,

We've also done some work with this and also had a lot of head scratching to get the results - great post though and cleared up a couple of areas. Regards

Chris

May 3, 2007 4:56 AM

Shawn Purtell said:

@Chris:

Thanks for the nice comment. Let me know if these new filters work out for you. I've only been using them for a little while, so it would be great to get some feedback.

May 3, 2007 8:42 AM

Mikey said:

Hi Shawn,

Great post mate. Like Chris, I've been scratching my head over this & have a couple of clients that will absolutely love this. Thanks :)

Mikey

May 3, 2007 8:22 PM

Shawn Purtell said:

@Mikey:

Thanks! I hope it turns out to be as useful as I think it might. I'd love to hear feedback from you once you've used the filters with clients.

May 4, 2007 9:05 AM

Krista said:

Great Post. These advanced filters are very usefull. I took your training course on Google Analytics. I was wondering if in the future you are going to offer a whole course on advanced implementation and setup where filters like these are taught and where regular expressions could be learned?

May 17, 2007 10:31 AM

Shawn Purtell said:

@Krista:

Thanks for the compliment. The training course that you took includes the most common advanced implementation options that we've encountered (things like Paypal, cross-domain tracking, etc.). We've also included the general ideas about the types of filters you can create. We're currently revamping the course for our new training series, and it will include more about filters and how you can use them to accomplish specific tasks.

In order to get more specific than that, you really need one-on-one attention, because setting up advanced filters really depends on your site and what kinds of information you want to find. This is one example of something our support plans can do for you on an individual level. We try our best to make this information freely available through our blog.

The same sort of thing applies to regular expressions. Regular expressions can get extremely complex, so we covered the most basic/common ones that you can use in our training course. Again, the more advanced regular expressions are only needed in very specific situations that would require one on one attention.

This brings up another point: Google Analytics is like getting a suit (or dress) fitted - you need to take measurements and personal tastes into consideration when you are setting up analytics. There are some steps that are universally important, but when you start looking at your individual site, no two Google Analytics configurations will be exactly alike.

I hope you found this useful. Thanks again for posting and for taking our course!

May 17, 2007 11:13 AM

Shareen Jordan said:

Hi, Shawn.

I really enjoy reading your blog. Thanks for the information. I was wondering, in the first filter you name the constructor field 'custom field 1' and you call it the same thing in the next filter. But (I think)the second filter refers to the custom filed in the first filter. If they are both named the same thing, does the field from the 1st filter overwrite the field from the second filter? And is there any reason why you wouldn't name them differently? Would there be any benefit in naming them customer field 1 and customer field 2?

Thanks! Shareen

June 5, 2007 3:04 PM

Shawn Purtell said:

@Shareen:

Thanks for the compliments. As far as your question, I only had to use a single custom field across all three filters.

So, filter 1 puts the source and medium into custom field 1.

The second filter reads the custom field from filter 1 and adds the term to what was already there.

The final filter adds the custom field we built in the previous two filters to the transaction id.

This is why the order of these filters is so important. They will not work out of sequence (they also should be next to each other on the filter list).

I didn't use two separate custom fields (although I could have) because I really only needed one.

As far as 'naming' the filter fields, you can't do that. You are given two custom fields you can use. I didn't actually name those, I selected them from the pulldown. Thanks for reading!

June 5, 2007 3:10 PM

Will said:

Great post Shawn - this is gold.

I have a question related to this subject. What I really want to do is to take this info (source and keyword) and pass it into a contact form so that we can implement closed-loop tracking of enquiries.

Do you have any ideas on how that might be done?

Bests,
Will

June 14, 2007 4:05 AM

Shawn Purtell said:

@Will:

It can be done. There are actually two methods I know of to do this. Unfortunately, this kind of thing is too advanced for a blog comment, but feel free to contact us if you want help setting this up.

June 14, 2007 9:07 AM

Al said:

Can this be done for organic traffic ? i.e. finding the keywords that deliver conversions from non-paid natural / SEO sources ? Cheers - Al

July 30, 2007 11:31 AM

Shawn Purtell said:

@Al:

These filters will include organic keywords as well. You can check out the screenshot above for some examples of this.

Thanks for reading!

July 30, 2007 11:50 AM

Brian Hinkle said:

Shawn-

Excellent work. I've just started using GA and was annoyed that there was no built-in functionality for that sort of origin tracking in ecommerce transactions - glad to see it can be added fairly easily!

July 30, 2007 2:38 PM

Shawn Purtell said:

@Brian:

That's the whole idea - making this awesome free tool (GA) more and more useful.

Thanks for the comment!

July 30, 2007 2:50 PM

Fonts said:

I use it and get some interesting (great) results. Some transactions are direct which I assume are bookmarked traffic

#312676 (direct) - (none) ()

and other transactions are like the one below do not have a value for the keyword I suppose since it is another site sending the traffic.

#312632 some-referring-site.com - referral ()

Everything else looks killer!

Thanks.

July 31, 2007 1:48 PM

Shawn Purtell said:

@Fonts:

Thanks for the feedback! Direct sources can mean a couple different things. Usually it means a user typed your URL into the browser directly, but there are some other things that will cause this, like email visits from a program like Outlook.

And you are correct with your second point - referring sites obviously will not have any keyword data, and so the parentheses will be blank.

Thanks again for the feedback!

August 2, 2007 3:58 PM

Nathan Scheffey said:

This is a great use of filters to achieve an extremely useful result. However, I think combining it with your excellent Exact Keyword Matching script really takes it to the next level.
I added another filter to append the User Defined Value (the exact keyword) after the Campaign Term. Now my transaction data shows the exact search string that led to the conversion. Very cool.
Question: is there a place to learn the syntax used in these custom filters (e.g. $A1 ($B1))? It seems pretty straightforward but I can't find any information about it in the GA Help documentation.
Anyway, thank you all for your excellent tools, they really take Google Analytics from good to great.

August 2, 2007 5:55 PM

Shawn Purtell said:

@Nathan:

I agree. If you have Michael's exact keyword tracking script installed, this is a great addition, and we actually do that ourselves.

To be honest, I don't have a specific resource for you concerning regular expression string matching variables, but there are lots of great books and websites on the subject.

August 3, 2007 8:53 AM

Neil said:

Hi Shawn.

I've tried doing this on 2 different analytics accounts, and can't get it to work.

I've copied everything word for word, but the keywords are never added. Could it be because the screenshots are of the previous version of analytics?

August 17, 2007 11:13 AM

Shawn Purtell said:

@Neil:

These filters have been tested and confirmed in the new version of Google Analytics.

I can't say for sure where your problem is occurring, but I can tell you that these filters work fine if used properly.

Is it possible you are having problems with your referring source tracking? Also, remember that keywords only show up for organic and cpc results - not for anything else (referrals, direct, banners, and other sources do not have keywords associated with them).

August 20, 2007 8:51 AM

Prince said:

Great stuff Shawn, very usefull.

Just having 1 problem, the first filter that grabs the source and medium, in the output filed you have $A1 - $B1

Thats exatly how I entered it but in my Transaction I am not getting the "source" I do get the keywords

So I get something like this:
Order27 $A (keyword)

August 21, 2007 12:01 AM

Neil said:

It works! Sort off...

Thanks for your help Shawn. I've just logged into Analytics, and it seems that the filters need to be in place for 24 hours to return anything.

Only wish I should filter on Adwords Campaigns instead of Campaigns (no option that I can see).

August 21, 2007 7:19 AM

Shawn Purtell said:

@Prince:

Looks like there's a problem with one of your filters - the third one I believe (specifically the $A1 part). Make sure there is no space between the $A and the 1. I can tell there is something wrong with your output field because '$A' is showing up in your data, and it should never do that.

August 21, 2007 9:15 AM

Shawn Purtell said:

@Neil:

Glad you got things working. And yeah, Google Analytics data generally takes 24 hours to update completely, so anytime you make a change, you need to give it time.

As to your other wish, I'm not really sure what you're asking. There are filters that can do all kinds of things. If you can be more specific, I may be able to help.

August 21, 2007 9:17 AM

Neil Munn said:

I'm accessing Analytics through my Adwords account. This means all my campaigns are listed under Adword campaigns, which isn't shown in the filters dropdown.

What I'm trying to do is, display the keyword(s) that the user types in to make their transaction eg:

Transaction ID, Source, Medium, (Keyword)

Is this possible?

August 22, 2007 5:59 AM

Shawn Purtell said:

@Neil:

The filter set I provided does this automatically, if the keyword exists. You can see in the image above that the keyword should be present for all organic and cpc (including AdWords) sources.

You should not need any additional filters to achieve this result. If you aren't seeing this data, you may not have the filters set up properly.

*Note - There is a difference between 'what the user types in' and the keyword you are bidding on.

The 'term the user typed in' is called the search term while the keyword you bid on is called the bid term. The bid term is the information you will see.

To find out how to get search term info as well, visit Michael's awesome solution here.

August 22, 2007 9:33 AM

Netmeg said:

Hello - I've been using this filter pretty much since you posted it, and it worked just fine. But I created a new profile for it, and it hasn't worked since. Could it be the new Google Analytics code? I then tried to put it back on the original profile on which I had it, and it *still* doesn't work. I haven't changed any of the code, I have the three filters in the proper order - the only thing that has changed was the Google analytics code. And actually, I'm testing that on still another profile, so I'm not entirely sure what's going on now.

January 22, 2008 11:08 AM

Netmeg said:

As an update to my previous post, I went and checked, and between and my partners, five ecommerce sites that were using this filter ALL stopped displaying the data on January 15th. How weird is that? Google must have changed something.

January 22, 2008 1:34 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

There have actually been reports of all advanced filters breaking around that same date, but many people have also stated that their filters have begun to work again. I'd check the more recent data again. In the meantime, we're conducting our own investigation concerning why advanced filters have had this little hiccup, and we'll let you know if we find anything important.

January 23, 2008 8:59 AM

Netmeg said:

As of today, 1/23/2008, none of our advanced filters are working.

Thanks in advance for anything you find out.

January 23, 2008 10:51 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

After examining some other data and situations with both custom and advanced filters, it seems this is an issue many people are experiencing. From the Google Analytics help group to our own data, we have noticed two things:

Many custom filters seemed to stop functioning for several accounts for a brief period around Jan8th, but resumed working on the 15th. This includes custom includes and other custom filters.

Advanced filters that use custom fields, however, seems to be having more trouble, and in many cases have not worked since the 15th on January. Among these kinds of filters is the filter described in this article.

As soon as we get a good explanation as to what's been causing these errors, I'll be sure to post an update here.

January 29, 2008 10:42 AM

Steve Racicot said:

Is anyone using this advanced filters getting data? Is it working correctly?

I have had this installed for over a week and have seen no changes to my transaction list under Eccommerce -> Transactions.

Steve

February 18, 2008 11:14 AM

Jeremy Aube said:

@Steve

Any advanced filters that use custom fields have not been working since January 15th, including this one. This should be a temporary issues, but in the meantime, we have posted an article on an alternate set of filters you can use that function exactly the same as this set. You can get your filters there, and then refer to Shawn's article here for addition instruction and information.

February 18, 2008 3:55 PM

Imran Khan said:

Really informative post.
One question: Where can I find the Transaction List, the last image. I am using the old version of analytics code.

Thanks in advance

February 20, 2008 6:39 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Imran:

The Transaction list is under the Ecommerce section in Google Analytics, and will only show up if you have turned on Ecommerce in your profile settings. The exact report you're looking for is called Transactions.

As a note here, I realize these filters have not been working correctly since Jan. 15th. The filters are still correct, but there was a bug with custom fields (which these filters use) that is being resolved. Until then, feel free to look at Jeremy's update, which gets around this temporary issue.

February 20, 2008 8:57 AM

Asher said:

Have these filters every returned to working properly? I added them before reading to the bottom of the comments. I'm finding that when I view transactions I get the transaction number followed by the state.

June 9, 2008 10:49 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Asher:

These filters have been working correctly for a while now. These three filters do not affect the state of a user, so I wonder why you are seeing that information within Google Analytics. My hunch is that either there is a problem with the way you've set up the filters in your profile, or you have another filter that's using the Custom Field that's interfering with the transaction filters. Unfortunately, it's hard to tell you exactly what the problem is without seeing your filter setup.

June 9, 2008 1:15 PM

Duff said:

First of all, great post, Shawn.

I'm having a problem though.
I paid for a banner on another website. The link to my website is tagged properly:
http://www.mywebsite.com?utm_source=Other%2BWebsite&utm_medium=Banner&utm_campaign=Other%2BWebsite

I am getting some transactions through this banner but in my transaction list all I can see is:
mytransID mywebsite.com-referral (mywebsite.com)

However, of course I would like to be able to see:
mytransID Other Website-Banner ()

Do you have any idea about what did I do wrong?

July 23, 2008 5:57 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff:

It looks like you're getting what we call 'self-referrals' - meaning Google Analytics is registering visits from your own site. This actually has nothing to do with the filters, as those look like they are working.

Self-referrals can occur for many different reasons, but the three most common are:

1. Some pages on your site are missing Google Analytics code.
2. You use multiple subdomains and haven't set up the Google Analytics code for subdomains.
3. Your site has multiple main domains.

If any of these apply to you, then you've most likely found the reason for your self-referrals. If none of these apply to you, there may be another problem with your Google Analytics installation, and I'd have to actually see it in order to diagnose the problem.

July 23, 2008 8:41 AM

Duff said:

Just wanted to thank you coz it is now working properly. Indeed, I use 2 domains, one for the website and another one for payments. Again, thanks a lot!

July 24, 2008 11:28 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff: Glad I could help. Thanks for reading!

July 25, 2008 8:08 AM

Tim said:

Hi Sean - I have an old website that we are redirecting all traffic to our new site. I would like to know which specific transactions are coming from the old site. We are using 301 redirects on individual pages. I tried your examples and it is not picking up the old website as the source or medium... Do you have any advice? Thanks

August 26, 2008 3:09 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Tim: I'm pretty sure Jeremy already answered this on a different blog article, but I agree with him that the only real way to do this effectively with Google Analytics is to add a query parameter to the end of the 301 redirect and then use the Site Search report within Google Analytics to see which transactions are coming from customers who were trying to find the old site.

August 28, 2008 7:44 AM

juan cruz aliaga said:

Hi Shawn, great post!
I am arriving late to this one, but I can see how useful could it be to avoid double counting on orders/transactions.
I was just wondering if the associated keywords would be the last ones used on any campaing source and medium. If so, and to keep track of visitors previous visits to purchase, couldn't we also grab the visitor ID (with a new filter) and appends it to the rest of the info??

Rgds,

jc

February 17, 2009 4:25 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Juan:

Just like with normal Google Analytics tracking, the keyword/source/medium reported with the transaction will be the most recent. Also, in regards to your question about visitor ID - that depends on where the ID is stored. There is no built-in visitor ID filter field in Google Analytics for this, but you could send the data from your database to Google Analytics with each transaction using the ecommerce code. If you do this, you'll probably want to read over the Google Analytics Terms of Service just to make sure the information you're passing isn't considered personally identifiable.

February 17, 2009 8:19 AM

liz rz said:

Hi, this is a great filter, but was wondering how i could modify it to show me the transaction date which is a sortable list so i can see which are the most recent orders...with the existing filter i can only sort by revenue, tax, shipping, quantity. I know i can choose date range for the same info, but a sort would be easier. Thanks, this very useful info.

February 19, 2009 10:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

Probably the easiest way to do this is to use Andre Scholten's Table Sorter add-on for Google Analytics (the site is in Dutch). This is also included in the Better Google Analytics Firefox addon from VKI Studios.

February 19, 2009 10:42 AM

liz rz said:

I've added the filters above and now I'd like to export the data to be able to sort the data into a spreadsheet. There is no seperator between the data fields so I can't seperate the referring source and the keyword. Any ideas?

April 20, 2009 10:32 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

It's a little advanced, but you could run a macro on the spreadsheet that splits up the data for you. That's really the only way that I can see doing this quickly. Moving forward, you could modify the filters so that they contain a separator.

April 20, 2009 11:24 AM

liz rz said:

Thanks Shawn! Can you tell me how to add the data separator to the filters, or point toward a resource where I can learn? This is very helpful! Thanks.

April 24, 2009 8:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

In the filters above, you can modify the Output field at the very bottom of each filter to add your own separators. In my example, I use a dash in filter one, parentheses in filter two, and just a space in filter three. You could easily modify these fields to use a different separator (like a comma) that's easier for you.

April 24, 2009 8:46 AM

mp said:

Thank you for great post. We are using Google Analytic about one year. This solution going to change new transactions. Is there is any way to run it on existing data? I'm just wonder is it possible to achieve the same results with advanced reports?
Thank you for your time.

August 6, 2009 1:06 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You could also use the Secondary Segment dropdown in the Transactions report to some extent. With Jeremy's Google Analytics Report Enhancer, you can segment by source/medium. You could use Advanced Segments to look at a specific medium (cpc for example), and then use the Secondary Segment to look at keyword.

I don't think there's a simple way to do all of this in one step, but the information is there, you just may have to dig for it a little.

August 6, 2009 8:12 AM

mp said:

Hello,

I'm trying to add product name to report and result will be like:
tranID | source | medium | keyword | item_name1 item_name2
I'm using the same filters as use I just added new filter that concatenate item name custom_field.
Trans List Mod 1 \x96 same Trans List Mod 1 - separator |
Trans List Mod 2 - same Trans List Mod 2 \x96 separator |
Trans List Mod 3 - add item name to custom field
Field A -> Extract A Custom Field 1 (.*)
Field B -> Extract B E-commerce Item Name (.*)
Output To -> Constructor Custom Field 1 $A1 | $B1
Field A Required Yes
Field B Required Yes/No tried both
Override Output Field Yes
Case Sensitive No
Trans List Mod 4 - same as Trans List Mod 3. \x96 separator |
As a result I'm getting douplicate rows one with item name and another without. Could you please point me the right direction?
Thank you for your time.

August 28, 2009 7:04 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You're going to run into several issues when using any filter that looks at both transactions and products at the same time. The primary issue here is that a single transaction can be associated with more than one product, which means that Google Analytics stores these pieces of data separately within the original database (and maybe even within different databases).

The easiest way to get the product information for a specific transaction is to just click on the ID. You'll then see a list of products in the transaction.

You may also have some success with an opposite approach, although I haven't tried this yet - try adding the transaction ID and source, etc. to the product name (sort of the reverse of what you're doing). As a caution, I would try this in a separate test profile, but it should give you the same kind of report that you were looking for. Hope that helps!

September 1, 2009 10:10 AM

Anagha said:

How can I append the exact search term also to the end of this PPC keyword so I can see which keyword triggered the transaction. What filter should I use

December 14, 2009 2:00 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

Google Analytics does not currently capture the exact search term, so you would have to use a workaround like the one mentioned in this article. Then you would have to modify the filter to include the User Defined variable or whichever field you are using to store the exact search query.

December 14, 2009 9:21 AM

Anagha said:

Thank You for your prompt reply. I wanted to do this using filters and not scripts since I dont have access to the Clients page. So I tried using the filters shown on this page in addition to the filters from http://www.semvironment.com/ppc-management-adwords-keyword-data-exposed-with-google-analytics/.
I applied exact query filters first (referral etc) stored in custom field 2, then applied the filters on this page and appended the custom field 2 to it. But it didnt show the exact keywords for transactions. Am I doing something wrong. Can this be done. Please help

December 14, 2009 8:22 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

I've found those keyword filters from semvironment to not work properly - and also to break conversion and transaction tracking data within the reports. It's actually what prompted us to create the custom script in the first place.

Currently, the only method I've seen to do what you need is to use the custom scripts. This will only change if Google makes the Exact Search Query available within the Google Analytics fields.

December 15, 2009 9:03 AM

Jordan Glogau said:

Shawn:

Its been some time since your described your three filter technique. Do you still think this is the best path to match specific transactions to particular channels?

Do you know anyone that's tried to reconciled this methods with their accounting data. This is something that you can do with Coremetrics?

BTW, I saw you method in Biran Clifton's book and the most important piece of advice he left out, set up a different profile since this stuff can break your data.

Thank you for this helpful post.

August 27, 2011 4:08 PM

Chris said:

Hi Shawn,

We've also done some work with this and also had a lot of head scratching to get the results - great post though and cleared up a couple of areas. Regards

Chris

May 3, 2007 4:56 AM

Shawn Purtell said:

@Chris:

Thanks for the nice comment. Let me know if these new filters work out for you. I've only been using them for a little while, so it would be great to get some feedback.

May 3, 2007 8:42 AM

Mikey said:

Hi Shawn,

Great post mate. Like Chris, I've been scratching my head over this & have a couple of clients that will absolutely love this. Thanks :)

Mikey

May 3, 2007 8:22 PM

Shawn Purtell said:

@Mikey:

Thanks! I hope it turns out to be as useful as I think it might. I'd love to hear feedback from you once you've used the filters with clients.

May 4, 2007 9:05 AM

Krista said:

Great Post. These advanced filters are very usefull. I took your training course on Google Analytics. I was wondering if in the future you are going to offer a whole course on advanced implementation and setup where filters like these are taught and where regular expressions could be learned?

May 17, 2007 10:31 AM

Shawn Purtell said:

@Krista:

Thanks for the compliment. The training course that you took includes the most common advanced implementation options that we've encountered (things like Paypal, cross-domain tracking, etc.). We've also included the general ideas about the types of filters you can create. We're currently revamping the course for our new training series, and it will include more about filters and how you can use them to accomplish specific tasks.

In order to get more specific than that, you really need one-on-one attention, because setting up advanced filters really depends on your site and what kinds of information you want to find. This is one example of something our support plans can do for you on an individual level. We try our best to make this information freely available through our blog.

The same sort of thing applies to regular expressions. Regular expressions can get extremely complex, so we covered the most basic/common ones that you can use in our training course. Again, the more advanced regular expressions are only needed in very specific situations that would require one on one attention.

This brings up another point: Google Analytics is like getting a suit (or dress) fitted - you need to take measurements and personal tastes into consideration when you are setting up analytics. There are some steps that are universally important, but when you start looking at your individual site, no two Google Analytics configurations will be exactly alike.

I hope you found this useful. Thanks again for posting and for taking our course!

May 17, 2007 11:13 AM

Shareen Jordan said:

Hi, Shawn.

I really enjoy reading your blog. Thanks for the information. I was wondering, in the first filter you name the constructor field 'custom field 1' and you call it the same thing in the next filter. But (I think)the second filter refers to the custom filed in the first filter. If they are both named the same thing, does the field from the 1st filter overwrite the field from the second filter? And is there any reason why you wouldn't name them differently? Would there be any benefit in naming them customer field 1 and customer field 2?

Thanks! Shareen

June 5, 2007 3:04 PM

Shawn Purtell said:

@Shareen:

Thanks for the compliments. As far as your question, I only had to use a single custom field across all three filters.

So, filter 1 puts the source and medium into custom field 1.

The second filter reads the custom field from filter 1 and adds the term to what was already there.

The final filter adds the custom field we built in the previous two filters to the transaction id.

This is why the order of these filters is so important. They will not work out of sequence (they also should be next to each other on the filter list).

I didn't use two separate custom fields (although I could have) because I really only needed one.

As far as 'naming' the filter fields, you can't do that. You are given two custom fields you can use. I didn't actually name those, I selected them from the pulldown. Thanks for reading!

June 5, 2007 3:10 PM

Will said:

Great post Shawn - this is gold.

I have a question related to this subject. What I really want to do is to take this info (source and keyword) and pass it into a contact form so that we can implement closed-loop tracking of enquiries.

Do you have any ideas on how that might be done?

Bests,
Will

June 14, 2007 4:05 AM

Shawn Purtell said:

@Will:

It can be done. There are actually two methods I know of to do this. Unfortunately, this kind of thing is too advanced for a blog comment, but feel free to contact us if you want help setting this up.

June 14, 2007 9:07 AM

Al said:

Can this be done for organic traffic ? i.e. finding the keywords that deliver conversions from non-paid natural / SEO sources ? Cheers - Al

July 30, 2007 11:31 AM

Shawn Purtell said:

@Al:

These filters will include organic keywords as well. You can check out the screenshot above for some examples of this.

Thanks for reading!

July 30, 2007 11:50 AM

Brian Hinkle said:

Shawn-

Excellent work. I've just started using GA and was annoyed that there was no built-in functionality for that sort of origin tracking in ecommerce transactions - glad to see it can be added fairly easily!

July 30, 2007 2:38 PM

Shawn Purtell said:

@Brian:

That's the whole idea - making this awesome free tool (GA) more and more useful.

Thanks for the comment!

July 30, 2007 2:50 PM

Fonts said:

I use it and get some interesting (great) results. Some transactions are direct which I assume are bookmarked traffic

#312676 (direct) - (none) ()

and other transactions are like the one below do not have a value for the keyword I suppose since it is another site sending the traffic.

#312632 some-referring-site.com - referral ()

Everything else looks killer!

Thanks.

July 31, 2007 1:48 PM

Shawn Purtell said:

@Fonts:

Thanks for the feedback! Direct sources can mean a couple different things. Usually it means a user typed your URL into the browser directly, but there are some other things that will cause this, like email visits from a program like Outlook.

And you are correct with your second point - referring sites obviously will not have any keyword data, and so the parentheses will be blank.

Thanks again for the feedback!

August 2, 2007 3:58 PM

Nathan Scheffey said:

This is a great use of filters to achieve an extremely useful result. However, I think combining it with your excellent Exact Keyword Matching script really takes it to the next level.
I added another filter to append the User Defined Value (the exact keyword) after the Campaign Term. Now my transaction data shows the exact search string that led to the conversion. Very cool.
Question: is there a place to learn the syntax used in these custom filters (e.g. $A1 ($B1))? It seems pretty straightforward but I can't find any information about it in the GA Help documentation.
Anyway, thank you all for your excellent tools, they really take Google Analytics from good to great.

August 2, 2007 5:55 PM

Shawn Purtell said:

@Nathan:

I agree. If you have Michael's exact keyword tracking script installed, this is a great addition, and we actually do that ourselves.

To be honest, I don't have a specific resource for you concerning regular expression string matching variables, but there are lots of great books and websites on the subject.

August 3, 2007 8:53 AM

Neil said:

Hi Shawn.

I've tried doing this on 2 different analytics accounts, and can't get it to work.

I've copied everything word for word, but the keywords are never added. Could it be because the screenshots are of the previous version of analytics?

August 17, 2007 11:13 AM

Shawn Purtell said:

@Neil:

These filters have been tested and confirmed in the new version of Google Analytics.

I can't say for sure where your problem is occurring, but I can tell you that these filters work fine if used properly.

Is it possible you are having problems with your referring source tracking? Also, remember that keywords only show up for organic and cpc results - not for anything else (referrals, direct, banners, and other sources do not have keywords associated with them).

August 20, 2007 8:51 AM

Prince said:

Great stuff Shawn, very usefull.

Just having 1 problem, the first filter that grabs the source and medium, in the output filed you have $A1 - $B1

Thats exatly how I entered it but in my Transaction I am not getting the "source" I do get the keywords

So I get something like this:
Order27 $A (keyword)

August 21, 2007 12:01 AM

Neil said:

It works! Sort off...

Thanks for your help Shawn. I've just logged into Analytics, and it seems that the filters need to be in place for 24 hours to return anything.

Only wish I should filter on Adwords Campaigns instead of Campaigns (no option that I can see).

August 21, 2007 7:19 AM

Shawn Purtell said:

@Prince:

Looks like there's a problem with one of your filters - the third one I believe (specifically the $A1 part). Make sure there is no space between the $A and the 1. I can tell there is something wrong with your output field because '$A' is showing up in your data, and it should never do that.

August 21, 2007 9:15 AM

Shawn Purtell said:

@Neil:

Glad you got things working. And yeah, Google Analytics data generally takes 24 hours to update completely, so anytime you make a change, you need to give it time.

As to your other wish, I'm not really sure what you're asking. There are filters that can do all kinds of things. If you can be more specific, I may be able to help.

August 21, 2007 9:17 AM

Neil Munn said:

I'm accessing Analytics through my Adwords account. This means all my campaigns are listed under Adword campaigns, which isn't shown in the filters dropdown.

What I'm trying to do is, display the keyword(s) that the user types in to make their transaction eg:

Transaction ID, Source, Medium, (Keyword)

Is this possible?

August 22, 2007 5:59 AM

Shawn Purtell said:

@Neil:

The filter set I provided does this automatically, if the keyword exists. You can see in the image above that the keyword should be present for all organic and cpc (including AdWords) sources.

You should not need any additional filters to achieve this result. If you aren't seeing this data, you may not have the filters set up properly.

*Note - There is a difference between 'what the user types in' and the keyword you are bidding on.

The 'term the user typed in' is called the search term while the keyword you bid on is called the bid term. The bid term is the information you will see.

To find out how to get search term info as well, visit Michael's awesome solution here.

August 22, 2007 9:33 AM

Netmeg said:

Hello - I've been using this filter pretty much since you posted it, and it worked just fine. But I created a new profile for it, and it hasn't worked since. Could it be the new Google Analytics code? I then tried to put it back on the original profile on which I had it, and it *still* doesn't work. I haven't changed any of the code, I have the three filters in the proper order - the only thing that has changed was the Google analytics code. And actually, I'm testing that on still another profile, so I'm not entirely sure what's going on now.

January 22, 2008 11:08 AM

Netmeg said:

As an update to my previous post, I went and checked, and between and my partners, five ecommerce sites that were using this filter ALL stopped displaying the data on January 15th. How weird is that? Google must have changed something.

January 22, 2008 1:34 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

There have actually been reports of all advanced filters breaking around that same date, but many people have also stated that their filters have begun to work again. I'd check the more recent data again. In the meantime, we're conducting our own investigation concerning why advanced filters have had this little hiccup, and we'll let you know if we find anything important.

January 23, 2008 8:59 AM

Netmeg said:

As of today, 1/23/2008, none of our advanced filters are working.

Thanks in advance for anything you find out.

January 23, 2008 10:51 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

After examining some other data and situations with both custom and advanced filters, it seems this is an issue many people are experiencing. From the Google Analytics help group to our own data, we have noticed two things:

Many custom filters seemed to stop functioning for several accounts for a brief period around Jan8th, but resumed working on the 15th. This includes custom includes and other custom filters.

Advanced filters that use custom fields, however, seems to be having more trouble, and in many cases have not worked since the 15th on January. Among these kinds of filters is the filter described in this article.

As soon as we get a good explanation as to what's been causing these errors, I'll be sure to post an update here.

January 29, 2008 10:42 AM

Steve Racicot said:

Is anyone using this advanced filters getting data? Is it working correctly?

I have had this installed for over a week and have seen no changes to my transaction list under Eccommerce -> Transactions.

Steve

February 18, 2008 11:14 AM

Jeremy Aube said:

@Steve

Any advanced filters that use custom fields have not been working since January 15th, including this one. This should be a temporary issues, but in the meantime, we have posted an article on an alternate set of filters you can use that function exactly the same as this set. You can get your filters there, and then refer to Shawn's article here for addition instruction and information.

February 18, 2008 3:55 PM

Imran Khan said:

Really informative post.
One question: Where can I find the Transaction List, the last image. I am using the old version of analytics code.

Thanks in advance

February 20, 2008 6:39 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Imran:

The Transaction list is under the Ecommerce section in Google Analytics, and will only show up if you have turned on Ecommerce in your profile settings. The exact report you're looking for is called Transactions.

As a note here, I realize these filters have not been working correctly since Jan. 15th. The filters are still correct, but there was a bug with custom fields (which these filters use) that is being resolved. Until then, feel free to look at Jeremy's update, which gets around this temporary issue.

February 20, 2008 8:57 AM

Asher said:

Have these filters every returned to working properly? I added them before reading to the bottom of the comments. I'm finding that when I view transactions I get the transaction number followed by the state.

June 9, 2008 10:49 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Asher:

These filters have been working correctly for a while now. These three filters do not affect the state of a user, so I wonder why you are seeing that information within Google Analytics. My hunch is that either there is a problem with the way you've set up the filters in your profile, or you have another filter that's using the Custom Field that's interfering with the transaction filters. Unfortunately, it's hard to tell you exactly what the problem is without seeing your filter setup.

June 9, 2008 1:15 PM

Duff said:

First of all, great post, Shawn.

I'm having a problem though.
I paid for a banner on another website. The link to my website is tagged properly:
http://www.mywebsite.com?utm_source=Other%2BWebsite&utm_medium=Banner&utm_campaign=Other%2BWebsite

I am getting some transactions through this banner but in my transaction list all I can see is:
mytransID mywebsite.com-referral (mywebsite.com)

However, of course I would like to be able to see:
mytransID Other Website-Banner ()

Do you have any idea about what did I do wrong?

July 23, 2008 5:57 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff:

It looks like you're getting what we call 'self-referrals' - meaning Google Analytics is registering visits from your own site. This actually has nothing to do with the filters, as those look like they are working.

Self-referrals can occur for many different reasons, but the three most common are:

1. Some pages on your site are missing Google Analytics code.
2. You use multiple subdomains and haven't set up the Google Analytics code for subdomains.
3. Your site has multiple main domains.

If any of these apply to you, then you've most likely found the reason for your self-referrals. If none of these apply to you, there may be another problem with your Google Analytics installation, and I'd have to actually see it in order to diagnose the problem.

July 23, 2008 8:41 AM

Duff said:

Just wanted to thank you coz it is now working properly. Indeed, I use 2 domains, one for the website and another one for payments. Again, thanks a lot!

July 24, 2008 11:28 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff: Glad I could help. Thanks for reading!

July 25, 2008 8:08 AM

Tim said:

Hi Sean - I have an old website that we are redirecting all traffic to our new site. I would like to know which specific transactions are coming from the old site. We are using 301 redirects on individual pages. I tried your examples and it is not picking up the old website as the source or medium... Do you have any advice? Thanks

August 26, 2008 3:09 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Tim: I'm pretty sure Jeremy already answered this on a different blog article, but I agree with him that the only real way to do this effectively with Google Analytics is to add a query parameter to the end of the 301 redirect and then use the Site Search report within Google Analytics to see which transactions are coming from customers who were trying to find the old site.

August 28, 2008 7:44 AM

juan cruz aliaga said:

Hi Shawn, great post!
I am arriving late to this one, but I can see how useful could it be to avoid double counting on orders/transactions.
I was just wondering if the associated keywords would be the last ones used on any campaing source and medium. If so, and to keep track of visitors previous visits to purchase, couldn't we also grab the visitor ID (with a new filter) and appends it to the rest of the info??

Rgds,

jc

February 17, 2009 4:25 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Juan:

Just like with normal Google Analytics tracking, the keyword/source/medium reported with the transaction will be the most recent. Also, in regards to your question about visitor ID - that depends on where the ID is stored. There is no built-in visitor ID filter field in Google Analytics for this, but you could send the data from your database to Google Analytics with each transaction using the ecommerce code. If you do this, you'll probably want to read over the Google Analytics Terms of Service just to make sure the information you're passing isn't considered personally identifiable.

February 17, 2009 8:19 AM

liz rz said:

Hi, this is a great filter, but was wondering how i could modify it to show me the transaction date which is a sortable list so i can see which are the most recent orders...with the existing filter i can only sort by revenue, tax, shipping, quantity. I know i can choose date range for the same info, but a sort would be easier. Thanks, this very useful info.

February 19, 2009 10:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

Probably the easiest way to do this is to use Andre Scholten's Table Sorter add-on for Google Analytics (the site is in Dutch). This is also included in the Better Google Analytics Firefox addon from VKI Studios.

February 19, 2009 10:42 AM

liz rz said:

I've added the filters above and now I'd like to export the data to be able to sort the data into a spreadsheet. There is no seperator between the data fields so I can't seperate the referring source and the keyword. Any ideas?

April 20, 2009 10:32 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

It's a little advanced, but you could run a macro on the spreadsheet that splits up the data for you. That's really the only way that I can see doing this quickly. Moving forward, you could modify the filters so that they contain a separator.

April 20, 2009 11:24 AM

liz rz said:

Thanks Shawn! Can you tell me how to add the data separator to the filters, or point toward a resource where I can learn? This is very helpful! Thanks.

April 24, 2009 8:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

In the filters above, you can modify the Output field at the very bottom of each filter to add your own separators. In my example, I use a dash in filter one, parentheses in filter two, and just a space in filter three. You could easily modify these fields to use a different separator (like a comma) that's easier for you.

April 24, 2009 8:46 AM

mp said:

Thank you for great post. We are using Google Analytic about one year. This solution going to change new transactions. Is there is any way to run it on existing data? I'm just wonder is it possible to achieve the same results with advanced reports?
Thank you for your time.

August 6, 2009 1:06 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You could also use the Secondary Segment dropdown in the Transactions report to some extent. With Jeremy's Google Analytics Report Enhancer, you can segment by source/medium. You could use Advanced Segments to look at a specific medium (cpc for example), and then use the Secondary Segment to look at keyword.

I don't think there's a simple way to do all of this in one step, but the information is there, you just may have to dig for it a little.

August 6, 2009 8:12 AM

mp said:

Hello,

I'm trying to add product name to report and result will be like:
tranID | source | medium | keyword | item_name1 item_name2
I'm using the same filters as use I just added new filter that concatenate item name custom_field.
Trans List Mod 1 \x96 same Trans List Mod 1 - separator |
Trans List Mod 2 - same Trans List Mod 2 \x96 separator |
Trans List Mod 3 - add item name to custom field
Field A -> Extract A Custom Field 1 (.*)
Field B -> Extract B E-commerce Item Name (.*)
Output To -> Constructor Custom Field 1 $A1 | $B1
Field A Required Yes
Field B Required Yes/No tried both
Override Output Field Yes
Case Sensitive No
Trans List Mod 4 - same as Trans List Mod 3. \x96 separator |
As a result I'm getting douplicate rows one with item name and another without. Could you please point me the right direction?
Thank you for your time.

August 28, 2009 7:04 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You're going to run into several issues when using any filter that looks at both transactions and products at the same time. The primary issue here is that a single transaction can be associated with more than one product, which means that Google Analytics stores these pieces of data separately within the original database (and maybe even within different databases).

The easiest way to get the product information for a specific transaction is to just click on the ID. You'll then see a list of products in the transaction.

You may also have some success with an opposite approach, although I haven't tried this yet - try adding the transaction ID and source, etc. to the product name (sort of the reverse of what you're doing). As a caution, I would try this in a separate test profile, but it should give you the same kind of report that you were looking for. Hope that helps!

September 1, 2009 10:10 AM

Anagha said:

How can I append the exact search term also to the end of this PPC keyword so I can see which keyword triggered the transaction. What filter should I use

December 14, 2009 2:00 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

Google Analytics does not currently capture the exact search term, so you would have to use a workaround like the one mentioned in this article. Then you would have to modify the filter to include the User Defined variable or whichever field you are using to store the exact search query.

December 14, 2009 9:21 AM

Anagha said:

Thank You for your prompt reply. I wanted to do this using filters and not scripts since I dont have access to the Clients page. So I tried using the filters shown on this page in addition to the filters from http://www.semvironment.com/ppc-management-adwords-keyword-data-exposed-with-google-analytics/.
I applied exact query filters first (referral etc) stored in custom field 2, then applied the filters on this page and appended the custom field 2 to it. But it didnt show the exact keywords for transactions. Am I doing something wrong. Can this be done. Please help

December 14, 2009 8:22 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

I've found those keyword filters from semvironment to not work properly - and also to break conversion and transaction tracking data within the reports. It's actually what prompted us to create the custom script in the first place.

Currently, the only method I've seen to do what you need is to use the custom scripts. This will only change if Google makes the Exact Search Query available within the Google Analytics fields.

December 15, 2009 9:03 AM

Jordan Glogau said:

Shawn:

Its been some time since your described your three filter technique. Do you still think this is the best path to match specific transactions to particular channels?

Do you know anyone that's tried to reconciled this methods with their accounting data. This is something that you can do with Coremetrics?

BTW, I saw you method in Biran Clifton's book and the most important piece of advice he left out, set up a different profile since this stuff can break your data.

Thank you for this helpful post.

August 27, 2011 4:08 PM

Chris said:

Hi Shawn,

We've also done some work with this and also had a lot of head scratching to get the results - great post though and cleared up a couple of areas. Regards

Chris

May 3, 2007 4:56 AM

Shawn Purtell said:

@Chris:

Thanks for the nice comment. Let me know if these new filters work out for you. I've only been using them for a little while, so it would be great to get some feedback.

May 3, 2007 8:42 AM

Mikey said:

Hi Shawn,

Great post mate. Like Chris, I've been scratching my head over this & have a couple of clients that will absolutely love this. Thanks :)

Mikey

May 3, 2007 8:22 PM

Shawn Purtell said:

@Mikey:

Thanks! I hope it turns out to be as useful as I think it might. I'd love to hear feedback from you once you've used the filters with clients.

May 4, 2007 9:05 AM

Krista said:

Great Post. These advanced filters are very usefull. I took your training course on Google Analytics. I was wondering if in the future you are going to offer a whole course on advanced implementation and setup where filters like these are taught and where regular expressions could be learned?

May 17, 2007 10:31 AM

Shawn Purtell said:

@Krista:

Thanks for the compliment. The training course that you took includes the most common advanced implementation options that we've encountered (things like Paypal, cross-domain tracking, etc.). We've also included the general ideas about the types of filters you can create. We're currently revamping the course for our new training series, and it will include more about filters and how you can use them to accomplish specific tasks.

In order to get more specific than that, you really need one-on-one attention, because setting up advanced filters really depends on your site and what kinds of information you want to find. This is one example of something our support plans can do for you on an individual level. We try our best to make this information freely available through our blog.

The same sort of thing applies to regular expressions. Regular expressions can get extremely complex, so we covered the most basic/common ones that you can use in our training course. Again, the more advanced regular expressions are only needed in very specific situations that would require one on one attention.

This brings up another point: Google Analytics is like getting a suit (or dress) fitted - you need to take measurements and personal tastes into consideration when you are setting up analytics. There are some steps that are universally important, but when you start looking at your individual site, no two Google Analytics configurations will be exactly alike.

I hope you found this useful. Thanks again for posting and for taking our course!

May 17, 2007 11:13 AM

Shareen Jordan said:

Hi, Shawn.

I really enjoy reading your blog. Thanks for the information. I was wondering, in the first filter you name the constructor field 'custom field 1' and you call it the same thing in the next filter. But (I think)the second filter refers to the custom filed in the first filter. If they are both named the same thing, does the field from the 1st filter overwrite the field from the second filter? And is there any reason why you wouldn't name them differently? Would there be any benefit in naming them customer field 1 and customer field 2?

Thanks! Shareen

June 5, 2007 3:04 PM

Shawn Purtell said:

@Shareen:

Thanks for the compliments. As far as your question, I only had to use a single custom field across all three filters.

So, filter 1 puts the source and medium into custom field 1.

The second filter reads the custom field from filter 1 and adds the term to what was already there.

The final filter adds the custom field we built in the previous two filters to the transaction id.

This is why the order of these filters is so important. They will not work out of sequence (they also should be next to each other on the filter list).

I didn't use two separate custom fields (although I could have) because I really only needed one.

As far as 'naming' the filter fields, you can't do that. You are given two custom fields you can use. I didn't actually name those, I selected them from the pulldown. Thanks for reading!

June 5, 2007 3:10 PM

Will said:

Great post Shawn - this is gold.

I have a question related to this subject. What I really want to do is to take this info (source and keyword) and pass it into a contact form so that we can implement closed-loop tracking of enquiries.

Do you have any ideas on how that might be done?

Bests,
Will

June 14, 2007 4:05 AM

Shawn Purtell said:

@Will:

It can be done. There are actually two methods I know of to do this. Unfortunately, this kind of thing is too advanced for a blog comment, but feel free to contact us if you want help setting this up.

June 14, 2007 9:07 AM

Al said:

Can this be done for organic traffic ? i.e. finding the keywords that deliver conversions from non-paid natural / SEO sources ? Cheers - Al

July 30, 2007 11:31 AM

Shawn Purtell said:

@Al:

These filters will include organic keywords as well. You can check out the screenshot above for some examples of this.

Thanks for reading!

July 30, 2007 11:50 AM

Brian Hinkle said:

Shawn-

Excellent work. I've just started using GA and was annoyed that there was no built-in functionality for that sort of origin tracking in ecommerce transactions - glad to see it can be added fairly easily!

July 30, 2007 2:38 PM

Shawn Purtell said:

@Brian:

That's the whole idea - making this awesome free tool (GA) more and more useful.

Thanks for the comment!

July 30, 2007 2:50 PM

Fonts said:

I use it and get some interesting (great) results. Some transactions are direct which I assume are bookmarked traffic

#312676 (direct) - (none) ()

and other transactions are like the one below do not have a value for the keyword I suppose since it is another site sending the traffic.

#312632 some-referring-site.com - referral ()

Everything else looks killer!

Thanks.

July 31, 2007 1:48 PM

Shawn Purtell said:

@Fonts:

Thanks for the feedback! Direct sources can mean a couple different things. Usually it means a user typed your URL into the browser directly, but there are some other things that will cause this, like email visits from a program like Outlook.

And you are correct with your second point - referring sites obviously will not have any keyword data, and so the parentheses will be blank.

Thanks again for the feedback!

August 2, 2007 3:58 PM

Nathan Scheffey said:

This is a great use of filters to achieve an extremely useful result. However, I think combining it with your excellent Exact Keyword Matching script really takes it to the next level.
I added another filter to append the User Defined Value (the exact keyword) after the Campaign Term. Now my transaction data shows the exact search string that led to the conversion. Very cool.
Question: is there a place to learn the syntax used in these custom filters (e.g. $A1 ($B1))? It seems pretty straightforward but I can't find any information about it in the GA Help documentation.
Anyway, thank you all for your excellent tools, they really take Google Analytics from good to great.

August 2, 2007 5:55 PM

Shawn Purtell said:

@Nathan:

I agree. If you have Michael's exact keyword tracking script installed, this is a great addition, and we actually do that ourselves.

To be honest, I don't have a specific resource for you concerning regular expression string matching variables, but there are lots of great books and websites on the subject.

August 3, 2007 8:53 AM

Neil said:

Hi Shawn.

I've tried doing this on 2 different analytics accounts, and can't get it to work.

I've copied everything word for word, but the keywords are never added. Could it be because the screenshots are of the previous version of analytics?

August 17, 2007 11:13 AM

Shawn Purtell said:

@Neil:

These filters have been tested and confirmed in the new version of Google Analytics.

I can't say for sure where your problem is occurring, but I can tell you that these filters work fine if used properly.

Is it possible you are having problems with your referring source tracking? Also, remember that keywords only show up for organic and cpc results - not for anything else (referrals, direct, banners, and other sources do not have keywords associated with them).

August 20, 2007 8:51 AM

Prince said:

Great stuff Shawn, very usefull.

Just having 1 problem, the first filter that grabs the source and medium, in the output filed you have $A1 - $B1

Thats exatly how I entered it but in my Transaction I am not getting the "source" I do get the keywords

So I get something like this:
Order27 $A (keyword)

August 21, 2007 12:01 AM

Neil said:

It works! Sort off...

Thanks for your help Shawn. I've just logged into Analytics, and it seems that the filters need to be in place for 24 hours to return anything.

Only wish I should filter on Adwords Campaigns instead of Campaigns (no option that I can see).

August 21, 2007 7:19 AM

Shawn Purtell said:

@Prince:

Looks like there's a problem with one of your filters - the third one I believe (specifically the $A1 part). Make sure there is no space between the $A and the 1. I can tell there is something wrong with your output field because '$A' is showing up in your data, and it should never do that.

August 21, 2007 9:15 AM

Shawn Purtell said:

@Neil:

Glad you got things working. And yeah, Google Analytics data generally takes 24 hours to update completely, so anytime you make a change, you need to give it time.

As to your other wish, I'm not really sure what you're asking. There are filters that can do all kinds of things. If you can be more specific, I may be able to help.

August 21, 2007 9:17 AM

Neil Munn said:

I'm accessing Analytics through my Adwords account. This means all my campaigns are listed under Adword campaigns, which isn't shown in the filters dropdown.

What I'm trying to do is, display the keyword(s) that the user types in to make their transaction eg:

Transaction ID, Source, Medium, (Keyword)

Is this possible?

August 22, 2007 5:59 AM

Shawn Purtell said:

@Neil:

The filter set I provided does this automatically, if the keyword exists. You can see in the image above that the keyword should be present for all organic and cpc (including AdWords) sources.

You should not need any additional filters to achieve this result. If you aren't seeing this data, you may not have the filters set up properly.

*Note - There is a difference between 'what the user types in' and the keyword you are bidding on.

The 'term the user typed in' is called the search term while the keyword you bid on is called the bid term. The bid term is the information you will see.

To find out how to get search term info as well, visit Michael's awesome solution here.

August 22, 2007 9:33 AM

Netmeg said:

Hello - I've been using this filter pretty much since you posted it, and it worked just fine. But I created a new profile for it, and it hasn't worked since. Could it be the new Google Analytics code? I then tried to put it back on the original profile on which I had it, and it *still* doesn't work. I haven't changed any of the code, I have the three filters in the proper order - the only thing that has changed was the Google analytics code. And actually, I'm testing that on still another profile, so I'm not entirely sure what's going on now.

January 22, 2008 11:08 AM

Netmeg said:

As an update to my previous post, I went and checked, and between and my partners, five ecommerce sites that were using this filter ALL stopped displaying the data on January 15th. How weird is that? Google must have changed something.

January 22, 2008 1:34 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

There have actually been reports of all advanced filters breaking around that same date, but many people have also stated that their filters have begun to work again. I'd check the more recent data again. In the meantime, we're conducting our own investigation concerning why advanced filters have had this little hiccup, and we'll let you know if we find anything important.

January 23, 2008 8:59 AM

Netmeg said:

As of today, 1/23/2008, none of our advanced filters are working.

Thanks in advance for anything you find out.

January 23, 2008 10:51 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

After examining some other data and situations with both custom and advanced filters, it seems this is an issue many people are experiencing. From the Google Analytics help group to our own data, we have noticed two things:

Many custom filters seemed to stop functioning for several accounts for a brief period around Jan8th, but resumed working on the 15th. This includes custom includes and other custom filters.

Advanced filters that use custom fields, however, seems to be having more trouble, and in many cases have not worked since the 15th on January. Among these kinds of filters is the filter described in this article.

As soon as we get a good explanation as to what's been causing these errors, I'll be sure to post an update here.

January 29, 2008 10:42 AM

Steve Racicot said:

Is anyone using this advanced filters getting data? Is it working correctly?

I have had this installed for over a week and have seen no changes to my transaction list under Eccommerce -> Transactions.

Steve

February 18, 2008 11:14 AM

Jeremy Aube said:

@Steve

Any advanced filters that use custom fields have not been working since January 15th, including this one. This should be a temporary issues, but in the meantime, we have posted an article on an alternate set of filters you can use that function exactly the same as this set. You can get your filters there, and then refer to Shawn's article here for addition instruction and information.

February 18, 2008 3:55 PM

Imran Khan said:

Really informative post.
One question: Where can I find the Transaction List, the last image. I am using the old version of analytics code.

Thanks in advance

February 20, 2008 6:39 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Imran:

The Transaction list is under the Ecommerce section in Google Analytics, and will only show up if you have turned on Ecommerce in your profile settings. The exact report you're looking for is called Transactions.

As a note here, I realize these filters have not been working correctly since Jan. 15th. The filters are still correct, but there was a bug with custom fields (which these filters use) that is being resolved. Until then, feel free to look at Jeremy's update, which gets around this temporary issue.

February 20, 2008 8:57 AM

Asher said:

Have these filters every returned to working properly? I added them before reading to the bottom of the comments. I'm finding that when I view transactions I get the transaction number followed by the state.

June 9, 2008 10:49 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Asher:

These filters have been working correctly for a while now. These three filters do not affect the state of a user, so I wonder why you are seeing that information within Google Analytics. My hunch is that either there is a problem with the way you've set up the filters in your profile, or you have another filter that's using the Custom Field that's interfering with the transaction filters. Unfortunately, it's hard to tell you exactly what the problem is without seeing your filter setup.

June 9, 2008 1:15 PM

Duff said:

First of all, great post, Shawn.

I'm having a problem though.
I paid for a banner on another website. The link to my website is tagged properly:
http://www.mywebsite.com?utm_source=Other%2BWebsite&utm_medium=Banner&utm_campaign=Other%2BWebsite

I am getting some transactions through this banner but in my transaction list all I can see is:
mytransID mywebsite.com-referral (mywebsite.com)

However, of course I would like to be able to see:
mytransID Other Website-Banner ()

Do you have any idea about what did I do wrong?

July 23, 2008 5:57 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff:

It looks like you're getting what we call 'self-referrals' - meaning Google Analytics is registering visits from your own site. This actually has nothing to do with the filters, as those look like they are working.

Self-referrals can occur for many different reasons, but the three most common are:

1. Some pages on your site are missing Google Analytics code.
2. You use multiple subdomains and haven't set up the Google Analytics code for subdomains.
3. Your site has multiple main domains.

If any of these apply to you, then you've most likely found the reason for your self-referrals. If none of these apply to you, there may be another problem with your Google Analytics installation, and I'd have to actually see it in order to diagnose the problem.

July 23, 2008 8:41 AM

Duff said:

Just wanted to thank you coz it is now working properly. Indeed, I use 2 domains, one for the website and another one for payments. Again, thanks a lot!

July 24, 2008 11:28 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff: Glad I could help. Thanks for reading!

July 25, 2008 8:08 AM

Tim said:

Hi Sean - I have an old website that we are redirecting all traffic to our new site. I would like to know which specific transactions are coming from the old site. We are using 301 redirects on individual pages. I tried your examples and it is not picking up the old website as the source or medium... Do you have any advice? Thanks

August 26, 2008 3:09 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Tim: I'm pretty sure Jeremy already answered this on a different blog article, but I agree with him that the only real way to do this effectively with Google Analytics is to add a query parameter to the end of the 301 redirect and then use the Site Search report within Google Analytics to see which transactions are coming from customers who were trying to find the old site.

August 28, 2008 7:44 AM

juan cruz aliaga said:

Hi Shawn, great post!
I am arriving late to this one, but I can see how useful could it be to avoid double counting on orders/transactions.
I was just wondering if the associated keywords would be the last ones used on any campaing source and medium. If so, and to keep track of visitors previous visits to purchase, couldn't we also grab the visitor ID (with a new filter) and appends it to the rest of the info??

Rgds,

jc

February 17, 2009 4:25 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Juan:

Just like with normal Google Analytics tracking, the keyword/source/medium reported with the transaction will be the most recent. Also, in regards to your question about visitor ID - that depends on where the ID is stored. There is no built-in visitor ID filter field in Google Analytics for this, but you could send the data from your database to Google Analytics with each transaction using the ecommerce code. If you do this, you'll probably want to read over the Google Analytics Terms of Service just to make sure the information you're passing isn't considered personally identifiable.

February 17, 2009 8:19 AM

liz rz said:

Hi, this is a great filter, but was wondering how i could modify it to show me the transaction date which is a sortable list so i can see which are the most recent orders...with the existing filter i can only sort by revenue, tax, shipping, quantity. I know i can choose date range for the same info, but a sort would be easier. Thanks, this very useful info.

February 19, 2009 10:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

Probably the easiest way to do this is to use Andre Scholten's Table Sorter add-on for Google Analytics (the site is in Dutch). This is also included in the Better Google Analytics Firefox addon from VKI Studios.

February 19, 2009 10:42 AM

liz rz said:

I've added the filters above and now I'd like to export the data to be able to sort the data into a spreadsheet. There is no seperator between the data fields so I can't seperate the referring source and the keyword. Any ideas?

April 20, 2009 10:32 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

It's a little advanced, but you could run a macro on the spreadsheet that splits up the data for you. That's really the only way that I can see doing this quickly. Moving forward, you could modify the filters so that they contain a separator.

April 20, 2009 11:24 AM

liz rz said:

Thanks Shawn! Can you tell me how to add the data separator to the filters, or point toward a resource where I can learn? This is very helpful! Thanks.

April 24, 2009 8:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

In the filters above, you can modify the Output field at the very bottom of each filter to add your own separators. In my example, I use a dash in filter one, parentheses in filter two, and just a space in filter three. You could easily modify these fields to use a different separator (like a comma) that's easier for you.

April 24, 2009 8:46 AM

mp said:

Thank you for great post. We are using Google Analytic about one year. This solution going to change new transactions. Is there is any way to run it on existing data? I'm just wonder is it possible to achieve the same results with advanced reports?
Thank you for your time.

August 6, 2009 1:06 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You could also use the Secondary Segment dropdown in the Transactions report to some extent. With Jeremy's Google Analytics Report Enhancer, you can segment by source/medium. You could use Advanced Segments to look at a specific medium (cpc for example), and then use the Secondary Segment to look at keyword.

I don't think there's a simple way to do all of this in one step, but the information is there, you just may have to dig for it a little.

August 6, 2009 8:12 AM

mp said:

Hello,

I'm trying to add product name to report and result will be like:
tranID | source | medium | keyword | item_name1 item_name2
I'm using the same filters as use I just added new filter that concatenate item name custom_field.
Trans List Mod 1 \x96 same Trans List Mod 1 - separator |
Trans List Mod 2 - same Trans List Mod 2 \x96 separator |
Trans List Mod 3 - add item name to custom field
Field A -> Extract A Custom Field 1 (.*)
Field B -> Extract B E-commerce Item Name (.*)
Output To -> Constructor Custom Field 1 $A1 | $B1
Field A Required Yes
Field B Required Yes/No tried both
Override Output Field Yes
Case Sensitive No
Trans List Mod 4 - same as Trans List Mod 3. \x96 separator |
As a result I'm getting douplicate rows one with item name and another without. Could you please point me the right direction?
Thank you for your time.

August 28, 2009 7:04 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You're going to run into several issues when using any filter that looks at both transactions and products at the same time. The primary issue here is that a single transaction can be associated with more than one product, which means that Google Analytics stores these pieces of data separately within the original database (and maybe even within different databases).

The easiest way to get the product information for a specific transaction is to just click on the ID. You'll then see a list of products in the transaction.

You may also have some success with an opposite approach, although I haven't tried this yet - try adding the transaction ID and source, etc. to the product name (sort of the reverse of what you're doing). As a caution, I would try this in a separate test profile, but it should give you the same kind of report that you were looking for. Hope that helps!

September 1, 2009 10:10 AM

Anagha said:

How can I append the exact search term also to the end of this PPC keyword so I can see which keyword triggered the transaction. What filter should I use

December 14, 2009 2:00 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

Google Analytics does not currently capture the exact search term, so you would have to use a workaround like the one mentioned in this article. Then you would have to modify the filter to include the User Defined variable or whichever field you are using to store the exact search query.

December 14, 2009 9:21 AM

Anagha said:

Thank You for your prompt reply. I wanted to do this using filters and not scripts since I dont have access to the Clients page. So I tried using the filters shown on this page in addition to the filters from http://www.semvironment.com/ppc-management-adwords-keyword-data-exposed-with-google-analytics/.
I applied exact query filters first (referral etc) stored in custom field 2, then applied the filters on this page and appended the custom field 2 to it. But it didnt show the exact keywords for transactions. Am I doing something wrong. Can this be done. Please help

December 14, 2009 8:22 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

I've found those keyword filters from semvironment to not work properly - and also to break conversion and transaction tracking data within the reports. It's actually what prompted us to create the custom script in the first place.

Currently, the only method I've seen to do what you need is to use the custom scripts. This will only change if Google makes the Exact Search Query available within the Google Analytics fields.

December 15, 2009 9:03 AM

Jordan Glogau said:

Shawn:

Its been some time since your described your three filter technique. Do you still think this is the best path to match specific transactions to particular channels?

Do you know anyone that's tried to reconciled this methods with their accounting data. This is something that you can do with Coremetrics?

BTW, I saw you method in Biran Clifton's book and the most important piece of advice he left out, set up a different profile since this stuff can break your data.

Thank you for this helpful post.

August 27, 2011 4:08 PM

Chris said:

Hi Shawn,

We've also done some work with this and also had a lot of head scratching to get the results - great post though and cleared up a couple of areas. Regards

Chris

May 3, 2007 4:56 AM

Shawn Purtell said:

@Chris:

Thanks for the nice comment. Let me know if these new filters work out for you. I've only been using them for a little while, so it would be great to get some feedback.

May 3, 2007 8:42 AM

Mikey said:

Hi Shawn,

Great post mate. Like Chris, I've been scratching my head over this & have a couple of clients that will absolutely love this. Thanks :)

Mikey

May 3, 2007 8:22 PM

Shawn Purtell said:

@Mikey:

Thanks! I hope it turns out to be as useful as I think it might. I'd love to hear feedback from you once you've used the filters with clients.

May 4, 2007 9:05 AM

Krista said:

Great Post. These advanced filters are very usefull. I took your training course on Google Analytics. I was wondering if in the future you are going to offer a whole course on advanced implementation and setup where filters like these are taught and where regular expressions could be learned?

May 17, 2007 10:31 AM

Shawn Purtell said:

@Krista:

Thanks for the compliment. The training course that you took includes the most common advanced implementation options that we've encountered (things like Paypal, cross-domain tracking, etc.). We've also included the general ideas about the types of filters you can create. We're currently revamping the course for our new training series, and it will include more about filters and how you can use them to accomplish specific tasks.

In order to get more specific than that, you really need one-on-one attention, because setting up advanced filters really depends on your site and what kinds of information you want to find. This is one example of something our support plans can do for you on an individual level. We try our best to make this information freely available through our blog.

The same sort of thing applies to regular expressions. Regular expressions can get extremely complex, so we covered the most basic/common ones that you can use in our training course. Again, the more advanced regular expressions are only needed in very specific situations that would require one on one attention.

This brings up another point: Google Analytics is like getting a suit (or dress) fitted - you need to take measurements and personal tastes into consideration when you are setting up analytics. There are some steps that are universally important, but when you start looking at your individual site, no two Google Analytics configurations will be exactly alike.

I hope you found this useful. Thanks again for posting and for taking our course!

May 17, 2007 11:13 AM

Shareen Jordan said:

Hi, Shawn.

I really enjoy reading your blog. Thanks for the information. I was wondering, in the first filter you name the constructor field 'custom field 1' and you call it the same thing in the next filter. But (I think)the second filter refers to the custom filed in the first filter. If they are both named the same thing, does the field from the 1st filter overwrite the field from the second filter? And is there any reason why you wouldn't name them differently? Would there be any benefit in naming them customer field 1 and customer field 2?

Thanks! Shareen

June 5, 2007 3:04 PM

Shawn Purtell said:

@Shareen:

Thanks for the compliments. As far as your question, I only had to use a single custom field across all three filters.

So, filter 1 puts the source and medium into custom field 1.

The second filter reads the custom field from filter 1 and adds the term to what was already there.

The final filter adds the custom field we built in the previous two filters to the transaction id.

This is why the order of these filters is so important. They will not work out of sequence (they also should be next to each other on the filter list).

I didn't use two separate custom fields (although I could have) because I really only needed one.

As far as 'naming' the filter fields, you can't do that. You are given two custom fields you can use. I didn't actually name those, I selected them from the pulldown. Thanks for reading!

June 5, 2007 3:10 PM

Will said:

Great post Shawn - this is gold.

I have a question related to this subject. What I really want to do is to take this info (source and keyword) and pass it into a contact form so that we can implement closed-loop tracking of enquiries.

Do you have any ideas on how that might be done?

Bests,
Will

June 14, 2007 4:05 AM

Shawn Purtell said:

@Will:

It can be done. There are actually two methods I know of to do this. Unfortunately, this kind of thing is too advanced for a blog comment, but feel free to contact us if you want help setting this up.

June 14, 2007 9:07 AM

Al said:

Can this be done for organic traffic ? i.e. finding the keywords that deliver conversions from non-paid natural / SEO sources ? Cheers - Al

July 30, 2007 11:31 AM

Shawn Purtell said:

@Al:

These filters will include organic keywords as well. You can check out the screenshot above for some examples of this.

Thanks for reading!

July 30, 2007 11:50 AM

Brian Hinkle said:

Shawn-

Excellent work. I've just started using GA and was annoyed that there was no built-in functionality for that sort of origin tracking in ecommerce transactions - glad to see it can be added fairly easily!

July 30, 2007 2:38 PM

Shawn Purtell said:

@Brian:

That's the whole idea - making this awesome free tool (GA) more and more useful.

Thanks for the comment!

July 30, 2007 2:50 PM

Fonts said:

I use it and get some interesting (great) results. Some transactions are direct which I assume are bookmarked traffic

#312676 (direct) - (none) ()

and other transactions are like the one below do not have a value for the keyword I suppose since it is another site sending the traffic.

#312632 some-referring-site.com - referral ()

Everything else looks killer!

Thanks.

July 31, 2007 1:48 PM

Shawn Purtell said:

@Fonts:

Thanks for the feedback! Direct sources can mean a couple different things. Usually it means a user typed your URL into the browser directly, but there are some other things that will cause this, like email visits from a program like Outlook.

And you are correct with your second point - referring sites obviously will not have any keyword data, and so the parentheses will be blank.

Thanks again for the feedback!

August 2, 2007 3:58 PM

Nathan Scheffey said:

This is a great use of filters to achieve an extremely useful result. However, I think combining it with your excellent Exact Keyword Matching script really takes it to the next level.
I added another filter to append the User Defined Value (the exact keyword) after the Campaign Term. Now my transaction data shows the exact search string that led to the conversion. Very cool.
Question: is there a place to learn the syntax used in these custom filters (e.g. $A1 ($B1))? It seems pretty straightforward but I can't find any information about it in the GA Help documentation.
Anyway, thank you all for your excellent tools, they really take Google Analytics from good to great.

August 2, 2007 5:55 PM

Shawn Purtell said:

@Nathan:

I agree. If you have Michael's exact keyword tracking script installed, this is a great addition, and we actually do that ourselves.

To be honest, I don't have a specific resource for you concerning regular expression string matching variables, but there are lots of great books and websites on the subject.

August 3, 2007 8:53 AM

Neil said:

Hi Shawn.

I've tried doing this on 2 different analytics accounts, and can't get it to work.

I've copied everything word for word, but the keywords are never added. Could it be because the screenshots are of the previous version of analytics?

August 17, 2007 11:13 AM

Shawn Purtell said:

@Neil:

These filters have been tested and confirmed in the new version of Google Analytics.

I can't say for sure where your problem is occurring, but I can tell you that these filters work fine if used properly.

Is it possible you are having problems with your referring source tracking? Also, remember that keywords only show up for organic and cpc results - not for anything else (referrals, direct, banners, and other sources do not have keywords associated with them).

August 20, 2007 8:51 AM

Prince said:

Great stuff Shawn, very usefull.

Just having 1 problem, the first filter that grabs the source and medium, in the output filed you have $A1 - $B1

Thats exatly how I entered it but in my Transaction I am not getting the "source" I do get the keywords

So I get something like this:
Order27 $A (keyword)

August 21, 2007 12:01 AM

Neil said:

It works! Sort off...

Thanks for your help Shawn. I've just logged into Analytics, and it seems that the filters need to be in place for 24 hours to return anything.

Only wish I should filter on Adwords Campaigns instead of Campaigns (no option that I can see).

August 21, 2007 7:19 AM

Shawn Purtell said:

@Prince:

Looks like there's a problem with one of your filters - the third one I believe (specifically the $A1 part). Make sure there is no space between the $A and the 1. I can tell there is something wrong with your output field because '$A' is showing up in your data, and it should never do that.

August 21, 2007 9:15 AM

Shawn Purtell said:

@Neil:

Glad you got things working. And yeah, Google Analytics data generally takes 24 hours to update completely, so anytime you make a change, you need to give it time.

As to your other wish, I'm not really sure what you're asking. There are filters that can do all kinds of things. If you can be more specific, I may be able to help.

August 21, 2007 9:17 AM

Neil Munn said:

I'm accessing Analytics through my Adwords account. This means all my campaigns are listed under Adword campaigns, which isn't shown in the filters dropdown.

What I'm trying to do is, display the keyword(s) that the user types in to make their transaction eg:

Transaction ID, Source, Medium, (Keyword)

Is this possible?

August 22, 2007 5:59 AM

Shawn Purtell said:

@Neil:

The filter set I provided does this automatically, if the keyword exists. You can see in the image above that the keyword should be present for all organic and cpc (including AdWords) sources.

You should not need any additional filters to achieve this result. If you aren't seeing this data, you may not have the filters set up properly.

*Note - There is a difference between 'what the user types in' and the keyword you are bidding on.

The 'term the user typed in' is called the search term while the keyword you bid on is called the bid term. The bid term is the information you will see.

To find out how to get search term info as well, visit Michael's awesome solution here.

August 22, 2007 9:33 AM

Netmeg said:

Hello - I've been using this filter pretty much since you posted it, and it worked just fine. But I created a new profile for it, and it hasn't worked since. Could it be the new Google Analytics code? I then tried to put it back on the original profile on which I had it, and it *still* doesn't work. I haven't changed any of the code, I have the three filters in the proper order - the only thing that has changed was the Google analytics code. And actually, I'm testing that on still another profile, so I'm not entirely sure what's going on now.

January 22, 2008 11:08 AM

Netmeg said:

As an update to my previous post, I went and checked, and between and my partners, five ecommerce sites that were using this filter ALL stopped displaying the data on January 15th. How weird is that? Google must have changed something.

January 22, 2008 1:34 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

There have actually been reports of all advanced filters breaking around that same date, but many people have also stated that their filters have begun to work again. I'd check the more recent data again. In the meantime, we're conducting our own investigation concerning why advanced filters have had this little hiccup, and we'll let you know if we find anything important.

January 23, 2008 8:59 AM

Netmeg said:

As of today, 1/23/2008, none of our advanced filters are working.

Thanks in advance for anything you find out.

January 23, 2008 10:51 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

After examining some other data and situations with both custom and advanced filters, it seems this is an issue many people are experiencing. From the Google Analytics help group to our own data, we have noticed two things:

Many custom filters seemed to stop functioning for several accounts for a brief period around Jan8th, but resumed working on the 15th. This includes custom includes and other custom filters.

Advanced filters that use custom fields, however, seems to be having more trouble, and in many cases have not worked since the 15th on January. Among these kinds of filters is the filter described in this article.

As soon as we get a good explanation as to what's been causing these errors, I'll be sure to post an update here.

January 29, 2008 10:42 AM

Steve Racicot said:

Is anyone using this advanced filters getting data? Is it working correctly?

I have had this installed for over a week and have seen no changes to my transaction list under Eccommerce -> Transactions.

Steve

February 18, 2008 11:14 AM

Jeremy Aube said:

@Steve

Any advanced filters that use custom fields have not been working since January 15th, including this one. This should be a temporary issues, but in the meantime, we have posted an article on an alternate set of filters you can use that function exactly the same as this set. You can get your filters there, and then refer to Shawn's article here for addition instruction and information.

February 18, 2008 3:55 PM

Imran Khan said:

Really informative post.
One question: Where can I find the Transaction List, the last image. I am using the old version of analytics code.

Thanks in advance

February 20, 2008 6:39 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Imran:

The Transaction list is under the Ecommerce section in Google Analytics, and will only show up if you have turned on Ecommerce in your profile settings. The exact report you're looking for is called Transactions.

As a note here, I realize these filters have not been working correctly since Jan. 15th. The filters are still correct, but there was a bug with custom fields (which these filters use) that is being resolved. Until then, feel free to look at Jeremy's update, which gets around this temporary issue.

February 20, 2008 8:57 AM

Asher said:

Have these filters every returned to working properly? I added them before reading to the bottom of the comments. I'm finding that when I view transactions I get the transaction number followed by the state.

June 9, 2008 10:49 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Asher:

These filters have been working correctly for a while now. These three filters do not affect the state of a user, so I wonder why you are seeing that information within Google Analytics. My hunch is that either there is a problem with the way you've set up the filters in your profile, or you have another filter that's using the Custom Field that's interfering with the transaction filters. Unfortunately, it's hard to tell you exactly what the problem is without seeing your filter setup.

June 9, 2008 1:15 PM

Duff said:

First of all, great post, Shawn.

I'm having a problem though.
I paid for a banner on another website. The link to my website is tagged properly:
http://www.mywebsite.com?utm_source=Other%2BWebsite&utm_medium=Banner&utm_campaign=Other%2BWebsite

I am getting some transactions through this banner but in my transaction list all I can see is:
mytransID mywebsite.com-referral (mywebsite.com)

However, of course I would like to be able to see:
mytransID Other Website-Banner ()

Do you have any idea about what did I do wrong?

July 23, 2008 5:57 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff:

It looks like you're getting what we call 'self-referrals' - meaning Google Analytics is registering visits from your own site. This actually has nothing to do with the filters, as those look like they are working.

Self-referrals can occur for many different reasons, but the three most common are:

1. Some pages on your site are missing Google Analytics code.
2. You use multiple subdomains and haven't set up the Google Analytics code for subdomains.
3. Your site has multiple main domains.

If any of these apply to you, then you've most likely found the reason for your self-referrals. If none of these apply to you, there may be another problem with your Google Analytics installation, and I'd have to actually see it in order to diagnose the problem.

July 23, 2008 8:41 AM

Duff said:

Just wanted to thank you coz it is now working properly. Indeed, I use 2 domains, one for the website and another one for payments. Again, thanks a lot!

July 24, 2008 11:28 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff: Glad I could help. Thanks for reading!

July 25, 2008 8:08 AM

Tim said:

Hi Sean - I have an old website that we are redirecting all traffic to our new site. I would like to know which specific transactions are coming from the old site. We are using 301 redirects on individual pages. I tried your examples and it is not picking up the old website as the source or medium... Do you have any advice? Thanks

August 26, 2008 3:09 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Tim: I'm pretty sure Jeremy already answered this on a different blog article, but I agree with him that the only real way to do this effectively with Google Analytics is to add a query parameter to the end of the 301 redirect and then use the Site Search report within Google Analytics to see which transactions are coming from customers who were trying to find the old site.

August 28, 2008 7:44 AM

juan cruz aliaga said:

Hi Shawn, great post!
I am arriving late to this one, but I can see how useful could it be to avoid double counting on orders/transactions.
I was just wondering if the associated keywords would be the last ones used on any campaing source and medium. If so, and to keep track of visitors previous visits to purchase, couldn't we also grab the visitor ID (with a new filter) and appends it to the rest of the info??

Rgds,

jc

February 17, 2009 4:25 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Juan:

Just like with normal Google Analytics tracking, the keyword/source/medium reported with the transaction will be the most recent. Also, in regards to your question about visitor ID - that depends on where the ID is stored. There is no built-in visitor ID filter field in Google Analytics for this, but you could send the data from your database to Google Analytics with each transaction using the ecommerce code. If you do this, you'll probably want to read over the Google Analytics Terms of Service just to make sure the information you're passing isn't considered personally identifiable.

February 17, 2009 8:19 AM

liz rz said:

Hi, this is a great filter, but was wondering how i could modify it to show me the transaction date which is a sortable list so i can see which are the most recent orders...with the existing filter i can only sort by revenue, tax, shipping, quantity. I know i can choose date range for the same info, but a sort would be easier. Thanks, this very useful info.

February 19, 2009 10:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

Probably the easiest way to do this is to use Andre Scholten's Table Sorter add-on for Google Analytics (the site is in Dutch). This is also included in the Better Google Analytics Firefox addon from VKI Studios.

February 19, 2009 10:42 AM

liz rz said:

I've added the filters above and now I'd like to export the data to be able to sort the data into a spreadsheet. There is no seperator between the data fields so I can't seperate the referring source and the keyword. Any ideas?

April 20, 2009 10:32 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

It's a little advanced, but you could run a macro on the spreadsheet that splits up the data for you. That's really the only way that I can see doing this quickly. Moving forward, you could modify the filters so that they contain a separator.

April 20, 2009 11:24 AM

liz rz said:

Thanks Shawn! Can you tell me how to add the data separator to the filters, or point toward a resource where I can learn? This is very helpful! Thanks.

April 24, 2009 8:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

In the filters above, you can modify the Output field at the very bottom of each filter to add your own separators. In my example, I use a dash in filter one, parentheses in filter two, and just a space in filter three. You could easily modify these fields to use a different separator (like a comma) that's easier for you.

April 24, 2009 8:46 AM

mp said:

Thank you for great post. We are using Google Analytic about one year. This solution going to change new transactions. Is there is any way to run it on existing data? I'm just wonder is it possible to achieve the same results with advanced reports?
Thank you for your time.

August 6, 2009 1:06 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You could also use the Secondary Segment dropdown in the Transactions report to some extent. With Jeremy's Google Analytics Report Enhancer, you can segment by source/medium. You could use Advanced Segments to look at a specific medium (cpc for example), and then use the Secondary Segment to look at keyword.

I don't think there's a simple way to do all of this in one step, but the information is there, you just may have to dig for it a little.

August 6, 2009 8:12 AM

mp said:

Hello,

I'm trying to add product name to report and result will be like:
tranID | source | medium | keyword | item_name1 item_name2
I'm using the same filters as use I just added new filter that concatenate item name custom_field.
Trans List Mod 1 \x96 same Trans List Mod 1 - separator |
Trans List Mod 2 - same Trans List Mod 2 \x96 separator |
Trans List Mod 3 - add item name to custom field
Field A -> Extract A Custom Field 1 (.*)
Field B -> Extract B E-commerce Item Name (.*)
Output To -> Constructor Custom Field 1 $A1 | $B1
Field A Required Yes
Field B Required Yes/No tried both
Override Output Field Yes
Case Sensitive No
Trans List Mod 4 - same as Trans List Mod 3. \x96 separator |
As a result I'm getting douplicate rows one with item name and another without. Could you please point me the right direction?
Thank you for your time.

August 28, 2009 7:04 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You're going to run into several issues when using any filter that looks at both transactions and products at the same time. The primary issue here is that a single transaction can be associated with more than one product, which means that Google Analytics stores these pieces of data separately within the original database (and maybe even within different databases).

The easiest way to get the product information for a specific transaction is to just click on the ID. You'll then see a list of products in the transaction.

You may also have some success with an opposite approach, although I haven't tried this yet - try adding the transaction ID and source, etc. to the product name (sort of the reverse of what you're doing). As a caution, I would try this in a separate test profile, but it should give you the same kind of report that you were looking for. Hope that helps!

September 1, 2009 10:10 AM

Anagha said:

How can I append the exact search term also to the end of this PPC keyword so I can see which keyword triggered the transaction. What filter should I use

December 14, 2009 2:00 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

Google Analytics does not currently capture the exact search term, so you would have to use a workaround like the one mentioned in this article. Then you would have to modify the filter to include the User Defined variable or whichever field you are using to store the exact search query.

December 14, 2009 9:21 AM

Anagha said:

Thank You for your prompt reply. I wanted to do this using filters and not scripts since I dont have access to the Clients page. So I tried using the filters shown on this page in addition to the filters from http://www.semvironment.com/ppc-management-adwords-keyword-data-exposed-with-google-analytics/.
I applied exact query filters first (referral etc) stored in custom field 2, then applied the filters on this page and appended the custom field 2 to it. But it didnt show the exact keywords for transactions. Am I doing something wrong. Can this be done. Please help

December 14, 2009 8:22 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

I've found those keyword filters from semvironment to not work properly - and also to break conversion and transaction tracking data within the reports. It's actually what prompted us to create the custom script in the first place.

Currently, the only method I've seen to do what you need is to use the custom scripts. This will only change if Google makes the Exact Search Query available within the Google Analytics fields.

December 15, 2009 9:03 AM

Jordan Glogau said:

Shawn:

Its been some time since your described your three filter technique. Do you still think this is the best path to match specific transactions to particular channels?

Do you know anyone that's tried to reconciled this methods with their accounting data. This is something that you can do with Coremetrics?

BTW, I saw you method in Biran Clifton's book and the most important piece of advice he left out, set up a different profile since this stuff can break your data.

Thank you for this helpful post.

August 27, 2011 4:08 PM

Chris said:

Hi Shawn,

We've also done some work with this and also had a lot of head scratching to get the results - great post though and cleared up a couple of areas. Regards

Chris

May 3, 2007 4:56 AM

Shawn Purtell said:

@Chris:

Thanks for the nice comment. Let me know if these new filters work out for you. I've only been using them for a little while, so it would be great to get some feedback.

May 3, 2007 8:42 AM

Mikey said:

Hi Shawn,

Great post mate. Like Chris, I've been scratching my head over this & have a couple of clients that will absolutely love this. Thanks :)

Mikey

May 3, 2007 8:22 PM

Shawn Purtell said:

@Mikey:

Thanks! I hope it turns out to be as useful as I think it might. I'd love to hear feedback from you once you've used the filters with clients.

May 4, 2007 9:05 AM

Krista said:

Great Post. These advanced filters are very usefull. I took your training course on Google Analytics. I was wondering if in the future you are going to offer a whole course on advanced implementation and setup where filters like these are taught and where regular expressions could be learned?

May 17, 2007 10:31 AM

Shawn Purtell said:

@Krista:

Thanks for the compliment. The training course that you took includes the most common advanced implementation options that we've encountered (things like Paypal, cross-domain tracking, etc.). We've also included the general ideas about the types of filters you can create. We're currently revamping the course for our new training series, and it will include more about filters and how you can use them to accomplish specific tasks.

In order to get more specific than that, you really need one-on-one attention, because setting up advanced filters really depends on your site and what kinds of information you want to find. This is one example of something our support plans can do for you on an individual level. We try our best to make this information freely available through our blog.

The same sort of thing applies to regular expressions. Regular expressions can get extremely complex, so we covered the most basic/common ones that you can use in our training course. Again, the more advanced regular expressions are only needed in very specific situations that would require one on one attention.

This brings up another point: Google Analytics is like getting a suit (or dress) fitted - you need to take measurements and personal tastes into consideration when you are setting up analytics. There are some steps that are universally important, but when you start looking at your individual site, no two Google Analytics configurations will be exactly alike.

I hope you found this useful. Thanks again for posting and for taking our course!

May 17, 2007 11:13 AM

Shareen Jordan said:

Hi, Shawn.

I really enjoy reading your blog. Thanks for the information. I was wondering, in the first filter you name the constructor field 'custom field 1' and you call it the same thing in the next filter. But (I think)the second filter refers to the custom filed in the first filter. If they are both named the same thing, does the field from the 1st filter overwrite the field from the second filter? And is there any reason why you wouldn't name them differently? Would there be any benefit in naming them customer field 1 and customer field 2?

Thanks! Shareen

June 5, 2007 3:04 PM

Shawn Purtell said:

@Shareen:

Thanks for the compliments. As far as your question, I only had to use a single custom field across all three filters.

So, filter 1 puts the source and medium into custom field 1.

The second filter reads the custom field from filter 1 and adds the term to what was already there.

The final filter adds the custom field we built in the previous two filters to the transaction id.

This is why the order of these filters is so important. They will not work out of sequence (they also should be next to each other on the filter list).

I didn't use two separate custom fields (although I could have) because I really only needed one.

As far as 'naming' the filter fields, you can't do that. You are given two custom fields you can use. I didn't actually name those, I selected them from the pulldown. Thanks for reading!

June 5, 2007 3:10 PM

Will said:

Great post Shawn - this is gold.

I have a question related to this subject. What I really want to do is to take this info (source and keyword) and pass it into a contact form so that we can implement closed-loop tracking of enquiries.

Do you have any ideas on how that might be done?

Bests,
Will

June 14, 2007 4:05 AM

Shawn Purtell said:

@Will:

It can be done. There are actually two methods I know of to do this. Unfortunately, this kind of thing is too advanced for a blog comment, but feel free to contact us if you want help setting this up.

June 14, 2007 9:07 AM

Al said:

Can this be done for organic traffic ? i.e. finding the keywords that deliver conversions from non-paid natural / SEO sources ? Cheers - Al

July 30, 2007 11:31 AM

Shawn Purtell said:

@Al:

These filters will include organic keywords as well. You can check out the screenshot above for some examples of this.

Thanks for reading!

July 30, 2007 11:50 AM

Brian Hinkle said:

Shawn-

Excellent work. I've just started using GA and was annoyed that there was no built-in functionality for that sort of origin tracking in ecommerce transactions - glad to see it can be added fairly easily!

July 30, 2007 2:38 PM

Shawn Purtell said:

@Brian:

That's the whole idea - making this awesome free tool (GA) more and more useful.

Thanks for the comment!

July 30, 2007 2:50 PM

Fonts said:

I use it and get some interesting (great) results. Some transactions are direct which I assume are bookmarked traffic

#312676 (direct) - (none) ()

and other transactions are like the one below do not have a value for the keyword I suppose since it is another site sending the traffic.

#312632 some-referring-site.com - referral ()

Everything else looks killer!

Thanks.

July 31, 2007 1:48 PM

Shawn Purtell said:

@Fonts:

Thanks for the feedback! Direct sources can mean a couple different things. Usually it means a user typed your URL into the browser directly, but there are some other things that will cause this, like email visits from a program like Outlook.

And you are correct with your second point - referring sites obviously will not have any keyword data, and so the parentheses will be blank.

Thanks again for the feedback!

August 2, 2007 3:58 PM

Nathan Scheffey said:

This is a great use of filters to achieve an extremely useful result. However, I think combining it with your excellent Exact Keyword Matching script really takes it to the next level.
I added another filter to append the User Defined Value (the exact keyword) after the Campaign Term. Now my transaction data shows the exact search string that led to the conversion. Very cool.
Question: is there a place to learn the syntax used in these custom filters (e.g. $A1 ($B1))? It seems pretty straightforward but I can't find any information about it in the GA Help documentation.
Anyway, thank you all for your excellent tools, they really take Google Analytics from good to great.

August 2, 2007 5:55 PM

Shawn Purtell said:

@Nathan:

I agree. If you have Michael's exact keyword tracking script installed, this is a great addition, and we actually do that ourselves.

To be honest, I don't have a specific resource for you concerning regular expression string matching variables, but there are lots of great books and websites on the subject.

August 3, 2007 8:53 AM

Neil said:

Hi Shawn.

I've tried doing this on 2 different analytics accounts, and can't get it to work.

I've copied everything word for word, but the keywords are never added. Could it be because the screenshots are of the previous version of analytics?

August 17, 2007 11:13 AM

Shawn Purtell said:

@Neil:

These filters have been tested and confirmed in the new version of Google Analytics.

I can't say for sure where your problem is occurring, but I can tell you that these filters work fine if used properly.

Is it possible you are having problems with your referring source tracking? Also, remember that keywords only show up for organic and cpc results - not for anything else (referrals, direct, banners, and other sources do not have keywords associated with them).

August 20, 2007 8:51 AM

Prince said:

Great stuff Shawn, very usefull.

Just having 1 problem, the first filter that grabs the source and medium, in the output filed you have $A1 - $B1

Thats exatly how I entered it but in my Transaction I am not getting the "source" I do get the keywords

So I get something like this:
Order27 $A (keyword)

August 21, 2007 12:01 AM

Neil said:

It works! Sort off...

Thanks for your help Shawn. I've just logged into Analytics, and it seems that the filters need to be in place for 24 hours to return anything.

Only wish I should filter on Adwords Campaigns instead of Campaigns (no option that I can see).

August 21, 2007 7:19 AM

Shawn Purtell said:

@Prince:

Looks like there's a problem with one of your filters - the third one I believe (specifically the $A1 part). Make sure there is no space between the $A and the 1. I can tell there is something wrong with your output field because '$A' is showing up in your data, and it should never do that.

August 21, 2007 9:15 AM

Shawn Purtell said:

@Neil:

Glad you got things working. And yeah, Google Analytics data generally takes 24 hours to update completely, so anytime you make a change, you need to give it time.

As to your other wish, I'm not really sure what you're asking. There are filters that can do all kinds of things. If you can be more specific, I may be able to help.

August 21, 2007 9:17 AM

Neil Munn said:

I'm accessing Analytics through my Adwords account. This means all my campaigns are listed under Adword campaigns, which isn't shown in the filters dropdown.

What I'm trying to do is, display the keyword(s) that the user types in to make their transaction eg:

Transaction ID, Source, Medium, (Keyword)

Is this possible?

August 22, 2007 5:59 AM

Shawn Purtell said:

@Neil:

The filter set I provided does this automatically, if the keyword exists. You can see in the image above that the keyword should be present for all organic and cpc (including AdWords) sources.

You should not need any additional filters to achieve this result. If you aren't seeing this data, you may not have the filters set up properly.

*Note - There is a difference between 'what the user types in' and the keyword you are bidding on.

The 'term the user typed in' is called the search term while the keyword you bid on is called the bid term. The bid term is the information you will see.

To find out how to get search term info as well, visit Michael's awesome solution here.

August 22, 2007 9:33 AM

Netmeg said:

Hello - I've been using this filter pretty much since you posted it, and it worked just fine. But I created a new profile for it, and it hasn't worked since. Could it be the new Google Analytics code? I then tried to put it back on the original profile on which I had it, and it *still* doesn't work. I haven't changed any of the code, I have the three filters in the proper order - the only thing that has changed was the Google analytics code. And actually, I'm testing that on still another profile, so I'm not entirely sure what's going on now.

January 22, 2008 11:08 AM

Netmeg said:

As an update to my previous post, I went and checked, and between and my partners, five ecommerce sites that were using this filter ALL stopped displaying the data on January 15th. How weird is that? Google must have changed something.

January 22, 2008 1:34 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

There have actually been reports of all advanced filters breaking around that same date, but many people have also stated that their filters have begun to work again. I'd check the more recent data again. In the meantime, we're conducting our own investigation concerning why advanced filters have had this little hiccup, and we'll let you know if we find anything important.

January 23, 2008 8:59 AM

Netmeg said:

As of today, 1/23/2008, none of our advanced filters are working.

Thanks in advance for anything you find out.

January 23, 2008 10:51 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

After examining some other data and situations with both custom and advanced filters, it seems this is an issue many people are experiencing. From the Google Analytics help group to our own data, we have noticed two things:

Many custom filters seemed to stop functioning for several accounts for a brief period around Jan8th, but resumed working on the 15th. This includes custom includes and other custom filters.

Advanced filters that use custom fields, however, seems to be having more trouble, and in many cases have not worked since the 15th on January. Among these kinds of filters is the filter described in this article.

As soon as we get a good explanation as to what's been causing these errors, I'll be sure to post an update here.

January 29, 2008 10:42 AM

Steve Racicot said:

Is anyone using this advanced filters getting data? Is it working correctly?

I have had this installed for over a week and have seen no changes to my transaction list under Eccommerce -> Transactions.

Steve

February 18, 2008 11:14 AM

Jeremy Aube said:

@Steve

Any advanced filters that use custom fields have not been working since January 15th, including this one. This should be a temporary issues, but in the meantime, we have posted an article on an alternate set of filters you can use that function exactly the same as this set. You can get your filters there, and then refer to Shawn's article here for addition instruction and information.

February 18, 2008 3:55 PM

Imran Khan said:

Really informative post.
One question: Where can I find the Transaction List, the last image. I am using the old version of analytics code.

Thanks in advance

February 20, 2008 6:39 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Imran:

The Transaction list is under the Ecommerce section in Google Analytics, and will only show up if you have turned on Ecommerce in your profile settings. The exact report you're looking for is called Transactions.

As a note here, I realize these filters have not been working correctly since Jan. 15th. The filters are still correct, but there was a bug with custom fields (which these filters use) that is being resolved. Until then, feel free to look at Jeremy's update, which gets around this temporary issue.

February 20, 2008 8:57 AM

Asher said:

Have these filters every returned to working properly? I added them before reading to the bottom of the comments. I'm finding that when I view transactions I get the transaction number followed by the state.

June 9, 2008 10:49 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Asher:

These filters have been working correctly for a while now. These three filters do not affect the state of a user, so I wonder why you are seeing that information within Google Analytics. My hunch is that either there is a problem with the way you've set up the filters in your profile, or you have another filter that's using the Custom Field that's interfering with the transaction filters. Unfortunately, it's hard to tell you exactly what the problem is without seeing your filter setup.

June 9, 2008 1:15 PM

Duff said:

First of all, great post, Shawn.

I'm having a problem though.
I paid for a banner on another website. The link to my website is tagged properly:
http://www.mywebsite.com?utm_source=Other%2BWebsite&utm_medium=Banner&utm_campaign=Other%2BWebsite

I am getting some transactions through this banner but in my transaction list all I can see is:
mytransID mywebsite.com-referral (mywebsite.com)

However, of course I would like to be able to see:
mytransID Other Website-Banner ()

Do you have any idea about what did I do wrong?

July 23, 2008 5:57 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff:

It looks like you're getting what we call 'self-referrals' - meaning Google Analytics is registering visits from your own site. This actually has nothing to do with the filters, as those look like they are working.

Self-referrals can occur for many different reasons, but the three most common are:

1. Some pages on your site are missing Google Analytics code.
2. You use multiple subdomains and haven't set up the Google Analytics code for subdomains.
3. Your site has multiple main domains.

If any of these apply to you, then you've most likely found the reason for your self-referrals. If none of these apply to you, there may be another problem with your Google Analytics installation, and I'd have to actually see it in order to diagnose the problem.

July 23, 2008 8:41 AM

Duff said:

Just wanted to thank you coz it is now working properly. Indeed, I use 2 domains, one for the website and another one for payments. Again, thanks a lot!

July 24, 2008 11:28 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff: Glad I could help. Thanks for reading!

July 25, 2008 8:08 AM

Tim said:

Hi Sean - I have an old website that we are redirecting all traffic to our new site. I would like to know which specific transactions are coming from the old site. We are using 301 redirects on individual pages. I tried your examples and it is not picking up the old website as the source or medium... Do you have any advice? Thanks

August 26, 2008 3:09 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Tim: I'm pretty sure Jeremy already answered this on a different blog article, but I agree with him that the only real way to do this effectively with Google Analytics is to add a query parameter to the end of the 301 redirect and then use the Site Search report within Google Analytics to see which transactions are coming from customers who were trying to find the old site.

August 28, 2008 7:44 AM

juan cruz aliaga said:

Hi Shawn, great post!
I am arriving late to this one, but I can see how useful could it be to avoid double counting on orders/transactions.
I was just wondering if the associated keywords would be the last ones used on any campaing source and medium. If so, and to keep track of visitors previous visits to purchase, couldn't we also grab the visitor ID (with a new filter) and appends it to the rest of the info??

Rgds,

jc

February 17, 2009 4:25 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Juan:

Just like with normal Google Analytics tracking, the keyword/source/medium reported with the transaction will be the most recent. Also, in regards to your question about visitor ID - that depends on where the ID is stored. There is no built-in visitor ID filter field in Google Analytics for this, but you could send the data from your database to Google Analytics with each transaction using the ecommerce code. If you do this, you'll probably want to read over the Google Analytics Terms of Service just to make sure the information you're passing isn't considered personally identifiable.

February 17, 2009 8:19 AM

liz rz said:

Hi, this is a great filter, but was wondering how i could modify it to show me the transaction date which is a sortable list so i can see which are the most recent orders...with the existing filter i can only sort by revenue, tax, shipping, quantity. I know i can choose date range for the same info, but a sort would be easier. Thanks, this very useful info.

February 19, 2009 10:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

Probably the easiest way to do this is to use Andre Scholten's Table Sorter add-on for Google Analytics (the site is in Dutch). This is also included in the Better Google Analytics Firefox addon from VKI Studios.

February 19, 2009 10:42 AM

liz rz said:

I've added the filters above and now I'd like to export the data to be able to sort the data into a spreadsheet. There is no seperator between the data fields so I can't seperate the referring source and the keyword. Any ideas?

April 20, 2009 10:32 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

It's a little advanced, but you could run a macro on the spreadsheet that splits up the data for you. That's really the only way that I can see doing this quickly. Moving forward, you could modify the filters so that they contain a separator.

April 20, 2009 11:24 AM

liz rz said:

Thanks Shawn! Can you tell me how to add the data separator to the filters, or point toward a resource where I can learn? This is very helpful! Thanks.

April 24, 2009 8:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

In the filters above, you can modify the Output field at the very bottom of each filter to add your own separators. In my example, I use a dash in filter one, parentheses in filter two, and just a space in filter three. You could easily modify these fields to use a different separator (like a comma) that's easier for you.

April 24, 2009 8:46 AM

mp said:

Thank you for great post. We are using Google Analytic about one year. This solution going to change new transactions. Is there is any way to run it on existing data? I'm just wonder is it possible to achieve the same results with advanced reports?
Thank you for your time.

August 6, 2009 1:06 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You could also use the Secondary Segment dropdown in the Transactions report to some extent. With Jeremy's Google Analytics Report Enhancer, you can segment by source/medium. You could use Advanced Segments to look at a specific medium (cpc for example), and then use the Secondary Segment to look at keyword.

I don't think there's a simple way to do all of this in one step, but the information is there, you just may have to dig for it a little.

August 6, 2009 8:12 AM

mp said:

Hello,

I'm trying to add product name to report and result will be like:
tranID | source | medium | keyword | item_name1 item_name2
I'm using the same filters as use I just added new filter that concatenate item name custom_field.
Trans List Mod 1 \x96 same Trans List Mod 1 - separator |
Trans List Mod 2 - same Trans List Mod 2 \x96 separator |
Trans List Mod 3 - add item name to custom field
Field A -> Extract A Custom Field 1 (.*)
Field B -> Extract B E-commerce Item Name (.*)
Output To -> Constructor Custom Field 1 $A1 | $B1
Field A Required Yes
Field B Required Yes/No tried both
Override Output Field Yes
Case Sensitive No
Trans List Mod 4 - same as Trans List Mod 3. \x96 separator |
As a result I'm getting douplicate rows one with item name and another without. Could you please point me the right direction?
Thank you for your time.

August 28, 2009 7:04 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You're going to run into several issues when using any filter that looks at both transactions and products at the same time. The primary issue here is that a single transaction can be associated with more than one product, which means that Google Analytics stores these pieces of data separately within the original database (and maybe even within different databases).

The easiest way to get the product information for a specific transaction is to just click on the ID. You'll then see a list of products in the transaction.

You may also have some success with an opposite approach, although I haven't tried this yet - try adding the transaction ID and source, etc. to the product name (sort of the reverse of what you're doing). As a caution, I would try this in a separate test profile, but it should give you the same kind of report that you were looking for. Hope that helps!

September 1, 2009 10:10 AM

Anagha said:

How can I append the exact search term also to the end of this PPC keyword so I can see which keyword triggered the transaction. What filter should I use

December 14, 2009 2:00 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

Google Analytics does not currently capture the exact search term, so you would have to use a workaround like the one mentioned in this article. Then you would have to modify the filter to include the User Defined variable or whichever field you are using to store the exact search query.

December 14, 2009 9:21 AM

Anagha said:

Thank You for your prompt reply. I wanted to do this using filters and not scripts since I dont have access to the Clients page. So I tried using the filters shown on this page in addition to the filters from http://www.semvironment.com/ppc-management-adwords-keyword-data-exposed-with-google-analytics/.
I applied exact query filters first (referral etc) stored in custom field 2, then applied the filters on this page and appended the custom field 2 to it. But it didnt show the exact keywords for transactions. Am I doing something wrong. Can this be done. Please help

December 14, 2009 8:22 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

I've found those keyword filters from semvironment to not work properly - and also to break conversion and transaction tracking data within the reports. It's actually what prompted us to create the custom script in the first place.

Currently, the only method I've seen to do what you need is to use the custom scripts. This will only change if Google makes the Exact Search Query available within the Google Analytics fields.

December 15, 2009 9:03 AM

Jordan Glogau said:

Shawn:

Its been some time since your described your three filter technique. Do you still think this is the best path to match specific transactions to particular channels?

Do you know anyone that's tried to reconciled this methods with their accounting data. This is something that you can do with Coremetrics?

BTW, I saw you method in Biran Clifton's book and the most important piece of advice he left out, set up a different profile since this stuff can break your data.

Thank you for this helpful post.

August 27, 2011 4:08 PM

Chris said:

Hi Shawn,

We've also done some work with this and also had a lot of head scratching to get the results - great post though and cleared up a couple of areas. Regards

Chris

May 3, 2007 4:56 AM

Shawn Purtell said:

@Chris:

Thanks for the nice comment. Let me know if these new filters work out for you. I've only been using them for a little while, so it would be great to get some feedback.

May 3, 2007 8:42 AM

Mikey said:

Hi Shawn,

Great post mate. Like Chris, I've been scratching my head over this & have a couple of clients that will absolutely love this. Thanks :)

Mikey

May 3, 2007 8:22 PM

Shawn Purtell said:

@Mikey:

Thanks! I hope it turns out to be as useful as I think it might. I'd love to hear feedback from you once you've used the filters with clients.

May 4, 2007 9:05 AM

Krista said:

Great Post. These advanced filters are very usefull. I took your training course on Google Analytics. I was wondering if in the future you are going to offer a whole course on advanced implementation and setup where filters like these are taught and where regular expressions could be learned?

May 17, 2007 10:31 AM

Shawn Purtell said:

@Krista:

Thanks for the compliment. The training course that you took includes the most common advanced implementation options that we've encountered (things like Paypal, cross-domain tracking, etc.). We've also included the general ideas about the types of filters you can create. We're currently revamping the course for our new training series, and it will include more about filters and how you can use them to accomplish specific tasks.

In order to get more specific than that, you really need one-on-one attention, because setting up advanced filters really depends on your site and what kinds of information you want to find. This is one example of something our support plans can do for you on an individual level. We try our best to make this information freely available through our blog.

The same sort of thing applies to regular expressions. Regular expressions can get extremely complex, so we covered the most basic/common ones that you can use in our training course. Again, the more advanced regular expressions are only needed in very specific situations that would require one on one attention.

This brings up another point: Google Analytics is like getting a suit (or dress) fitted - you need to take measurements and personal tastes into consideration when you are setting up analytics. There are some steps that are universally important, but when you start looking at your individual site, no two Google Analytics configurations will be exactly alike.

I hope you found this useful. Thanks again for posting and for taking our course!

May 17, 2007 11:13 AM

Shareen Jordan said:

Hi, Shawn.

I really enjoy reading your blog. Thanks for the information. I was wondering, in the first filter you name the constructor field 'custom field 1' and you call it the same thing in the next filter. But (I think)the second filter refers to the custom filed in the first filter. If they are both named the same thing, does the field from the 1st filter overwrite the field from the second filter? And is there any reason why you wouldn't name them differently? Would there be any benefit in naming them customer field 1 and customer field 2?

Thanks! Shareen

June 5, 2007 3:04 PM

Shawn Purtell said:

@Shareen:

Thanks for the compliments. As far as your question, I only had to use a single custom field across all three filters.

So, filter 1 puts the source and medium into custom field 1.

The second filter reads the custom field from filter 1 and adds the term to what was already there.

The final filter adds the custom field we built in the previous two filters to the transaction id.

This is why the order of these filters is so important. They will not work out of sequence (they also should be next to each other on the filter list).

I didn't use two separate custom fields (although I could have) because I really only needed one.

As far as 'naming' the filter fields, you can't do that. You are given two custom fields you can use. I didn't actually name those, I selected them from the pulldown. Thanks for reading!

June 5, 2007 3:10 PM

Will said:

Great post Shawn - this is gold.

I have a question related to this subject. What I really want to do is to take this info (source and keyword) and pass it into a contact form so that we can implement closed-loop tracking of enquiries.

Do you have any ideas on how that might be done?

Bests,
Will

June 14, 2007 4:05 AM

Shawn Purtell said:

@Will:

It can be done. There are actually two methods I know of to do this. Unfortunately, this kind of thing is too advanced for a blog comment, but feel free to contact us if you want help setting this up.

June 14, 2007 9:07 AM

Al said:

Can this be done for organic traffic ? i.e. finding the keywords that deliver conversions from non-paid natural / SEO sources ? Cheers - Al

July 30, 2007 11:31 AM

Shawn Purtell said:

@Al:

These filters will include organic keywords as well. You can check out the screenshot above for some examples of this.

Thanks for reading!

July 30, 2007 11:50 AM

Brian Hinkle said:

Shawn-

Excellent work. I've just started using GA and was annoyed that there was no built-in functionality for that sort of origin tracking in ecommerce transactions - glad to see it can be added fairly easily!

July 30, 2007 2:38 PM

Shawn Purtell said:

@Brian:

That's the whole idea - making this awesome free tool (GA) more and more useful.

Thanks for the comment!

July 30, 2007 2:50 PM

Fonts said:

I use it and get some interesting (great) results. Some transactions are direct which I assume are bookmarked traffic

#312676 (direct) - (none) ()

and other transactions are like the one below do not have a value for the keyword I suppose since it is another site sending the traffic.

#312632 some-referring-site.com - referral ()

Everything else looks killer!

Thanks.

July 31, 2007 1:48 PM

Shawn Purtell said:

@Fonts:

Thanks for the feedback! Direct sources can mean a couple different things. Usually it means a user typed your URL into the browser directly, but there are some other things that will cause this, like email visits from a program like Outlook.

And you are correct with your second point - referring sites obviously will not have any keyword data, and so the parentheses will be blank.

Thanks again for the feedback!

August 2, 2007 3:58 PM

Nathan Scheffey said:

This is a great use of filters to achieve an extremely useful result. However, I think combining it with your excellent Exact Keyword Matching script really takes it to the next level.
I added another filter to append the User Defined Value (the exact keyword) after the Campaign Term. Now my transaction data shows the exact search string that led to the conversion. Very cool.
Question: is there a place to learn the syntax used in these custom filters (e.g. $A1 ($B1))? It seems pretty straightforward but I can't find any information about it in the GA Help documentation.
Anyway, thank you all for your excellent tools, they really take Google Analytics from good to great.

August 2, 2007 5:55 PM

Shawn Purtell said:

@Nathan:

I agree. If you have Michael's exact keyword tracking script installed, this is a great addition, and we actually do that ourselves.

To be honest, I don't have a specific resource for you concerning regular expression string matching variables, but there are lots of great books and websites on the subject.

August 3, 2007 8:53 AM

Neil said:

Hi Shawn.

I've tried doing this on 2 different analytics accounts, and can't get it to work.

I've copied everything word for word, but the keywords are never added. Could it be because the screenshots are of the previous version of analytics?

August 17, 2007 11:13 AM

Shawn Purtell said:

@Neil:

These filters have been tested and confirmed in the new version of Google Analytics.

I can't say for sure where your problem is occurring, but I can tell you that these filters work fine if used properly.

Is it possible you are having problems with your referring source tracking? Also, remember that keywords only show up for organic and cpc results - not for anything else (referrals, direct, banners, and other sources do not have keywords associated with them).

August 20, 2007 8:51 AM

Prince said:

Great stuff Shawn, very usefull.

Just having 1 problem, the first filter that grabs the source and medium, in the output filed you have $A1 - $B1

Thats exatly how I entered it but in my Transaction I am not getting the "source" I do get the keywords

So I get something like this:
Order27 $A (keyword)

August 21, 2007 12:01 AM

Neil said:

It works! Sort off...

Thanks for your help Shawn. I've just logged into Analytics, and it seems that the filters need to be in place for 24 hours to return anything.

Only wish I should filter on Adwords Campaigns instead of Campaigns (no option that I can see).

August 21, 2007 7:19 AM

Shawn Purtell said:

@Prince:

Looks like there's a problem with one of your filters - the third one I believe (specifically the $A1 part). Make sure there is no space between the $A and the 1. I can tell there is something wrong with your output field because '$A' is showing up in your data, and it should never do that.

August 21, 2007 9:15 AM

Shawn Purtell said:

@Neil:

Glad you got things working. And yeah, Google Analytics data generally takes 24 hours to update completely, so anytime you make a change, you need to give it time.

As to your other wish, I'm not really sure what you're asking. There are filters that can do all kinds of things. If you can be more specific, I may be able to help.

August 21, 2007 9:17 AM

Neil Munn said:

I'm accessing Analytics through my Adwords account. This means all my campaigns are listed under Adword campaigns, which isn't shown in the filters dropdown.

What I'm trying to do is, display the keyword(s) that the user types in to make their transaction eg:

Transaction ID, Source, Medium, (Keyword)

Is this possible?

August 22, 2007 5:59 AM

Shawn Purtell said:

@Neil:

The filter set I provided does this automatically, if the keyword exists. You can see in the image above that the keyword should be present for all organic and cpc (including AdWords) sources.

You should not need any additional filters to achieve this result. If you aren't seeing this data, you may not have the filters set up properly.

*Note - There is a difference between 'what the user types in' and the keyword you are bidding on.

The 'term the user typed in' is called the search term while the keyword you bid on is called the bid term. The bid term is the information you will see.

To find out how to get search term info as well, visit Michael's awesome solution here.

August 22, 2007 9:33 AM

Netmeg said:

Hello - I've been using this filter pretty much since you posted it, and it worked just fine. But I created a new profile for it, and it hasn't worked since. Could it be the new Google Analytics code? I then tried to put it back on the original profile on which I had it, and it *still* doesn't work. I haven't changed any of the code, I have the three filters in the proper order - the only thing that has changed was the Google analytics code. And actually, I'm testing that on still another profile, so I'm not entirely sure what's going on now.

January 22, 2008 11:08 AM

Netmeg said:

As an update to my previous post, I went and checked, and between and my partners, five ecommerce sites that were using this filter ALL stopped displaying the data on January 15th. How weird is that? Google must have changed something.

January 22, 2008 1:34 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

There have actually been reports of all advanced filters breaking around that same date, but many people have also stated that their filters have begun to work again. I'd check the more recent data again. In the meantime, we're conducting our own investigation concerning why advanced filters have had this little hiccup, and we'll let you know if we find anything important.

January 23, 2008 8:59 AM

Netmeg said:

As of today, 1/23/2008, none of our advanced filters are working.

Thanks in advance for anything you find out.

January 23, 2008 10:51 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

After examining some other data and situations with both custom and advanced filters, it seems this is an issue many people are experiencing. From the Google Analytics help group to our own data, we have noticed two things:

Many custom filters seemed to stop functioning for several accounts for a brief period around Jan8th, but resumed working on the 15th. This includes custom includes and other custom filters.

Advanced filters that use custom fields, however, seems to be having more trouble, and in many cases have not worked since the 15th on January. Among these kinds of filters is the filter described in this article.

As soon as we get a good explanation as to what's been causing these errors, I'll be sure to post an update here.

January 29, 2008 10:42 AM

Steve Racicot said:

Is anyone using this advanced filters getting data? Is it working correctly?

I have had this installed for over a week and have seen no changes to my transaction list under Eccommerce -> Transactions.

Steve

February 18, 2008 11:14 AM

Jeremy Aube said:

@Steve

Any advanced filters that use custom fields have not been working since January 15th, including this one. This should be a temporary issues, but in the meantime, we have posted an article on an alternate set of filters you can use that function exactly the same as this set. You can get your filters there, and then refer to Shawn's article here for addition instruction and information.

February 18, 2008 3:55 PM

Imran Khan said:

Really informative post.
One question: Where can I find the Transaction List, the last image. I am using the old version of analytics code.

Thanks in advance

February 20, 2008 6:39 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Imran:

The Transaction list is under the Ecommerce section in Google Analytics, and will only show up if you have turned on Ecommerce in your profile settings. The exact report you're looking for is called Transactions.

As a note here, I realize these filters have not been working correctly since Jan. 15th. The filters are still correct, but there was a bug with custom fields (which these filters use) that is being resolved. Until then, feel free to look at Jeremy's update, which gets around this temporary issue.

February 20, 2008 8:57 AM

Asher said:

Have these filters every returned to working properly? I added them before reading to the bottom of the comments. I'm finding that when I view transactions I get the transaction number followed by the state.

June 9, 2008 10:49 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Asher:

These filters have been working correctly for a while now. These three filters do not affect the state of a user, so I wonder why you are seeing that information within Google Analytics. My hunch is that either there is a problem with the way you've set up the filters in your profile, or you have another filter that's using the Custom Field that's interfering with the transaction filters. Unfortunately, it's hard to tell you exactly what the problem is without seeing your filter setup.

June 9, 2008 1:15 PM

Duff said:

First of all, great post, Shawn.

I'm having a problem though.
I paid for a banner on another website. The link to my website is tagged properly:
http://www.mywebsite.com?utm_source=Other%2BWebsite&utm_medium=Banner&utm_campaign=Other%2BWebsite

I am getting some transactions through this banner but in my transaction list all I can see is:
mytransID mywebsite.com-referral (mywebsite.com)

However, of course I would like to be able to see:
mytransID Other Website-Banner ()

Do you have any idea about what did I do wrong?

July 23, 2008 5:57 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff:

It looks like you're getting what we call 'self-referrals' - meaning Google Analytics is registering visits from your own site. This actually has nothing to do with the filters, as those look like they are working.

Self-referrals can occur for many different reasons, but the three most common are:

1. Some pages on your site are missing Google Analytics code.
2. You use multiple subdomains and haven't set up the Google Analytics code for subdomains.
3. Your site has multiple main domains.

If any of these apply to you, then you've most likely found the reason for your self-referrals. If none of these apply to you, there may be another problem with your Google Analytics installation, and I'd have to actually see it in order to diagnose the problem.

July 23, 2008 8:41 AM

Duff said:

Just wanted to thank you coz it is now working properly. Indeed, I use 2 domains, one for the website and another one for payments. Again, thanks a lot!

July 24, 2008 11:28 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff: Glad I could help. Thanks for reading!

July 25, 2008 8:08 AM

Tim said:

Hi Sean - I have an old website that we are redirecting all traffic to our new site. I would like to know which specific transactions are coming from the old site. We are using 301 redirects on individual pages. I tried your examples and it is not picking up the old website as the source or medium... Do you have any advice? Thanks

August 26, 2008 3:09 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Tim: I'm pretty sure Jeremy already answered this on a different blog article, but I agree with him that the only real way to do this effectively with Google Analytics is to add a query parameter to the end of the 301 redirect and then use the Site Search report within Google Analytics to see which transactions are coming from customers who were trying to find the old site.

August 28, 2008 7:44 AM

juan cruz aliaga said:

Hi Shawn, great post!
I am arriving late to this one, but I can see how useful could it be to avoid double counting on orders/transactions.
I was just wondering if the associated keywords would be the last ones used on any campaing source and medium. If so, and to keep track of visitors previous visits to purchase, couldn't we also grab the visitor ID (with a new filter) and appends it to the rest of the info??

Rgds,

jc

February 17, 2009 4:25 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Juan:

Just like with normal Google Analytics tracking, the keyword/source/medium reported with the transaction will be the most recent. Also, in regards to your question about visitor ID - that depends on where the ID is stored. There is no built-in visitor ID filter field in Google Analytics for this, but you could send the data from your database to Google Analytics with each transaction using the ecommerce code. If you do this, you'll probably want to read over the Google Analytics Terms of Service just to make sure the information you're passing isn't considered personally identifiable.

February 17, 2009 8:19 AM

liz rz said:

Hi, this is a great filter, but was wondering how i could modify it to show me the transaction date which is a sortable list so i can see which are the most recent orders...with the existing filter i can only sort by revenue, tax, shipping, quantity. I know i can choose date range for the same info, but a sort would be easier. Thanks, this very useful info.

February 19, 2009 10:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

Probably the easiest way to do this is to use Andre Scholten's Table Sorter add-on for Google Analytics (the site is in Dutch). This is also included in the Better Google Analytics Firefox addon from VKI Studios.

February 19, 2009 10:42 AM

liz rz said:

I've added the filters above and now I'd like to export the data to be able to sort the data into a spreadsheet. There is no seperator between the data fields so I can't seperate the referring source and the keyword. Any ideas?

April 20, 2009 10:32 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

It's a little advanced, but you could run a macro on the spreadsheet that splits up the data for you. That's really the only way that I can see doing this quickly. Moving forward, you could modify the filters so that they contain a separator.

April 20, 2009 11:24 AM

liz rz said:

Thanks Shawn! Can you tell me how to add the data separator to the filters, or point toward a resource where I can learn? This is very helpful! Thanks.

April 24, 2009 8:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

In the filters above, you can modify the Output field at the very bottom of each filter to add your own separators. In my example, I use a dash in filter one, parentheses in filter two, and just a space in filter three. You could easily modify these fields to use a different separator (like a comma) that's easier for you.

April 24, 2009 8:46 AM

mp said:

Thank you for great post. We are using Google Analytic about one year. This solution going to change new transactions. Is there is any way to run it on existing data? I'm just wonder is it possible to achieve the same results with advanced reports?
Thank you for your time.

August 6, 2009 1:06 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You could also use the Secondary Segment dropdown in the Transactions report to some extent. With Jeremy's Google Analytics Report Enhancer, you can segment by source/medium. You could use Advanced Segments to look at a specific medium (cpc for example), and then use the Secondary Segment to look at keyword.

I don't think there's a simple way to do all of this in one step, but the information is there, you just may have to dig for it a little.

August 6, 2009 8:12 AM

mp said:

Hello,

I'm trying to add product name to report and result will be like:
tranID | source | medium | keyword | item_name1 item_name2
I'm using the same filters as use I just added new filter that concatenate item name custom_field.
Trans List Mod 1 \x96 same Trans List Mod 1 - separator |
Trans List Mod 2 - same Trans List Mod 2 \x96 separator |
Trans List Mod 3 - add item name to custom field
Field A -> Extract A Custom Field 1 (.*)
Field B -> Extract B E-commerce Item Name (.*)
Output To -> Constructor Custom Field 1 $A1 | $B1
Field A Required Yes
Field B Required Yes/No tried both
Override Output Field Yes
Case Sensitive No
Trans List Mod 4 - same as Trans List Mod 3. \x96 separator |
As a result I'm getting douplicate rows one with item name and another without. Could you please point me the right direction?
Thank you for your time.

August 28, 2009 7:04 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You're going to run into several issues when using any filter that looks at both transactions and products at the same time. The primary issue here is that a single transaction can be associated with more than one product, which means that Google Analytics stores these pieces of data separately within the original database (and maybe even within different databases).

The easiest way to get the product information for a specific transaction is to just click on the ID. You'll then see a list of products in the transaction.

You may also have some success with an opposite approach, although I haven't tried this yet - try adding the transaction ID and source, etc. to the product name (sort of the reverse of what you're doing). As a caution, I would try this in a separate test profile, but it should give you the same kind of report that you were looking for. Hope that helps!

September 1, 2009 10:10 AM

Anagha said:

How can I append the exact search term also to the end of this PPC keyword so I can see which keyword triggered the transaction. What filter should I use

December 14, 2009 2:00 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

Google Analytics does not currently capture the exact search term, so you would have to use a workaround like the one mentioned in this article. Then you would have to modify the filter to include the User Defined variable or whichever field you are using to store the exact search query.

December 14, 2009 9:21 AM

Anagha said:

Thank You for your prompt reply. I wanted to do this using filters and not scripts since I dont have access to the Clients page. So I tried using the filters shown on this page in addition to the filters from http://www.semvironment.com/ppc-management-adwords-keyword-data-exposed-with-google-analytics/.
I applied exact query filters first (referral etc) stored in custom field 2, then applied the filters on this page and appended the custom field 2 to it. But it didnt show the exact keywords for transactions. Am I doing something wrong. Can this be done. Please help

December 14, 2009 8:22 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

I've found those keyword filters from semvironment to not work properly - and also to break conversion and transaction tracking data within the reports. It's actually what prompted us to create the custom script in the first place.

Currently, the only method I've seen to do what you need is to use the custom scripts. This will only change if Google makes the Exact Search Query available within the Google Analytics fields.

December 15, 2009 9:03 AM

Jordan Glogau said:

Shawn:

Its been some time since your described your three filter technique. Do you still think this is the best path to match specific transactions to particular channels?

Do you know anyone that's tried to reconciled this methods with their accounting data. This is something that you can do with Coremetrics?

BTW, I saw you method in Biran Clifton's book and the most important piece of advice he left out, set up a different profile since this stuff can break your data.

Thank you for this helpful post.

August 27, 2011 4:08 PM

Chris said:

Hi Shawn,

We've also done some work with this and also had a lot of head scratching to get the results - great post though and cleared up a couple of areas. Regards

Chris

May 3, 2007 4:56 AM

Shawn Purtell said:

@Chris:

Thanks for the nice comment. Let me know if these new filters work out for you. I've only been using them for a little while, so it would be great to get some feedback.

May 3, 2007 8:42 AM

Mikey said:

Hi Shawn,

Great post mate. Like Chris, I've been scratching my head over this & have a couple of clients that will absolutely love this. Thanks :)

Mikey

May 3, 2007 8:22 PM

Shawn Purtell said:

@Mikey:

Thanks! I hope it turns out to be as useful as I think it might. I'd love to hear feedback from you once you've used the filters with clients.

May 4, 2007 9:05 AM

Krista said:

Great Post. These advanced filters are very usefull. I took your training course on Google Analytics. I was wondering if in the future you are going to offer a whole course on advanced implementation and setup where filters like these are taught and where regular expressions could be learned?

May 17, 2007 10:31 AM

Shawn Purtell said:

@Krista:

Thanks for the compliment. The training course that you took includes the most common advanced implementation options that we've encountered (things like Paypal, cross-domain tracking, etc.). We've also included the general ideas about the types of filters you can create. We're currently revamping the course for our new training series, and it will include more about filters and how you can use them to accomplish specific tasks.

In order to get more specific than that, you really need one-on-one attention, because setting up advanced filters really depends on your site and what kinds of information you want to find. This is one example of something our support plans can do for you on an individual level. We try our best to make this information freely available through our blog.

The same sort of thing applies to regular expressions. Regular expressions can get extremely complex, so we covered the most basic/common ones that you can use in our training course. Again, the more advanced regular expressions are only needed in very specific situations that would require one on one attention.

This brings up another point: Google Analytics is like getting a suit (or dress) fitted - you need to take measurements and personal tastes into consideration when you are setting up analytics. There are some steps that are universally important, but when you start looking at your individual site, no two Google Analytics configurations will be exactly alike.

I hope you found this useful. Thanks again for posting and for taking our course!

May 17, 2007 11:13 AM

Shareen Jordan said:

Hi, Shawn.

I really enjoy reading your blog. Thanks for the information. I was wondering, in the first filter you name the constructor field 'custom field 1' and you call it the same thing in the next filter. But (I think)the second filter refers to the custom filed in the first filter. If they are both named the same thing, does the field from the 1st filter overwrite the field from the second filter? And is there any reason why you wouldn't name them differently? Would there be any benefit in naming them customer field 1 and customer field 2?

Thanks! Shareen

June 5, 2007 3:04 PM

Shawn Purtell said:

@Shareen:

Thanks for the compliments. As far as your question, I only had to use a single custom field across all three filters.

So, filter 1 puts the source and medium into custom field 1.

The second filter reads the custom field from filter 1 and adds the term to what was already there.

The final filter adds the custom field we built in the previous two filters to the transaction id.

This is why the order of these filters is so important. They will not work out of sequence (they also should be next to each other on the filter list).

I didn't use two separate custom fields (although I could have) because I really only needed one.

As far as 'naming' the filter fields, you can't do that. You are given two custom fields you can use. I didn't actually name those, I selected them from the pulldown. Thanks for reading!

June 5, 2007 3:10 PM

Will said:

Great post Shawn - this is gold.

I have a question related to this subject. What I really want to do is to take this info (source and keyword) and pass it into a contact form so that we can implement closed-loop tracking of enquiries.

Do you have any ideas on how that might be done?

Bests,
Will

June 14, 2007 4:05 AM

Shawn Purtell said:

@Will:

It can be done. There are actually two methods I know of to do this. Unfortunately, this kind of thing is too advanced for a blog comment, but feel free to contact us if you want help setting this up.

June 14, 2007 9:07 AM

Al said:

Can this be done for organic traffic ? i.e. finding the keywords that deliver conversions from non-paid natural / SEO sources ? Cheers - Al

July 30, 2007 11:31 AM

Shawn Purtell said:

@Al:

These filters will include organic keywords as well. You can check out the screenshot above for some examples of this.

Thanks for reading!

July 30, 2007 11:50 AM

Brian Hinkle said:

Shawn-

Excellent work. I've just started using GA and was annoyed that there was no built-in functionality for that sort of origin tracking in ecommerce transactions - glad to see it can be added fairly easily!

July 30, 2007 2:38 PM

Shawn Purtell said:

@Brian:

That's the whole idea - making this awesome free tool (GA) more and more useful.

Thanks for the comment!

July 30, 2007 2:50 PM

Fonts said:

I use it and get some interesting (great) results. Some transactions are direct which I assume are bookmarked traffic

#312676 (direct) - (none) ()

and other transactions are like the one below do not have a value for the keyword I suppose since it is another site sending the traffic.

#312632 some-referring-site.com - referral ()

Everything else looks killer!

Thanks.

July 31, 2007 1:48 PM

Shawn Purtell said:

@Fonts:

Thanks for the feedback! Direct sources can mean a couple different things. Usually it means a user typed your URL into the browser directly, but there are some other things that will cause this, like email visits from a program like Outlook.

And you are correct with your second point - referring sites obviously will not have any keyword data, and so the parentheses will be blank.

Thanks again for the feedback!

August 2, 2007 3:58 PM

Nathan Scheffey said:

This is a great use of filters to achieve an extremely useful result. However, I think combining it with your excellent Exact Keyword Matching script really takes it to the next level.
I added another filter to append the User Defined Value (the exact keyword) after the Campaign Term. Now my transaction data shows the exact search string that led to the conversion. Very cool.
Question: is there a place to learn the syntax used in these custom filters (e.g. $A1 ($B1))? It seems pretty straightforward but I can't find any information about it in the GA Help documentation.
Anyway, thank you all for your excellent tools, they really take Google Analytics from good to great.

August 2, 2007 5:55 PM

Shawn Purtell said:

@Nathan:

I agree. If you have Michael's exact keyword tracking script installed, this is a great addition, and we actually do that ourselves.

To be honest, I don't have a specific resource for you concerning regular expression string matching variables, but there are lots of great books and websites on the subject.

August 3, 2007 8:53 AM

Neil said:

Hi Shawn.

I've tried doing this on 2 different analytics accounts, and can't get it to work.

I've copied everything word for word, but the keywords are never added. Could it be because the screenshots are of the previous version of analytics?

August 17, 2007 11:13 AM

Shawn Purtell said:

@Neil:

These filters have been tested and confirmed in the new version of Google Analytics.

I can't say for sure where your problem is occurring, but I can tell you that these filters work fine if used properly.

Is it possible you are having problems with your referring source tracking? Also, remember that keywords only show up for organic and cpc results - not for anything else (referrals, direct, banners, and other sources do not have keywords associated with them).

August 20, 2007 8:51 AM

Prince said:

Great stuff Shawn, very usefull.

Just having 1 problem, the first filter that grabs the source and medium, in the output filed you have $A1 - $B1

Thats exatly how I entered it but in my Transaction I am not getting the "source" I do get the keywords

So I get something like this:
Order27 $A (keyword)

August 21, 2007 12:01 AM

Neil said:

It works! Sort off...

Thanks for your help Shawn. I've just logged into Analytics, and it seems that the filters need to be in place for 24 hours to return anything.

Only wish I should filter on Adwords Campaigns instead of Campaigns (no option that I can see).

August 21, 2007 7:19 AM

Shawn Purtell said:

@Prince:

Looks like there's a problem with one of your filters - the third one I believe (specifically the $A1 part). Make sure there is no space between the $A and the 1. I can tell there is something wrong with your output field because '$A' is showing up in your data, and it should never do that.

August 21, 2007 9:15 AM

Shawn Purtell said:

@Neil:

Glad you got things working. And yeah, Google Analytics data generally takes 24 hours to update completely, so anytime you make a change, you need to give it time.

As to your other wish, I'm not really sure what you're asking. There are filters that can do all kinds of things. If you can be more specific, I may be able to help.

August 21, 2007 9:17 AM

Neil Munn said:

I'm accessing Analytics through my Adwords account. This means all my campaigns are listed under Adword campaigns, which isn't shown in the filters dropdown.

What I'm trying to do is, display the keyword(s) that the user types in to make their transaction eg:

Transaction ID, Source, Medium, (Keyword)

Is this possible?

August 22, 2007 5:59 AM

Shawn Purtell said:

@Neil:

The filter set I provided does this automatically, if the keyword exists. You can see in the image above that the keyword should be present for all organic and cpc (including AdWords) sources.

You should not need any additional filters to achieve this result. If you aren't seeing this data, you may not have the filters set up properly.

*Note - There is a difference between 'what the user types in' and the keyword you are bidding on.

The 'term the user typed in' is called the search term while the keyword you bid on is called the bid term. The bid term is the information you will see.

To find out how to get search term info as well, visit Michael's awesome solution here.

August 22, 2007 9:33 AM

Netmeg said:

Hello - I've been using this filter pretty much since you posted it, and it worked just fine. But I created a new profile for it, and it hasn't worked since. Could it be the new Google Analytics code? I then tried to put it back on the original profile on which I had it, and it *still* doesn't work. I haven't changed any of the code, I have the three filters in the proper order - the only thing that has changed was the Google analytics code. And actually, I'm testing that on still another profile, so I'm not entirely sure what's going on now.

January 22, 2008 11:08 AM

Netmeg said:

As an update to my previous post, I went and checked, and between and my partners, five ecommerce sites that were using this filter ALL stopped displaying the data on January 15th. How weird is that? Google must have changed something.

January 22, 2008 1:34 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

There have actually been reports of all advanced filters breaking around that same date, but many people have also stated that their filters have begun to work again. I'd check the more recent data again. In the meantime, we're conducting our own investigation concerning why advanced filters have had this little hiccup, and we'll let you know if we find anything important.

January 23, 2008 8:59 AM

Netmeg said:

As of today, 1/23/2008, none of our advanced filters are working.

Thanks in advance for anything you find out.

January 23, 2008 10:51 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

After examining some other data and situations with both custom and advanced filters, it seems this is an issue many people are experiencing. From the Google Analytics help group to our own data, we have noticed two things:

Many custom filters seemed to stop functioning for several accounts for a brief period around Jan8th, but resumed working on the 15th. This includes custom includes and other custom filters.

Advanced filters that use custom fields, however, seems to be having more trouble, and in many cases have not worked since the 15th on January. Among these kinds of filters is the filter described in this article.

As soon as we get a good explanation as to what's been causing these errors, I'll be sure to post an update here.

January 29, 2008 10:42 AM

Steve Racicot said:

Is anyone using this advanced filters getting data? Is it working correctly?

I have had this installed for over a week and have seen no changes to my transaction list under Eccommerce -> Transactions.

Steve

February 18, 2008 11:14 AM

Jeremy Aube said:

@Steve

Any advanced filters that use custom fields have not been working since January 15th, including this one. This should be a temporary issues, but in the meantime, we have posted an article on an alternate set of filters you can use that function exactly the same as this set. You can get your filters there, and then refer to Shawn's article here for addition instruction and information.

February 18, 2008 3:55 PM

Imran Khan said:

Really informative post.
One question: Where can I find the Transaction List, the last image. I am using the old version of analytics code.

Thanks in advance

February 20, 2008 6:39 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Imran:

The Transaction list is under the Ecommerce section in Google Analytics, and will only show up if you have turned on Ecommerce in your profile settings. The exact report you're looking for is called Transactions.

As a note here, I realize these filters have not been working correctly since Jan. 15th. The filters are still correct, but there was a bug with custom fields (which these filters use) that is being resolved. Until then, feel free to look at Jeremy's update, which gets around this temporary issue.

February 20, 2008 8:57 AM

Asher said:

Have these filters every returned to working properly? I added them before reading to the bottom of the comments. I'm finding that when I view transactions I get the transaction number followed by the state.

June 9, 2008 10:49 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Asher:

These filters have been working correctly for a while now. These three filters do not affect the state of a user, so I wonder why you are seeing that information within Google Analytics. My hunch is that either there is a problem with the way you've set up the filters in your profile, or you have another filter that's using the Custom Field that's interfering with the transaction filters. Unfortunately, it's hard to tell you exactly what the problem is without seeing your filter setup.

June 9, 2008 1:15 PM

Duff said:

First of all, great post, Shawn.

I'm having a problem though.
I paid for a banner on another website. The link to my website is tagged properly:
http://www.mywebsite.com?utm_source=Other%2BWebsite&utm_medium=Banner&utm_campaign=Other%2BWebsite

I am getting some transactions through this banner but in my transaction list all I can see is:
mytransID mywebsite.com-referral (mywebsite.com)

However, of course I would like to be able to see:
mytransID Other Website-Banner ()

Do you have any idea about what did I do wrong?

July 23, 2008 5:57 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff:

It looks like you're getting what we call 'self-referrals' - meaning Google Analytics is registering visits from your own site. This actually has nothing to do with the filters, as those look like they are working.

Self-referrals can occur for many different reasons, but the three most common are:

1. Some pages on your site are missing Google Analytics code.
2. You use multiple subdomains and haven't set up the Google Analytics code for subdomains.
3. Your site has multiple main domains.

If any of these apply to you, then you've most likely found the reason for your self-referrals. If none of these apply to you, there may be another problem with your Google Analytics installation, and I'd have to actually see it in order to diagnose the problem.

July 23, 2008 8:41 AM

Duff said:

Just wanted to thank you coz it is now working properly. Indeed, I use 2 domains, one for the website and another one for payments. Again, thanks a lot!

July 24, 2008 11:28 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff: Glad I could help. Thanks for reading!

July 25, 2008 8:08 AM

Tim said:

Hi Sean - I have an old website that we are redirecting all traffic to our new site. I would like to know which specific transactions are coming from the old site. We are using 301 redirects on individual pages. I tried your examples and it is not picking up the old website as the source or medium... Do you have any advice? Thanks

August 26, 2008 3:09 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Tim: I'm pretty sure Jeremy already answered this on a different blog article, but I agree with him that the only real way to do this effectively with Google Analytics is to add a query parameter to the end of the 301 redirect and then use the Site Search report within Google Analytics to see which transactions are coming from customers who were trying to find the old site.

August 28, 2008 7:44 AM

juan cruz aliaga said:

Hi Shawn, great post!
I am arriving late to this one, but I can see how useful could it be to avoid double counting on orders/transactions.
I was just wondering if the associated keywords would be the last ones used on any campaing source and medium. If so, and to keep track of visitors previous visits to purchase, couldn't we also grab the visitor ID (with a new filter) and appends it to the rest of the info??

Rgds,

jc

February 17, 2009 4:25 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Juan:

Just like with normal Google Analytics tracking, the keyword/source/medium reported with the transaction will be the most recent. Also, in regards to your question about visitor ID - that depends on where the ID is stored. There is no built-in visitor ID filter field in Google Analytics for this, but you could send the data from your database to Google Analytics with each transaction using the ecommerce code. If you do this, you'll probably want to read over the Google Analytics Terms of Service just to make sure the information you're passing isn't considered personally identifiable.

February 17, 2009 8:19 AM

liz rz said:

Hi, this is a great filter, but was wondering how i could modify it to show me the transaction date which is a sortable list so i can see which are the most recent orders...with the existing filter i can only sort by revenue, tax, shipping, quantity. I know i can choose date range for the same info, but a sort would be easier. Thanks, this very useful info.

February 19, 2009 10:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

Probably the easiest way to do this is to use Andre Scholten's Table Sorter add-on for Google Analytics (the site is in Dutch). This is also included in the Better Google Analytics Firefox addon from VKI Studios.

February 19, 2009 10:42 AM

liz rz said:

I've added the filters above and now I'd like to export the data to be able to sort the data into a spreadsheet. There is no seperator between the data fields so I can't seperate the referring source and the keyword. Any ideas?

April 20, 2009 10:32 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

It's a little advanced, but you could run a macro on the spreadsheet that splits up the data for you. That's really the only way that I can see doing this quickly. Moving forward, you could modify the filters so that they contain a separator.

April 20, 2009 11:24 AM

liz rz said:

Thanks Shawn! Can you tell me how to add the data separator to the filters, or point toward a resource where I can learn? This is very helpful! Thanks.

April 24, 2009 8:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

In the filters above, you can modify the Output field at the very bottom of each filter to add your own separators. In my example, I use a dash in filter one, parentheses in filter two, and just a space in filter three. You could easily modify these fields to use a different separator (like a comma) that's easier for you.

April 24, 2009 8:46 AM

mp said:

Thank you for great post. We are using Google Analytic about one year. This solution going to change new transactions. Is there is any way to run it on existing data? I'm just wonder is it possible to achieve the same results with advanced reports?
Thank you for your time.

August 6, 2009 1:06 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You could also use the Secondary Segment dropdown in the Transactions report to some extent. With Jeremy's Google Analytics Report Enhancer, you can segment by source/medium. You could use Advanced Segments to look at a specific medium (cpc for example), and then use the Secondary Segment to look at keyword.

I don't think there's a simple way to do all of this in one step, but the information is there, you just may have to dig for it a little.

August 6, 2009 8:12 AM

mp said:

Hello,

I'm trying to add product name to report and result will be like:
tranID | source | medium | keyword | item_name1 item_name2
I'm using the same filters as use I just added new filter that concatenate item name custom_field.
Trans List Mod 1 \x96 same Trans List Mod 1 - separator |
Trans List Mod 2 - same Trans List Mod 2 \x96 separator |
Trans List Mod 3 - add item name to custom field
Field A -> Extract A Custom Field 1 (.*)
Field B -> Extract B E-commerce Item Name (.*)
Output To -> Constructor Custom Field 1 $A1 | $B1
Field A Required Yes
Field B Required Yes/No tried both
Override Output Field Yes
Case Sensitive No
Trans List Mod 4 - same as Trans List Mod 3. \x96 separator |
As a result I'm getting douplicate rows one with item name and another without. Could you please point me the right direction?
Thank you for your time.

August 28, 2009 7:04 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You're going to run into several issues when using any filter that looks at both transactions and products at the same time. The primary issue here is that a single transaction can be associated with more than one product, which means that Google Analytics stores these pieces of data separately within the original database (and maybe even within different databases).

The easiest way to get the product information for a specific transaction is to just click on the ID. You'll then see a list of products in the transaction.

You may also have some success with an opposite approach, although I haven't tried this yet - try adding the transaction ID and source, etc. to the product name (sort of the reverse of what you're doing). As a caution, I would try this in a separate test profile, but it should give you the same kind of report that you were looking for. Hope that helps!

September 1, 2009 10:10 AM

Anagha said:

How can I append the exact search term also to the end of this PPC keyword so I can see which keyword triggered the transaction. What filter should I use

December 14, 2009 2:00 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

Google Analytics does not currently capture the exact search term, so you would have to use a workaround like the one mentioned in this article. Then you would have to modify the filter to include the User Defined variable or whichever field you are using to store the exact search query.

December 14, 2009 9:21 AM

Anagha said:

Thank You for your prompt reply. I wanted to do this using filters and not scripts since I dont have access to the Clients page. So I tried using the filters shown on this page in addition to the filters from http://www.semvironment.com/ppc-management-adwords-keyword-data-exposed-with-google-analytics/.
I applied exact query filters first (referral etc) stored in custom field 2, then applied the filters on this page and appended the custom field 2 to it. But it didnt show the exact keywords for transactions. Am I doing something wrong. Can this be done. Please help

December 14, 2009 8:22 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

I've found those keyword filters from semvironment to not work properly - and also to break conversion and transaction tracking data within the reports. It's actually what prompted us to create the custom script in the first place.

Currently, the only method I've seen to do what you need is to use the custom scripts. This will only change if Google makes the Exact Search Query available within the Google Analytics fields.

December 15, 2009 9:03 AM

Jordan Glogau said:

Shawn:

Its been some time since your described your three filter technique. Do you still think this is the best path to match specific transactions to particular channels?

Do you know anyone that's tried to reconciled this methods with their accounting data. This is something that you can do with Coremetrics?

BTW, I saw you method in Biran Clifton's book and the most important piece of advice he left out, set up a different profile since this stuff can break your data.

Thank you for this helpful post.

August 27, 2011 4:08 PM

Chris said:

Hi Shawn,

We've also done some work with this and also had a lot of head scratching to get the results - great post though and cleared up a couple of areas. Regards

Chris

May 3, 2007 4:56 AM

Shawn Purtell said:

@Chris:

Thanks for the nice comment. Let me know if these new filters work out for you. I've only been using them for a little while, so it would be great to get some feedback.

May 3, 2007 8:42 AM

Mikey said:

Hi Shawn,

Great post mate. Like Chris, I've been scratching my head over this & have a couple of clients that will absolutely love this. Thanks :)

Mikey

May 3, 2007 8:22 PM

Shawn Purtell said:

@Mikey:

Thanks! I hope it turns out to be as useful as I think it might. I'd love to hear feedback from you once you've used the filters with clients.

May 4, 2007 9:05 AM

Krista said:

Great Post. These advanced filters are very usefull. I took your training course on Google Analytics. I was wondering if in the future you are going to offer a whole course on advanced implementation and setup where filters like these are taught and where regular expressions could be learned?

May 17, 2007 10:31 AM

Shawn Purtell said:

@Krista:

Thanks for the compliment. The training course that you took includes the most common advanced implementation options that we've encountered (things like Paypal, cross-domain tracking, etc.). We've also included the general ideas about the types of filters you can create. We're currently revamping the course for our new training series, and it will include more about filters and how you can use them to accomplish specific tasks.

In order to get more specific than that, you really need one-on-one attention, because setting up advanced filters really depends on your site and what kinds of information you want to find. This is one example of something our support plans can do for you on an individual level. We try our best to make this information freely available through our blog.

The same sort of thing applies to regular expressions. Regular expressions can get extremely complex, so we covered the most basic/common ones that you can use in our training course. Again, the more advanced regular expressions are only needed in very specific situations that would require one on one attention.

This brings up another point: Google Analytics is like getting a suit (or dress) fitted - you need to take measurements and personal tastes into consideration when you are setting up analytics. There are some steps that are universally important, but when you start looking at your individual site, no two Google Analytics configurations will be exactly alike.

I hope you found this useful. Thanks again for posting and for taking our course!

May 17, 2007 11:13 AM

Shareen Jordan said:

Hi, Shawn.

I really enjoy reading your blog. Thanks for the information. I was wondering, in the first filter you name the constructor field 'custom field 1' and you call it the same thing in the next filter. But (I think)the second filter refers to the custom filed in the first filter. If they are both named the same thing, does the field from the 1st filter overwrite the field from the second filter? And is there any reason why you wouldn't name them differently? Would there be any benefit in naming them customer field 1 and customer field 2?

Thanks! Shareen

June 5, 2007 3:04 PM

Shawn Purtell said:

@Shareen:

Thanks for the compliments. As far as your question, I only had to use a single custom field across all three filters.

So, filter 1 puts the source and medium into custom field 1.

The second filter reads the custom field from filter 1 and adds the term to what was already there.

The final filter adds the custom field we built in the previous two filters to the transaction id.

This is why the order of these filters is so important. They will not work out of sequence (they also should be next to each other on the filter list).

I didn't use two separate custom fields (although I could have) because I really only needed one.

As far as 'naming' the filter fields, you can't do that. You are given two custom fields you can use. I didn't actually name those, I selected them from the pulldown. Thanks for reading!

June 5, 2007 3:10 PM

Will said:

Great post Shawn - this is gold.

I have a question related to this subject. What I really want to do is to take this info (source and keyword) and pass it into a contact form so that we can implement closed-loop tracking of enquiries.

Do you have any ideas on how that might be done?

Bests,
Will

June 14, 2007 4:05 AM

Shawn Purtell said:

@Will:

It can be done. There are actually two methods I know of to do this. Unfortunately, this kind of thing is too advanced for a blog comment, but feel free to contact us if you want help setting this up.

June 14, 2007 9:07 AM

Al said:

Can this be done for organic traffic ? i.e. finding the keywords that deliver conversions from non-paid natural / SEO sources ? Cheers - Al

July 30, 2007 11:31 AM

Shawn Purtell said:

@Al:

These filters will include organic keywords as well. You can check out the screenshot above for some examples of this.

Thanks for reading!

July 30, 2007 11:50 AM

Brian Hinkle said:

Shawn-

Excellent work. I've just started using GA and was annoyed that there was no built-in functionality for that sort of origin tracking in ecommerce transactions - glad to see it can be added fairly easily!

July 30, 2007 2:38 PM

Shawn Purtell said:

@Brian:

That's the whole idea - making this awesome free tool (GA) more and more useful.

Thanks for the comment!

July 30, 2007 2:50 PM

Fonts said:

I use it and get some interesting (great) results. Some transactions are direct which I assume are bookmarked traffic

#312676 (direct) - (none) ()

and other transactions are like the one below do not have a value for the keyword I suppose since it is another site sending the traffic.

#312632 some-referring-site.com - referral ()

Everything else looks killer!

Thanks.

July 31, 2007 1:48 PM

Shawn Purtell said:

@Fonts:

Thanks for the feedback! Direct sources can mean a couple different things. Usually it means a user typed your URL into the browser directly, but there are some other things that will cause this, like email visits from a program like Outlook.

And you are correct with your second point - referring sites obviously will not have any keyword data, and so the parentheses will be blank.

Thanks again for the feedback!

August 2, 2007 3:58 PM

Nathan Scheffey said:

This is a great use of filters to achieve an extremely useful result. However, I think combining it with your excellent Exact Keyword Matching script really takes it to the next level.
I added another filter to append the User Defined Value (the exact keyword) after the Campaign Term. Now my transaction data shows the exact search string that led to the conversion. Very cool.
Question: is there a place to learn the syntax used in these custom filters (e.g. $A1 ($B1))? It seems pretty straightforward but I can't find any information about it in the GA Help documentation.
Anyway, thank you all for your excellent tools, they really take Google Analytics from good to great.

August 2, 2007 5:55 PM

Shawn Purtell said:

@Nathan:

I agree. If you have Michael's exact keyword tracking script installed, this is a great addition, and we actually do that ourselves.

To be honest, I don't have a specific resource for you concerning regular expression string matching variables, but there are lots of great books and websites on the subject.

August 3, 2007 8:53 AM

Neil said:

Hi Shawn.

I've tried doing this on 2 different analytics accounts, and can't get it to work.

I've copied everything word for word, but the keywords are never added. Could it be because the screenshots are of the previous version of analytics?

August 17, 2007 11:13 AM

Shawn Purtell said:

@Neil:

These filters have been tested and confirmed in the new version of Google Analytics.

I can't say for sure where your problem is occurring, but I can tell you that these filters work fine if used properly.

Is it possible you are having problems with your referring source tracking? Also, remember that keywords only show up for organic and cpc results - not for anything else (referrals, direct, banners, and other sources do not have keywords associated with them).

August 20, 2007 8:51 AM

Prince said:

Great stuff Shawn, very usefull.

Just having 1 problem, the first filter that grabs the source and medium, in the output filed you have $A1 - $B1

Thats exatly how I entered it but in my Transaction I am not getting the "source" I do get the keywords

So I get something like this:
Order27 $A (keyword)

August 21, 2007 12:01 AM

Neil said:

It works! Sort off...

Thanks for your help Shawn. I've just logged into Analytics, and it seems that the filters need to be in place for 24 hours to return anything.

Only wish I should filter on Adwords Campaigns instead of Campaigns (no option that I can see).

August 21, 2007 7:19 AM

Shawn Purtell said:

@Prince:

Looks like there's a problem with one of your filters - the third one I believe (specifically the $A1 part). Make sure there is no space between the $A and the 1. I can tell there is something wrong with your output field because '$A' is showing up in your data, and it should never do that.

August 21, 2007 9:15 AM

Shawn Purtell said:

@Neil:

Glad you got things working. And yeah, Google Analytics data generally takes 24 hours to update completely, so anytime you make a change, you need to give it time.

As to your other wish, I'm not really sure what you're asking. There are filters that can do all kinds of things. If you can be more specific, I may be able to help.

August 21, 2007 9:17 AM

Neil Munn said:

I'm accessing Analytics through my Adwords account. This means all my campaigns are listed under Adword campaigns, which isn't shown in the filters dropdown.

What I'm trying to do is, display the keyword(s) that the user types in to make their transaction eg:

Transaction ID, Source, Medium, (Keyword)

Is this possible?

August 22, 2007 5:59 AM

Shawn Purtell said:

@Neil:

The filter set I provided does this automatically, if the keyword exists. You can see in the image above that the keyword should be present for all organic and cpc (including AdWords) sources.

You should not need any additional filters to achieve this result. If you aren't seeing this data, you may not have the filters set up properly.

*Note - There is a difference between 'what the user types in' and the keyword you are bidding on.

The 'term the user typed in' is called the search term while the keyword you bid on is called the bid term. The bid term is the information you will see.

To find out how to get search term info as well, visit Michael's awesome solution here.

August 22, 2007 9:33 AM

Netmeg said:

Hello - I've been using this filter pretty much since you posted it, and it worked just fine. But I created a new profile for it, and it hasn't worked since. Could it be the new Google Analytics code? I then tried to put it back on the original profile on which I had it, and it *still* doesn't work. I haven't changed any of the code, I have the three filters in the proper order - the only thing that has changed was the Google analytics code. And actually, I'm testing that on still another profile, so I'm not entirely sure what's going on now.

January 22, 2008 11:08 AM

Netmeg said:

As an update to my previous post, I went and checked, and between and my partners, five ecommerce sites that were using this filter ALL stopped displaying the data on January 15th. How weird is that? Google must have changed something.

January 22, 2008 1:34 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

There have actually been reports of all advanced filters breaking around that same date, but many people have also stated that their filters have begun to work again. I'd check the more recent data again. In the meantime, we're conducting our own investigation concerning why advanced filters have had this little hiccup, and we'll let you know if we find anything important.

January 23, 2008 8:59 AM

Netmeg said:

As of today, 1/23/2008, none of our advanced filters are working.

Thanks in advance for anything you find out.

January 23, 2008 10:51 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

After examining some other data and situations with both custom and advanced filters, it seems this is an issue many people are experiencing. From the Google Analytics help group to our own data, we have noticed two things:

Many custom filters seemed to stop functioning for several accounts for a brief period around Jan8th, but resumed working on the 15th. This includes custom includes and other custom filters.

Advanced filters that use custom fields, however, seems to be having more trouble, and in many cases have not worked since the 15th on January. Among these kinds of filters is the filter described in this article.

As soon as we get a good explanation as to what's been causing these errors, I'll be sure to post an update here.

January 29, 2008 10:42 AM

Steve Racicot said:

Is anyone using this advanced filters getting data? Is it working correctly?

I have had this installed for over a week and have seen no changes to my transaction list under Eccommerce -> Transactions.

Steve

February 18, 2008 11:14 AM

Jeremy Aube said:

@Steve

Any advanced filters that use custom fields have not been working since January 15th, including this one. This should be a temporary issues, but in the meantime, we have posted an article on an alternate set of filters you can use that function exactly the same as this set. You can get your filters there, and then refer to Shawn's article here for addition instruction and information.

February 18, 2008 3:55 PM

Imran Khan said:

Really informative post.
One question: Where can I find the Transaction List, the last image. I am using the old version of analytics code.

Thanks in advance

February 20, 2008 6:39 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Imran:

The Transaction list is under the Ecommerce section in Google Analytics, and will only show up if you have turned on Ecommerce in your profile settings. The exact report you're looking for is called Transactions.

As a note here, I realize these filters have not been working correctly since Jan. 15th. The filters are still correct, but there was a bug with custom fields (which these filters use) that is being resolved. Until then, feel free to look at Jeremy's update, which gets around this temporary issue.

February 20, 2008 8:57 AM

Asher said:

Have these filters every returned to working properly? I added them before reading to the bottom of the comments. I'm finding that when I view transactions I get the transaction number followed by the state.

June 9, 2008 10:49 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Asher:

These filters have been working correctly for a while now. These three filters do not affect the state of a user, so I wonder why you are seeing that information within Google Analytics. My hunch is that either there is a problem with the way you've set up the filters in your profile, or you have another filter that's using the Custom Field that's interfering with the transaction filters. Unfortunately, it's hard to tell you exactly what the problem is without seeing your filter setup.

June 9, 2008 1:15 PM

Duff said:

First of all, great post, Shawn.

I'm having a problem though.
I paid for a banner on another website. The link to my website is tagged properly:
http://www.mywebsite.com?utm_source=Other%2BWebsite&utm_medium=Banner&utm_campaign=Other%2BWebsite

I am getting some transactions through this banner but in my transaction list all I can see is:
mytransID mywebsite.com-referral (mywebsite.com)

However, of course I would like to be able to see:
mytransID Other Website-Banner ()

Do you have any idea about what did I do wrong?

July 23, 2008 5:57 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff:

It looks like you're getting what we call 'self-referrals' - meaning Google Analytics is registering visits from your own site. This actually has nothing to do with the filters, as those look like they are working.

Self-referrals can occur for many different reasons, but the three most common are:

1. Some pages on your site are missing Google Analytics code.
2. You use multiple subdomains and haven't set up the Google Analytics code for subdomains.
3. Your site has multiple main domains.

If any of these apply to you, then you've most likely found the reason for your self-referrals. If none of these apply to you, there may be another problem with your Google Analytics installation, and I'd have to actually see it in order to diagnose the problem.

July 23, 2008 8:41 AM

Duff said:

Just wanted to thank you coz it is now working properly. Indeed, I use 2 domains, one for the website and another one for payments. Again, thanks a lot!

July 24, 2008 11:28 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff: Glad I could help. Thanks for reading!

July 25, 2008 8:08 AM

Tim said:

Hi Sean - I have an old website that we are redirecting all traffic to our new site. I would like to know which specific transactions are coming from the old site. We are using 301 redirects on individual pages. I tried your examples and it is not picking up the old website as the source or medium... Do you have any advice? Thanks

August 26, 2008 3:09 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Tim: I'm pretty sure Jeremy already answered this on a different blog article, but I agree with him that the only real way to do this effectively with Google Analytics is to add a query parameter to the end of the 301 redirect and then use the Site Search report within Google Analytics to see which transactions are coming from customers who were trying to find the old site.

August 28, 2008 7:44 AM

juan cruz aliaga said:

Hi Shawn, great post!
I am arriving late to this one, but I can see how useful could it be to avoid double counting on orders/transactions.
I was just wondering if the associated keywords would be the last ones used on any campaing source and medium. If so, and to keep track of visitors previous visits to purchase, couldn't we also grab the visitor ID (with a new filter) and appends it to the rest of the info??

Rgds,

jc

February 17, 2009 4:25 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Juan:

Just like with normal Google Analytics tracking, the keyword/source/medium reported with the transaction will be the most recent. Also, in regards to your question about visitor ID - that depends on where the ID is stored. There is no built-in visitor ID filter field in Google Analytics for this, but you could send the data from your database to Google Analytics with each transaction using the ecommerce code. If you do this, you'll probably want to read over the Google Analytics Terms of Service just to make sure the information you're passing isn't considered personally identifiable.

February 17, 2009 8:19 AM

liz rz said:

Hi, this is a great filter, but was wondering how i could modify it to show me the transaction date which is a sortable list so i can see which are the most recent orders...with the existing filter i can only sort by revenue, tax, shipping, quantity. I know i can choose date range for the same info, but a sort would be easier. Thanks, this very useful info.

February 19, 2009 10:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

Probably the easiest way to do this is to use Andre Scholten's Table Sorter add-on for Google Analytics (the site is in Dutch). This is also included in the Better Google Analytics Firefox addon from VKI Studios.

February 19, 2009 10:42 AM

liz rz said:

I've added the filters above and now I'd like to export the data to be able to sort the data into a spreadsheet. There is no seperator between the data fields so I can't seperate the referring source and the keyword. Any ideas?

April 20, 2009 10:32 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

It's a little advanced, but you could run a macro on the spreadsheet that splits up the data for you. That's really the only way that I can see doing this quickly. Moving forward, you could modify the filters so that they contain a separator.

April 20, 2009 11:24 AM

liz rz said:

Thanks Shawn! Can you tell me how to add the data separator to the filters, or point toward a resource where I can learn? This is very helpful! Thanks.

April 24, 2009 8:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

In the filters above, you can modify the Output field at the very bottom of each filter to add your own separators. In my example, I use a dash in filter one, parentheses in filter two, and just a space in filter three. You could easily modify these fields to use a different separator (like a comma) that's easier for you.

April 24, 2009 8:46 AM

mp said:

Thank you for great post. We are using Google Analytic about one year. This solution going to change new transactions. Is there is any way to run it on existing data? I'm just wonder is it possible to achieve the same results with advanced reports?
Thank you for your time.

August 6, 2009 1:06 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You could also use the Secondary Segment dropdown in the Transactions report to some extent. With Jeremy's Google Analytics Report Enhancer, you can segment by source/medium. You could use Advanced Segments to look at a specific medium (cpc for example), and then use the Secondary Segment to look at keyword.

I don't think there's a simple way to do all of this in one step, but the information is there, you just may have to dig for it a little.

August 6, 2009 8:12 AM

mp said:

Hello,

I'm trying to add product name to report and result will be like:
tranID | source | medium | keyword | item_name1 item_name2
I'm using the same filters as use I just added new filter that concatenate item name custom_field.
Trans List Mod 1 \x96 same Trans List Mod 1 - separator |
Trans List Mod 2 - same Trans List Mod 2 \x96 separator |
Trans List Mod 3 - add item name to custom field
Field A -> Extract A Custom Field 1 (.*)
Field B -> Extract B E-commerce Item Name (.*)
Output To -> Constructor Custom Field 1 $A1 | $B1
Field A Required Yes
Field B Required Yes/No tried both
Override Output Field Yes
Case Sensitive No
Trans List Mod 4 - same as Trans List Mod 3. \x96 separator |
As a result I'm getting douplicate rows one with item name and another without. Could you please point me the right direction?
Thank you for your time.

August 28, 2009 7:04 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You're going to run into several issues when using any filter that looks at both transactions and products at the same time. The primary issue here is that a single transaction can be associated with more than one product, which means that Google Analytics stores these pieces of data separately within the original database (and maybe even within different databases).

The easiest way to get the product information for a specific transaction is to just click on the ID. You'll then see a list of products in the transaction.

You may also have some success with an opposite approach, although I haven't tried this yet - try adding the transaction ID and source, etc. to the product name (sort of the reverse of what you're doing). As a caution, I would try this in a separate test profile, but it should give you the same kind of report that you were looking for. Hope that helps!

September 1, 2009 10:10 AM

Anagha said:

How can I append the exact search term also to the end of this PPC keyword so I can see which keyword triggered the transaction. What filter should I use

December 14, 2009 2:00 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

Google Analytics does not currently capture the exact search term, so you would have to use a workaround like the one mentioned in this article. Then you would have to modify the filter to include the User Defined variable or whichever field you are using to store the exact search query.

December 14, 2009 9:21 AM

Anagha said:

Thank You for your prompt reply. I wanted to do this using filters and not scripts since I dont have access to the Clients page. So I tried using the filters shown on this page in addition to the filters from http://www.semvironment.com/ppc-management-adwords-keyword-data-exposed-with-google-analytics/.
I applied exact query filters first (referral etc) stored in custom field 2, then applied the filters on this page and appended the custom field 2 to it. But it didnt show the exact keywords for transactions. Am I doing something wrong. Can this be done. Please help

December 14, 2009 8:22 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

I've found those keyword filters from semvironment to not work properly - and also to break conversion and transaction tracking data within the reports. It's actually what prompted us to create the custom script in the first place.

Currently, the only method I've seen to do what you need is to use the custom scripts. This will only change if Google makes the Exact Search Query available within the Google Analytics fields.

December 15, 2009 9:03 AM

Jordan Glogau said:

Shawn:

Its been some time since your described your three filter technique. Do you still think this is the best path to match specific transactions to particular channels?

Do you know anyone that's tried to reconciled this methods with their accounting data. This is something that you can do with Coremetrics?

BTW, I saw you method in Biran Clifton's book and the most important piece of advice he left out, set up a different profile since this stuff can break your data.

Thank you for this helpful post.

August 27, 2011 4:08 PM

Chris said:

Hi Shawn,

We've also done some work with this and also had a lot of head scratching to get the results - great post though and cleared up a couple of areas. Regards

Chris

May 3, 2007 4:56 AM

Shawn Purtell said:

@Chris:

Thanks for the nice comment. Let me know if these new filters work out for you. I've only been using them for a little while, so it would be great to get some feedback.

May 3, 2007 8:42 AM

Mikey said:

Hi Shawn,

Great post mate. Like Chris, I've been scratching my head over this & have a couple of clients that will absolutely love this. Thanks :)

Mikey

May 3, 2007 8:22 PM

Shawn Purtell said:

@Mikey:

Thanks! I hope it turns out to be as useful as I think it might. I'd love to hear feedback from you once you've used the filters with clients.

May 4, 2007 9:05 AM

Krista said:

Great Post. These advanced filters are very usefull. I took your training course on Google Analytics. I was wondering if in the future you are going to offer a whole course on advanced implementation and setup where filters like these are taught and where regular expressions could be learned?

May 17, 2007 10:31 AM

Shawn Purtell said:

@Krista:

Thanks for the compliment. The training course that you took includes the most common advanced implementation options that we've encountered (things like Paypal, cross-domain tracking, etc.). We've also included the general ideas about the types of filters you can create. We're currently revamping the course for our new training series, and it will include more about filters and how you can use them to accomplish specific tasks.

In order to get more specific than that, you really need one-on-one attention, because setting up advanced filters really depends on your site and what kinds of information you want to find. This is one example of something our support plans can do for you on an individual level. We try our best to make this information freely available through our blog.

The same sort of thing applies to regular expressions. Regular expressions can get extremely complex, so we covered the most basic/common ones that you can use in our training course. Again, the more advanced regular expressions are only needed in very specific situations that would require one on one attention.

This brings up another point: Google Analytics is like getting a suit (or dress) fitted - you need to take measurements and personal tastes into consideration when you are setting up analytics. There are some steps that are universally important, but when you start looking at your individual site, no two Google Analytics configurations will be exactly alike.

I hope you found this useful. Thanks again for posting and for taking our course!

May 17, 2007 11:13 AM

Shareen Jordan said:

Hi, Shawn.

I really enjoy reading your blog. Thanks for the information. I was wondering, in the first filter you name the constructor field 'custom field 1' and you call it the same thing in the next filter. But (I think)the second filter refers to the custom filed in the first filter. If they are both named the same thing, does the field from the 1st filter overwrite the field from the second filter? And is there any reason why you wouldn't name them differently? Would there be any benefit in naming them customer field 1 and customer field 2?

Thanks! Shareen

June 5, 2007 3:04 PM

Shawn Purtell said:

@Shareen:

Thanks for the compliments. As far as your question, I only had to use a single custom field across all three filters.

So, filter 1 puts the source and medium into custom field 1.

The second filter reads the custom field from filter 1 and adds the term to what was already there.

The final filter adds the custom field we built in the previous two filters to the transaction id.

This is why the order of these filters is so important. They will not work out of sequence (they also should be next to each other on the filter list).

I didn't use two separate custom fields (although I could have) because I really only needed one.

As far as 'naming' the filter fields, you can't do that. You are given two custom fields you can use. I didn't actually name those, I selected them from the pulldown. Thanks for reading!

June 5, 2007 3:10 PM

Will said:

Great post Shawn - this is gold.

I have a question related to this subject. What I really want to do is to take this info (source and keyword) and pass it into a contact form so that we can implement closed-loop tracking of enquiries.

Do you have any ideas on how that might be done?

Bests,
Will

June 14, 2007 4:05 AM

Shawn Purtell said:

@Will:

It can be done. There are actually two methods I know of to do this. Unfortunately, this kind of thing is too advanced for a blog comment, but feel free to contact us if you want help setting this up.

June 14, 2007 9:07 AM

Al said:

Can this be done for organic traffic ? i.e. finding the keywords that deliver conversions from non-paid natural / SEO sources ? Cheers - Al

July 30, 2007 11:31 AM

Shawn Purtell said:

@Al:

These filters will include organic keywords as well. You can check out the screenshot above for some examples of this.

Thanks for reading!

July 30, 2007 11:50 AM

Brian Hinkle said:

Shawn-

Excellent work. I've just started using GA and was annoyed that there was no built-in functionality for that sort of origin tracking in ecommerce transactions - glad to see it can be added fairly easily!

July 30, 2007 2:38 PM

Shawn Purtell said:

@Brian:

That's the whole idea - making this awesome free tool (GA) more and more useful.

Thanks for the comment!

July 30, 2007 2:50 PM

Fonts said:

I use it and get some interesting (great) results. Some transactions are direct which I assume are bookmarked traffic

#312676 (direct) - (none) ()

and other transactions are like the one below do not have a value for the keyword I suppose since it is another site sending the traffic.

#312632 some-referring-site.com - referral ()

Everything else looks killer!

Thanks.

July 31, 2007 1:48 PM

Shawn Purtell said:

@Fonts:

Thanks for the feedback! Direct sources can mean a couple different things. Usually it means a user typed your URL into the browser directly, but there are some other things that will cause this, like email visits from a program like Outlook.

And you are correct with your second point - referring sites obviously will not have any keyword data, and so the parentheses will be blank.

Thanks again for the feedback!

August 2, 2007 3:58 PM

Nathan Scheffey said:

This is a great use of filters to achieve an extremely useful result. However, I think combining it with your excellent Exact Keyword Matching script really takes it to the next level.
I added another filter to append the User Defined Value (the exact keyword) after the Campaign Term. Now my transaction data shows the exact search string that led to the conversion. Very cool.
Question: is there a place to learn the syntax used in these custom filters (e.g. $A1 ($B1))? It seems pretty straightforward but I can't find any information about it in the GA Help documentation.
Anyway, thank you all for your excellent tools, they really take Google Analytics from good to great.

August 2, 2007 5:55 PM

Shawn Purtell said:

@Nathan:

I agree. If you have Michael's exact keyword tracking script installed, this is a great addition, and we actually do that ourselves.

To be honest, I don't have a specific resource for you concerning regular expression string matching variables, but there are lots of great books and websites on the subject.

August 3, 2007 8:53 AM

Neil said:

Hi Shawn.

I've tried doing this on 2 different analytics accounts, and can't get it to work.

I've copied everything word for word, but the keywords are never added. Could it be because the screenshots are of the previous version of analytics?

August 17, 2007 11:13 AM

Shawn Purtell said:

@Neil:

These filters have been tested and confirmed in the new version of Google Analytics.

I can't say for sure where your problem is occurring, but I can tell you that these filters work fine if used properly.

Is it possible you are having problems with your referring source tracking? Also, remember that keywords only show up for organic and cpc results - not for anything else (referrals, direct, banners, and other sources do not have keywords associated with them).

August 20, 2007 8:51 AM

Prince said:

Great stuff Shawn, very usefull.

Just having 1 problem, the first filter that grabs the source and medium, in the output filed you have $A1 - $B1

Thats exatly how I entered it but in my Transaction I am not getting the "source" I do get the keywords

So I get something like this:
Order27 $A (keyword)

August 21, 2007 12:01 AM

Neil said:

It works! Sort off...

Thanks for your help Shawn. I've just logged into Analytics, and it seems that the filters need to be in place for 24 hours to return anything.

Only wish I should filter on Adwords Campaigns instead of Campaigns (no option that I can see).

August 21, 2007 7:19 AM

Shawn Purtell said:

@Prince:

Looks like there's a problem with one of your filters - the third one I believe (specifically the $A1 part). Make sure there is no space between the $A and the 1. I can tell there is something wrong with your output field because '$A' is showing up in your data, and it should never do that.

August 21, 2007 9:15 AM

Shawn Purtell said:

@Neil:

Glad you got things working. And yeah, Google Analytics data generally takes 24 hours to update completely, so anytime you make a change, you need to give it time.

As to your other wish, I'm not really sure what you're asking. There are filters that can do all kinds of things. If you can be more specific, I may be able to help.

August 21, 2007 9:17 AM

Neil Munn said:

I'm accessing Analytics through my Adwords account. This means all my campaigns are listed under Adword campaigns, which isn't shown in the filters dropdown.

What I'm trying to do is, display the keyword(s) that the user types in to make their transaction eg:

Transaction ID, Source, Medium, (Keyword)

Is this possible?

August 22, 2007 5:59 AM

Shawn Purtell said:

@Neil:

The filter set I provided does this automatically, if the keyword exists. You can see in the image above that the keyword should be present for all organic and cpc (including AdWords) sources.

You should not need any additional filters to achieve this result. If you aren't seeing this data, you may not have the filters set up properly.

*Note - There is a difference between 'what the user types in' and the keyword you are bidding on.

The 'term the user typed in' is called the search term while the keyword you bid on is called the bid term. The bid term is the information you will see.

To find out how to get search term info as well, visit Michael's awesome solution here.

August 22, 2007 9:33 AM

Netmeg said:

Hello - I've been using this filter pretty much since you posted it, and it worked just fine. But I created a new profile for it, and it hasn't worked since. Could it be the new Google Analytics code? I then tried to put it back on the original profile on which I had it, and it *still* doesn't work. I haven't changed any of the code, I have the three filters in the proper order - the only thing that has changed was the Google analytics code. And actually, I'm testing that on still another profile, so I'm not entirely sure what's going on now.

January 22, 2008 11:08 AM

Netmeg said:

As an update to my previous post, I went and checked, and between and my partners, five ecommerce sites that were using this filter ALL stopped displaying the data on January 15th. How weird is that? Google must have changed something.

January 22, 2008 1:34 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

There have actually been reports of all advanced filters breaking around that same date, but many people have also stated that their filters have begun to work again. I'd check the more recent data again. In the meantime, we're conducting our own investigation concerning why advanced filters have had this little hiccup, and we'll let you know if we find anything important.

January 23, 2008 8:59 AM

Netmeg said:

As of today, 1/23/2008, none of our advanced filters are working.

Thanks in advance for anything you find out.

January 23, 2008 10:51 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

After examining some other data and situations with both custom and advanced filters, it seems this is an issue many people are experiencing. From the Google Analytics help group to our own data, we have noticed two things:

Many custom filters seemed to stop functioning for several accounts for a brief period around Jan8th, but resumed working on the 15th. This includes custom includes and other custom filters.

Advanced filters that use custom fields, however, seems to be having more trouble, and in many cases have not worked since the 15th on January. Among these kinds of filters is the filter described in this article.

As soon as we get a good explanation as to what's been causing these errors, I'll be sure to post an update here.

January 29, 2008 10:42 AM

Steve Racicot said:

Is anyone using this advanced filters getting data? Is it working correctly?

I have had this installed for over a week and have seen no changes to my transaction list under Eccommerce -> Transactions.

Steve

February 18, 2008 11:14 AM

Jeremy Aube said:

@Steve

Any advanced filters that use custom fields have not been working since January 15th, including this one. This should be a temporary issues, but in the meantime, we have posted an article on an alternate set of filters you can use that function exactly the same as this set. You can get your filters there, and then refer to Shawn's article here for addition instruction and information.

February 18, 2008 3:55 PM

Imran Khan said:

Really informative post.
One question: Where can I find the Transaction List, the last image. I am using the old version of analytics code.

Thanks in advance

February 20, 2008 6:39 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Imran:

The Transaction list is under the Ecommerce section in Google Analytics, and will only show up if you have turned on Ecommerce in your profile settings. The exact report you're looking for is called Transactions.

As a note here, I realize these filters have not been working correctly since Jan. 15th. The filters are still correct, but there was a bug with custom fields (which these filters use) that is being resolved. Until then, feel free to look at Jeremy's update, which gets around this temporary issue.

February 20, 2008 8:57 AM

Asher said:

Have these filters every returned to working properly? I added them before reading to the bottom of the comments. I'm finding that when I view transactions I get the transaction number followed by the state.

June 9, 2008 10:49 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Asher:

These filters have been working correctly for a while now. These three filters do not affect the state of a user, so I wonder why you are seeing that information within Google Analytics. My hunch is that either there is a problem with the way you've set up the filters in your profile, or you have another filter that's using the Custom Field that's interfering with the transaction filters. Unfortunately, it's hard to tell you exactly what the problem is without seeing your filter setup.

June 9, 2008 1:15 PM

Duff said:

First of all, great post, Shawn.

I'm having a problem though.
I paid for a banner on another website. The link to my website is tagged properly:
http://www.mywebsite.com?utm_source=Other%2BWebsite&utm_medium=Banner&utm_campaign=Other%2BWebsite

I am getting some transactions through this banner but in my transaction list all I can see is:
mytransID mywebsite.com-referral (mywebsite.com)

However, of course I would like to be able to see:
mytransID Other Website-Banner ()

Do you have any idea about what did I do wrong?

July 23, 2008 5:57 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff:

It looks like you're getting what we call 'self-referrals' - meaning Google Analytics is registering visits from your own site. This actually has nothing to do with the filters, as those look like they are working.

Self-referrals can occur for many different reasons, but the three most common are:

1. Some pages on your site are missing Google Analytics code.
2. You use multiple subdomains and haven't set up the Google Analytics code for subdomains.
3. Your site has multiple main domains.

If any of these apply to you, then you've most likely found the reason for your self-referrals. If none of these apply to you, there may be another problem with your Google Analytics installation, and I'd have to actually see it in order to diagnose the problem.

July 23, 2008 8:41 AM

Duff said:

Just wanted to thank you coz it is now working properly. Indeed, I use 2 domains, one for the website and another one for payments. Again, thanks a lot!

July 24, 2008 11:28 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff: Glad I could help. Thanks for reading!

July 25, 2008 8:08 AM

Tim said:

Hi Sean - I have an old website that we are redirecting all traffic to our new site. I would like to know which specific transactions are coming from the old site. We are using 301 redirects on individual pages. I tried your examples and it is not picking up the old website as the source or medium... Do you have any advice? Thanks

August 26, 2008 3:09 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Tim: I'm pretty sure Jeremy already answered this on a different blog article, but I agree with him that the only real way to do this effectively with Google Analytics is to add a query parameter to the end of the 301 redirect and then use the Site Search report within Google Analytics to see which transactions are coming from customers who were trying to find the old site.

August 28, 2008 7:44 AM

juan cruz aliaga said:

Hi Shawn, great post!
I am arriving late to this one, but I can see how useful could it be to avoid double counting on orders/transactions.
I was just wondering if the associated keywords would be the last ones used on any campaing source and medium. If so, and to keep track of visitors previous visits to purchase, couldn't we also grab the visitor ID (with a new filter) and appends it to the rest of the info??

Rgds,

jc

February 17, 2009 4:25 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Juan:

Just like with normal Google Analytics tracking, the keyword/source/medium reported with the transaction will be the most recent. Also, in regards to your question about visitor ID - that depends on where the ID is stored. There is no built-in visitor ID filter field in Google Analytics for this, but you could send the data from your database to Google Analytics with each transaction using the ecommerce code. If you do this, you'll probably want to read over the Google Analytics Terms of Service just to make sure the information you're passing isn't considered personally identifiable.

February 17, 2009 8:19 AM

liz rz said:

Hi, this is a great filter, but was wondering how i could modify it to show me the transaction date which is a sortable list so i can see which are the most recent orders...with the existing filter i can only sort by revenue, tax, shipping, quantity. I know i can choose date range for the same info, but a sort would be easier. Thanks, this very useful info.

February 19, 2009 10:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

Probably the easiest way to do this is to use Andre Scholten's Table Sorter add-on for Google Analytics (the site is in Dutch). This is also included in the Better Google Analytics Firefox addon from VKI Studios.

February 19, 2009 10:42 AM

liz rz said:

I've added the filters above and now I'd like to export the data to be able to sort the data into a spreadsheet. There is no seperator between the data fields so I can't seperate the referring source and the keyword. Any ideas?

April 20, 2009 10:32 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

It's a little advanced, but you could run a macro on the spreadsheet that splits up the data for you. That's really the only way that I can see doing this quickly. Moving forward, you could modify the filters so that they contain a separator.

April 20, 2009 11:24 AM

liz rz said:

Thanks Shawn! Can you tell me how to add the data separator to the filters, or point toward a resource where I can learn? This is very helpful! Thanks.

April 24, 2009 8:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

In the filters above, you can modify the Output field at the very bottom of each filter to add your own separators. In my example, I use a dash in filter one, parentheses in filter two, and just a space in filter three. You could easily modify these fields to use a different separator (like a comma) that's easier for you.

April 24, 2009 8:46 AM

mp said:

Thank you for great post. We are using Google Analytic about one year. This solution going to change new transactions. Is there is any way to run it on existing data? I'm just wonder is it possible to achieve the same results with advanced reports?
Thank you for your time.

August 6, 2009 1:06 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You could also use the Secondary Segment dropdown in the Transactions report to some extent. With Jeremy's Google Analytics Report Enhancer, you can segment by source/medium. You could use Advanced Segments to look at a specific medium (cpc for example), and then use the Secondary Segment to look at keyword.

I don't think there's a simple way to do all of this in one step, but the information is there, you just may have to dig for it a little.

August 6, 2009 8:12 AM

mp said:

Hello,

I'm trying to add product name to report and result will be like:
tranID | source | medium | keyword | item_name1 item_name2
I'm using the same filters as use I just added new filter that concatenate item name custom_field.
Trans List Mod 1 \x96 same Trans List Mod 1 - separator |
Trans List Mod 2 - same Trans List Mod 2 \x96 separator |
Trans List Mod 3 - add item name to custom field
Field A -> Extract A Custom Field 1 (.*)
Field B -> Extract B E-commerce Item Name (.*)
Output To -> Constructor Custom Field 1 $A1 | $B1
Field A Required Yes
Field B Required Yes/No tried both
Override Output Field Yes
Case Sensitive No
Trans List Mod 4 - same as Trans List Mod 3. \x96 separator |
As a result I'm getting douplicate rows one with item name and another without. Could you please point me the right direction?
Thank you for your time.

August 28, 2009 7:04 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You're going to run into several issues when using any filter that looks at both transactions and products at the same time. The primary issue here is that a single transaction can be associated with more than one product, which means that Google Analytics stores these pieces of data separately within the original database (and maybe even within different databases).

The easiest way to get the product information for a specific transaction is to just click on the ID. You'll then see a list of products in the transaction.

You may also have some success with an opposite approach, although I haven't tried this yet - try adding the transaction ID and source, etc. to the product name (sort of the reverse of what you're doing). As a caution, I would try this in a separate test profile, but it should give you the same kind of report that you were looking for. Hope that helps!

September 1, 2009 10:10 AM

Anagha said:

How can I append the exact search term also to the end of this PPC keyword so I can see which keyword triggered the transaction. What filter should I use

December 14, 2009 2:00 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

Google Analytics does not currently capture the exact search term, so you would have to use a workaround like the one mentioned in this article. Then you would have to modify the filter to include the User Defined variable or whichever field you are using to store the exact search query.

December 14, 2009 9:21 AM

Anagha said:

Thank You for your prompt reply. I wanted to do this using filters and not scripts since I dont have access to the Clients page. So I tried using the filters shown on this page in addition to the filters from http://www.semvironment.com/ppc-management-adwords-keyword-data-exposed-with-google-analytics/.
I applied exact query filters first (referral etc) stored in custom field 2, then applied the filters on this page and appended the custom field 2 to it. But it didnt show the exact keywords for transactions. Am I doing something wrong. Can this be done. Please help

December 14, 2009 8:22 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

I've found those keyword filters from semvironment to not work properly - and also to break conversion and transaction tracking data within the reports. It's actually what prompted us to create the custom script in the first place.

Currently, the only method I've seen to do what you need is to use the custom scripts. This will only change if Google makes the Exact Search Query available within the Google Analytics fields.

December 15, 2009 9:03 AM

Jordan Glogau said:

Shawn:

Its been some time since your described your three filter technique. Do you still think this is the best path to match specific transactions to particular channels?

Do you know anyone that's tried to reconciled this methods with their accounting data. This is something that you can do with Coremetrics?

BTW, I saw you method in Biran Clifton's book and the most important piece of advice he left out, set up a different profile since this stuff can break your data.

Thank you for this helpful post.

August 27, 2011 4:08 PM

Chris said:

Hi Shawn,

We've also done some work with this and also had a lot of head scratching to get the results - great post though and cleared up a couple of areas. Regards

Chris

May 3, 2007 4:56 AM

Shawn Purtell said:

@Chris:

Thanks for the nice comment. Let me know if these new filters work out for you. I've only been using them for a little while, so it would be great to get some feedback.

May 3, 2007 8:42 AM

Mikey said:

Hi Shawn,

Great post mate. Like Chris, I've been scratching my head over this & have a couple of clients that will absolutely love this. Thanks :)

Mikey

May 3, 2007 8:22 PM

Shawn Purtell said:

@Mikey:

Thanks! I hope it turns out to be as useful as I think it might. I'd love to hear feedback from you once you've used the filters with clients.

May 4, 2007 9:05 AM

Krista said:

Great Post. These advanced filters are very usefull. I took your training course on Google Analytics. I was wondering if in the future you are going to offer a whole course on advanced implementation and setup where filters like these are taught and where regular expressions could be learned?

May 17, 2007 10:31 AM

Shawn Purtell said:

@Krista:

Thanks for the compliment. The training course that you took includes the most common advanced implementation options that we've encountered (things like Paypal, cross-domain tracking, etc.). We've also included the general ideas about the types of filters you can create. We're currently revamping the course for our new training series, and it will include more about filters and how you can use them to accomplish specific tasks.

In order to get more specific than that, you really need one-on-one attention, because setting up advanced filters really depends on your site and what kinds of information you want to find. This is one example of something our support plans can do for you on an individual level. We try our best to make this information freely available through our blog.

The same sort of thing applies to regular expressions. Regular expressions can get extremely complex, so we covered the most basic/common ones that you can use in our training course. Again, the more advanced regular expressions are only needed in very specific situations that would require one on one attention.

This brings up another point: Google Analytics is like getting a suit (or dress) fitted - you need to take measurements and personal tastes into consideration when you are setting up analytics. There are some steps that are universally important, but when you start looking at your individual site, no two Google Analytics configurations will be exactly alike.

I hope you found this useful. Thanks again for posting and for taking our course!

May 17, 2007 11:13 AM

Shareen Jordan said:

Hi, Shawn.

I really enjoy reading your blog. Thanks for the information. I was wondering, in the first filter you name the constructor field 'custom field 1' and you call it the same thing in the next filter. But (I think)the second filter refers to the custom filed in the first filter. If they are both named the same thing, does the field from the 1st filter overwrite the field from the second filter? And is there any reason why you wouldn't name them differently? Would there be any benefit in naming them customer field 1 and customer field 2?

Thanks! Shareen

June 5, 2007 3:04 PM

Shawn Purtell said:

@Shareen:

Thanks for the compliments. As far as your question, I only had to use a single custom field across all three filters.

So, filter 1 puts the source and medium into custom field 1.

The second filter reads the custom field from filter 1 and adds the term to what was already there.

The final filter adds the custom field we built in the previous two filters to the transaction id.

This is why the order of these filters is so important. They will not work out of sequence (they also should be next to each other on the filter list).

I didn't use two separate custom fields (although I could have) because I really only needed one.

As far as 'naming' the filter fields, you can't do that. You are given two custom fields you can use. I didn't actually name those, I selected them from the pulldown. Thanks for reading!

June 5, 2007 3:10 PM

Will said:

Great post Shawn - this is gold.

I have a question related to this subject. What I really want to do is to take this info (source and keyword) and pass it into a contact form so that we can implement closed-loop tracking of enquiries.

Do you have any ideas on how that might be done?

Bests,
Will

June 14, 2007 4:05 AM

Shawn Purtell said:

@Will:

It can be done. There are actually two methods I know of to do this. Unfortunately, this kind of thing is too advanced for a blog comment, but feel free to contact us if you want help setting this up.

June 14, 2007 9:07 AM

Al said:

Can this be done for organic traffic ? i.e. finding the keywords that deliver conversions from non-paid natural / SEO sources ? Cheers - Al

July 30, 2007 11:31 AM

Shawn Purtell said:

@Al:

These filters will include organic keywords as well. You can check out the screenshot above for some examples of this.

Thanks for reading!

July 30, 2007 11:50 AM

Brian Hinkle said:

Shawn-

Excellent work. I've just started using GA and was annoyed that there was no built-in functionality for that sort of origin tracking in ecommerce transactions - glad to see it can be added fairly easily!

July 30, 2007 2:38 PM

Shawn Purtell said:

@Brian:

That's the whole idea - making this awesome free tool (GA) more and more useful.

Thanks for the comment!

July 30, 2007 2:50 PM

Fonts said:

I use it and get some interesting (great) results. Some transactions are direct which I assume are bookmarked traffic

#312676 (direct) - (none) ()

and other transactions are like the one below do not have a value for the keyword I suppose since it is another site sending the traffic.

#312632 some-referring-site.com - referral ()

Everything else looks killer!

Thanks.

July 31, 2007 1:48 PM

Shawn Purtell said:

@Fonts:

Thanks for the feedback! Direct sources can mean a couple different things. Usually it means a user typed your URL into the browser directly, but there are some other things that will cause this, like email visits from a program like Outlook.

And you are correct with your second point - referring sites obviously will not have any keyword data, and so the parentheses will be blank.

Thanks again for the feedback!

August 2, 2007 3:58 PM

Nathan Scheffey said:

This is a great use of filters to achieve an extremely useful result. However, I think combining it with your excellent Exact Keyword Matching script really takes it to the next level.
I added another filter to append the User Defined Value (the exact keyword) after the Campaign Term. Now my transaction data shows the exact search string that led to the conversion. Very cool.
Question: is there a place to learn the syntax used in these custom filters (e.g. $A1 ($B1))? It seems pretty straightforward but I can't find any information about it in the GA Help documentation.
Anyway, thank you all for your excellent tools, they really take Google Analytics from good to great.

August 2, 2007 5:55 PM

Shawn Purtell said:

@Nathan:

I agree. If you have Michael's exact keyword tracking script installed, this is a great addition, and we actually do that ourselves.

To be honest, I don't have a specific resource for you concerning regular expression string matching variables, but there are lots of great books and websites on the subject.

August 3, 2007 8:53 AM

Neil said:

Hi Shawn.

I've tried doing this on 2 different analytics accounts, and can't get it to work.

I've copied everything word for word, but the keywords are never added. Could it be because the screenshots are of the previous version of analytics?

August 17, 2007 11:13 AM

Shawn Purtell said:

@Neil:

These filters have been tested and confirmed in the new version of Google Analytics.

I can't say for sure where your problem is occurring, but I can tell you that these filters work fine if used properly.

Is it possible you are having problems with your referring source tracking? Also, remember that keywords only show up for organic and cpc results - not for anything else (referrals, direct, banners, and other sources do not have keywords associated with them).

August 20, 2007 8:51 AM

Prince said:

Great stuff Shawn, very usefull.

Just having 1 problem, the first filter that grabs the source and medium, in the output filed you have $A1 - $B1

Thats exatly how I entered it but in my Transaction I am not getting the "source" I do get the keywords

So I get something like this:
Order27 $A (keyword)

August 21, 2007 12:01 AM

Neil said:

It works! Sort off...

Thanks for your help Shawn. I've just logged into Analytics, and it seems that the filters need to be in place for 24 hours to return anything.

Only wish I should filter on Adwords Campaigns instead of Campaigns (no option that I can see).

August 21, 2007 7:19 AM

Shawn Purtell said:

@Prince:

Looks like there's a problem with one of your filters - the third one I believe (specifically the $A1 part). Make sure there is no space between the $A and the 1. I can tell there is something wrong with your output field because '$A' is showing up in your data, and it should never do that.

August 21, 2007 9:15 AM

Shawn Purtell said:

@Neil:

Glad you got things working. And yeah, Google Analytics data generally takes 24 hours to update completely, so anytime you make a change, you need to give it time.

As to your other wish, I'm not really sure what you're asking. There are filters that can do all kinds of things. If you can be more specific, I may be able to help.

August 21, 2007 9:17 AM

Neil Munn said:

I'm accessing Analytics through my Adwords account. This means all my campaigns are listed under Adword campaigns, which isn't shown in the filters dropdown.

What I'm trying to do is, display the keyword(s) that the user types in to make their transaction eg:

Transaction ID, Source, Medium, (Keyword)

Is this possible?

August 22, 2007 5:59 AM

Shawn Purtell said:

@Neil:

The filter set I provided does this automatically, if the keyword exists. You can see in the image above that the keyword should be present for all organic and cpc (including AdWords) sources.

You should not need any additional filters to achieve this result. If you aren't seeing this data, you may not have the filters set up properly.

*Note - There is a difference between 'what the user types in' and the keyword you are bidding on.

The 'term the user typed in' is called the search term while the keyword you bid on is called the bid term. The bid term is the information you will see.

To find out how to get search term info as well, visit Michael's awesome solution here.

August 22, 2007 9:33 AM

Netmeg said:

Hello - I've been using this filter pretty much since you posted it, and it worked just fine. But I created a new profile for it, and it hasn't worked since. Could it be the new Google Analytics code? I then tried to put it back on the original profile on which I had it, and it *still* doesn't work. I haven't changed any of the code, I have the three filters in the proper order - the only thing that has changed was the Google analytics code. And actually, I'm testing that on still another profile, so I'm not entirely sure what's going on now.

January 22, 2008 11:08 AM

Netmeg said:

As an update to my previous post, I went and checked, and between and my partners, five ecommerce sites that were using this filter ALL stopped displaying the data on January 15th. How weird is that? Google must have changed something.

January 22, 2008 1:34 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

There have actually been reports of all advanced filters breaking around that same date, but many people have also stated that their filters have begun to work again. I'd check the more recent data again. In the meantime, we're conducting our own investigation concerning why advanced filters have had this little hiccup, and we'll let you know if we find anything important.

January 23, 2008 8:59 AM

Netmeg said:

As of today, 1/23/2008, none of our advanced filters are working.

Thanks in advance for anything you find out.

January 23, 2008 10:51 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

After examining some other data and situations with both custom and advanced filters, it seems this is an issue many people are experiencing. From the Google Analytics help group to our own data, we have noticed two things:

Many custom filters seemed to stop functioning for several accounts for a brief period around Jan8th, but resumed working on the 15th. This includes custom includes and other custom filters.

Advanced filters that use custom fields, however, seems to be having more trouble, and in many cases have not worked since the 15th on January. Among these kinds of filters is the filter described in this article.

As soon as we get a good explanation as to what's been causing these errors, I'll be sure to post an update here.

January 29, 2008 10:42 AM

Steve Racicot said:

Is anyone using this advanced filters getting data? Is it working correctly?

I have had this installed for over a week and have seen no changes to my transaction list under Eccommerce -> Transactions.

Steve

February 18, 2008 11:14 AM

Jeremy Aube said:

@Steve

Any advanced filters that use custom fields have not been working since January 15th, including this one. This should be a temporary issues, but in the meantime, we have posted an article on an alternate set of filters you can use that function exactly the same as this set. You can get your filters there, and then refer to Shawn's article here for addition instruction and information.

February 18, 2008 3:55 PM

Imran Khan said:

Really informative post.
One question: Where can I find the Transaction List, the last image. I am using the old version of analytics code.

Thanks in advance

February 20, 2008 6:39 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Imran:

The Transaction list is under the Ecommerce section in Google Analytics, and will only show up if you have turned on Ecommerce in your profile settings. The exact report you're looking for is called Transactions.

As a note here, I realize these filters have not been working correctly since Jan. 15th. The filters are still correct, but there was a bug with custom fields (which these filters use) that is being resolved. Until then, feel free to look at Jeremy's update, which gets around this temporary issue.

February 20, 2008 8:57 AM

Asher said:

Have these filters every returned to working properly? I added them before reading to the bottom of the comments. I'm finding that when I view transactions I get the transaction number followed by the state.

June 9, 2008 10:49 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Asher:

These filters have been working correctly for a while now. These three filters do not affect the state of a user, so I wonder why you are seeing that information within Google Analytics. My hunch is that either there is a problem with the way you've set up the filters in your profile, or you have another filter that's using the Custom Field that's interfering with the transaction filters. Unfortunately, it's hard to tell you exactly what the problem is without seeing your filter setup.

June 9, 2008 1:15 PM

Duff said:

First of all, great post, Shawn.

I'm having a problem though.
I paid for a banner on another website. The link to my website is tagged properly:
http://www.mywebsite.com?utm_source=Other%2BWebsite&utm_medium=Banner&utm_campaign=Other%2BWebsite

I am getting some transactions through this banner but in my transaction list all I can see is:
mytransID mywebsite.com-referral (mywebsite.com)

However, of course I would like to be able to see:
mytransID Other Website-Banner ()

Do you have any idea about what did I do wrong?

July 23, 2008 5:57 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff:

It looks like you're getting what we call 'self-referrals' - meaning Google Analytics is registering visits from your own site. This actually has nothing to do with the filters, as those look like they are working.

Self-referrals can occur for many different reasons, but the three most common are:

1. Some pages on your site are missing Google Analytics code.
2. You use multiple subdomains and haven't set up the Google Analytics code for subdomains.
3. Your site has multiple main domains.

If any of these apply to you, then you've most likely found the reason for your self-referrals. If none of these apply to you, there may be another problem with your Google Analytics installation, and I'd have to actually see it in order to diagnose the problem.

July 23, 2008 8:41 AM

Duff said:

Just wanted to thank you coz it is now working properly. Indeed, I use 2 domains, one for the website and another one for payments. Again, thanks a lot!

July 24, 2008 11:28 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff: Glad I could help. Thanks for reading!

July 25, 2008 8:08 AM

Tim said:

Hi Sean - I have an old website that we are redirecting all traffic to our new site. I would like to know which specific transactions are coming from the old site. We are using 301 redirects on individual pages. I tried your examples and it is not picking up the old website as the source or medium... Do you have any advice? Thanks

August 26, 2008 3:09 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Tim: I'm pretty sure Jeremy already answered this on a different blog article, but I agree with him that the only real way to do this effectively with Google Analytics is to add a query parameter to the end of the 301 redirect and then use the Site Search report within Google Analytics to see which transactions are coming from customers who were trying to find the old site.

August 28, 2008 7:44 AM

juan cruz aliaga said:

Hi Shawn, great post!
I am arriving late to this one, but I can see how useful could it be to avoid double counting on orders/transactions.
I was just wondering if the associated keywords would be the last ones used on any campaing source and medium. If so, and to keep track of visitors previous visits to purchase, couldn't we also grab the visitor ID (with a new filter) and appends it to the rest of the info??

Rgds,

jc

February 17, 2009 4:25 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Juan:

Just like with normal Google Analytics tracking, the keyword/source/medium reported with the transaction will be the most recent. Also, in regards to your question about visitor ID - that depends on where the ID is stored. There is no built-in visitor ID filter field in Google Analytics for this, but you could send the data from your database to Google Analytics with each transaction using the ecommerce code. If you do this, you'll probably want to read over the Google Analytics Terms of Service just to make sure the information you're passing isn't considered personally identifiable.

February 17, 2009 8:19 AM

liz rz said:

Hi, this is a great filter, but was wondering how i could modify it to show me the transaction date which is a sortable list so i can see which are the most recent orders...with the existing filter i can only sort by revenue, tax, shipping, quantity. I know i can choose date range for the same info, but a sort would be easier. Thanks, this very useful info.

February 19, 2009 10:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

Probably the easiest way to do this is to use Andre Scholten's Table Sorter add-on for Google Analytics (the site is in Dutch). This is also included in the Better Google Analytics Firefox addon from VKI Studios.

February 19, 2009 10:42 AM

liz rz said:

I've added the filters above and now I'd like to export the data to be able to sort the data into a spreadsheet. There is no seperator between the data fields so I can't seperate the referring source and the keyword. Any ideas?

April 20, 2009 10:32 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

It's a little advanced, but you could run a macro on the spreadsheet that splits up the data for you. That's really the only way that I can see doing this quickly. Moving forward, you could modify the filters so that they contain a separator.

April 20, 2009 11:24 AM

liz rz said:

Thanks Shawn! Can you tell me how to add the data separator to the filters, or point toward a resource where I can learn? This is very helpful! Thanks.

April 24, 2009 8:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

In the filters above, you can modify the Output field at the very bottom of each filter to add your own separators. In my example, I use a dash in filter one, parentheses in filter two, and just a space in filter three. You could easily modify these fields to use a different separator (like a comma) that's easier for you.

April 24, 2009 8:46 AM

mp said:

Thank you for great post. We are using Google Analytic about one year. This solution going to change new transactions. Is there is any way to run it on existing data? I'm just wonder is it possible to achieve the same results with advanced reports?
Thank you for your time.

August 6, 2009 1:06 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You could also use the Secondary Segment dropdown in the Transactions report to some extent. With Jeremy's Google Analytics Report Enhancer, you can segment by source/medium. You could use Advanced Segments to look at a specific medium (cpc for example), and then use the Secondary Segment to look at keyword.

I don't think there's a simple way to do all of this in one step, but the information is there, you just may have to dig for it a little.

August 6, 2009 8:12 AM

mp said:

Hello,

I'm trying to add product name to report and result will be like:
tranID | source | medium | keyword | item_name1 item_name2
I'm using the same filters as use I just added new filter that concatenate item name custom_field.
Trans List Mod 1 \x96 same Trans List Mod 1 - separator |
Trans List Mod 2 - same Trans List Mod 2 \x96 separator |
Trans List Mod 3 - add item name to custom field
Field A -> Extract A Custom Field 1 (.*)
Field B -> Extract B E-commerce Item Name (.*)
Output To -> Constructor Custom Field 1 $A1 | $B1
Field A Required Yes
Field B Required Yes/No tried both
Override Output Field Yes
Case Sensitive No
Trans List Mod 4 - same as Trans List Mod 3. \x96 separator |
As a result I'm getting douplicate rows one with item name and another without. Could you please point me the right direction?
Thank you for your time.

August 28, 2009 7:04 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You're going to run into several issues when using any filter that looks at both transactions and products at the same time. The primary issue here is that a single transaction can be associated with more than one product, which means that Google Analytics stores these pieces of data separately within the original database (and maybe even within different databases).

The easiest way to get the product information for a specific transaction is to just click on the ID. You'll then see a list of products in the transaction.

You may also have some success with an opposite approach, although I haven't tried this yet - try adding the transaction ID and source, etc. to the product name (sort of the reverse of what you're doing). As a caution, I would try this in a separate test profile, but it should give you the same kind of report that you were looking for. Hope that helps!

September 1, 2009 10:10 AM

Anagha said:

How can I append the exact search term also to the end of this PPC keyword so I can see which keyword triggered the transaction. What filter should I use

December 14, 2009 2:00 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

Google Analytics does not currently capture the exact search term, so you would have to use a workaround like the one mentioned in this article. Then you would have to modify the filter to include the User Defined variable or whichever field you are using to store the exact search query.

December 14, 2009 9:21 AM

Anagha said:

Thank You for your prompt reply. I wanted to do this using filters and not scripts since I dont have access to the Clients page. So I tried using the filters shown on this page in addition to the filters from http://www.semvironment.com/ppc-management-adwords-keyword-data-exposed-with-google-analytics/.
I applied exact query filters first (referral etc) stored in custom field 2, then applied the filters on this page and appended the custom field 2 to it. But it didnt show the exact keywords for transactions. Am I doing something wrong. Can this be done. Please help

December 14, 2009 8:22 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

I've found those keyword filters from semvironment to not work properly - and also to break conversion and transaction tracking data within the reports. It's actually what prompted us to create the custom script in the first place.

Currently, the only method I've seen to do what you need is to use the custom scripts. This will only change if Google makes the Exact Search Query available within the Google Analytics fields.

December 15, 2009 9:03 AM

Jordan Glogau said:

Shawn:

Its been some time since your described your three filter technique. Do you still think this is the best path to match specific transactions to particular channels?

Do you know anyone that's tried to reconciled this methods with their accounting data. This is something that you can do with Coremetrics?

BTW, I saw you method in Biran Clifton's book and the most important piece of advice he left out, set up a different profile since this stuff can break your data.

Thank you for this helpful post.

August 27, 2011 4:08 PM

Chris said:

Hi Shawn,

We've also done some work with this and also had a lot of head scratching to get the results - great post though and cleared up a couple of areas. Regards

Chris

May 3, 2007 4:56 AM

Shawn Purtell said:

@Chris:

Thanks for the nice comment. Let me know if these new filters work out for you. I've only been using them for a little while, so it would be great to get some feedback.

May 3, 2007 8:42 AM

Mikey said:

Hi Shawn,

Great post mate. Like Chris, I've been scratching my head over this & have a couple of clients that will absolutely love this. Thanks :)

Mikey

May 3, 2007 8:22 PM

Shawn Purtell said:

@Mikey:

Thanks! I hope it turns out to be as useful as I think it might. I'd love to hear feedback from you once you've used the filters with clients.

May 4, 2007 9:05 AM

Krista said:

Great Post. These advanced filters are very usefull. I took your training course on Google Analytics. I was wondering if in the future you are going to offer a whole course on advanced implementation and setup where filters like these are taught and where regular expressions could be learned?

May 17, 2007 10:31 AM

Shawn Purtell said:

@Krista:

Thanks for the compliment. The training course that you took includes the most common advanced implementation options that we've encountered (things like Paypal, cross-domain tracking, etc.). We've also included the general ideas about the types of filters you can create. We're currently revamping the course for our new training series, and it will include more about filters and how you can use them to accomplish specific tasks.

In order to get more specific than that, you really need one-on-one attention, because setting up advanced filters really depends on your site and what kinds of information you want to find. This is one example of something our support plans can do for you on an individual level. We try our best to make this information freely available through our blog.

The same sort of thing applies to regular expressions. Regular expressions can get extremely complex, so we covered the most basic/common ones that you can use in our training course. Again, the more advanced regular expressions are only needed in very specific situations that would require one on one attention.

This brings up another point: Google Analytics is like getting a suit (or dress) fitted - you need to take measurements and personal tastes into consideration when you are setting up analytics. There are some steps that are universally important, but when you start looking at your individual site, no two Google Analytics configurations will be exactly alike.

I hope you found this useful. Thanks again for posting and for taking our course!

May 17, 2007 11:13 AM

Shareen Jordan said:

Hi, Shawn.

I really enjoy reading your blog. Thanks for the information. I was wondering, in the first filter you name the constructor field 'custom field 1' and you call it the same thing in the next filter. But (I think)the second filter refers to the custom filed in the first filter. If they are both named the same thing, does the field from the 1st filter overwrite the field from the second filter? And is there any reason why you wouldn't name them differently? Would there be any benefit in naming them customer field 1 and customer field 2?

Thanks! Shareen

June 5, 2007 3:04 PM

Shawn Purtell said:

@Shareen:

Thanks for the compliments. As far as your question, I only had to use a single custom field across all three filters.

So, filter 1 puts the source and medium into custom field 1.

The second filter reads the custom field from filter 1 and adds the term to what was already there.

The final filter adds the custom field we built in the previous two filters to the transaction id.

This is why the order of these filters is so important. They will not work out of sequence (they also should be next to each other on the filter list).

I didn't use two separate custom fields (although I could have) because I really only needed one.

As far as 'naming' the filter fields, you can't do that. You are given two custom fields you can use. I didn't actually name those, I selected them from the pulldown. Thanks for reading!

June 5, 2007 3:10 PM

Will said:

Great post Shawn - this is gold.

I have a question related to this subject. What I really want to do is to take this info (source and keyword) and pass it into a contact form so that we can implement closed-loop tracking of enquiries.

Do you have any ideas on how that might be done?

Bests,
Will

June 14, 2007 4:05 AM

Shawn Purtell said:

@Will:

It can be done. There are actually two methods I know of to do this. Unfortunately, this kind of thing is too advanced for a blog comment, but feel free to contact us if you want help setting this up.

June 14, 2007 9:07 AM

Al said:

Can this be done for organic traffic ? i.e. finding the keywords that deliver conversions from non-paid natural / SEO sources ? Cheers - Al

July 30, 2007 11:31 AM

Shawn Purtell said:

@Al:

These filters will include organic keywords as well. You can check out the screenshot above for some examples of this.

Thanks for reading!

July 30, 2007 11:50 AM

Brian Hinkle said:

Shawn-

Excellent work. I've just started using GA and was annoyed that there was no built-in functionality for that sort of origin tracking in ecommerce transactions - glad to see it can be added fairly easily!

July 30, 2007 2:38 PM

Shawn Purtell said:

@Brian:

That's the whole idea - making this awesome free tool (GA) more and more useful.

Thanks for the comment!

July 30, 2007 2:50 PM

Fonts said:

I use it and get some interesting (great) results. Some transactions are direct which I assume are bookmarked traffic

#312676 (direct) - (none) ()

and other transactions are like the one below do not have a value for the keyword I suppose since it is another site sending the traffic.

#312632 some-referring-site.com - referral ()

Everything else looks killer!

Thanks.

July 31, 2007 1:48 PM

Shawn Purtell said:

@Fonts:

Thanks for the feedback! Direct sources can mean a couple different things. Usually it means a user typed your URL into the browser directly, but there are some other things that will cause this, like email visits from a program like Outlook.

And you are correct with your second point - referring sites obviously will not have any keyword data, and so the parentheses will be blank.

Thanks again for the feedback!

August 2, 2007 3:58 PM

Nathan Scheffey said:

This is a great use of filters to achieve an extremely useful result. However, I think combining it with your excellent Exact Keyword Matching script really takes it to the next level.
I added another filter to append the User Defined Value (the exact keyword) after the Campaign Term. Now my transaction data shows the exact search string that led to the conversion. Very cool.
Question: is there a place to learn the syntax used in these custom filters (e.g. $A1 ($B1))? It seems pretty straightforward but I can't find any information about it in the GA Help documentation.
Anyway, thank you all for your excellent tools, they really take Google Analytics from good to great.

August 2, 2007 5:55 PM

Shawn Purtell said:

@Nathan:

I agree. If you have Michael's exact keyword tracking script installed, this is a great addition, and we actually do that ourselves.

To be honest, I don't have a specific resource for you concerning regular expression string matching variables, but there are lots of great books and websites on the subject.

August 3, 2007 8:53 AM

Neil said:

Hi Shawn.

I've tried doing this on 2 different analytics accounts, and can't get it to work.

I've copied everything word for word, but the keywords are never added. Could it be because the screenshots are of the previous version of analytics?

August 17, 2007 11:13 AM

Shawn Purtell said:

@Neil:

These filters have been tested and confirmed in the new version of Google Analytics.

I can't say for sure where your problem is occurring, but I can tell you that these filters work fine if used properly.

Is it possible you are having problems with your referring source tracking? Also, remember that keywords only show up for organic and cpc results - not for anything else (referrals, direct, banners, and other sources do not have keywords associated with them).

August 20, 2007 8:51 AM

Prince said:

Great stuff Shawn, very usefull.

Just having 1 problem, the first filter that grabs the source and medium, in the output filed you have $A1 - $B1

Thats exatly how I entered it but in my Transaction I am not getting the "source" I do get the keywords

So I get something like this:
Order27 $A (keyword)

August 21, 2007 12:01 AM

Neil said:

It works! Sort off...

Thanks for your help Shawn. I've just logged into Analytics, and it seems that the filters need to be in place for 24 hours to return anything.

Only wish I should filter on Adwords Campaigns instead of Campaigns (no option that I can see).

August 21, 2007 7:19 AM

Shawn Purtell said:

@Prince:

Looks like there's a problem with one of your filters - the third one I believe (specifically the $A1 part). Make sure there is no space between the $A and the 1. I can tell there is something wrong with your output field because '$A' is showing up in your data, and it should never do that.

August 21, 2007 9:15 AM

Shawn Purtell said:

@Neil:

Glad you got things working. And yeah, Google Analytics data generally takes 24 hours to update completely, so anytime you make a change, you need to give it time.

As to your other wish, I'm not really sure what you're asking. There are filters that can do all kinds of things. If you can be more specific, I may be able to help.

August 21, 2007 9:17 AM

Neil Munn said:

I'm accessing Analytics through my Adwords account. This means all my campaigns are listed under Adword campaigns, which isn't shown in the filters dropdown.

What I'm trying to do is, display the keyword(s) that the user types in to make their transaction eg:

Transaction ID, Source, Medium, (Keyword)

Is this possible?

August 22, 2007 5:59 AM

Shawn Purtell said:

@Neil:

The filter set I provided does this automatically, if the keyword exists. You can see in the image above that the keyword should be present for all organic and cpc (including AdWords) sources.

You should not need any additional filters to achieve this result. If you aren't seeing this data, you may not have the filters set up properly.

*Note - There is a difference between 'what the user types in' and the keyword you are bidding on.

The 'term the user typed in' is called the search term while the keyword you bid on is called the bid term. The bid term is the information you will see.

To find out how to get search term info as well, visit Michael's awesome solution here.

August 22, 2007 9:33 AM

Netmeg said:

Hello - I've been using this filter pretty much since you posted it, and it worked just fine. But I created a new profile for it, and it hasn't worked since. Could it be the new Google Analytics code? I then tried to put it back on the original profile on which I had it, and it *still* doesn't work. I haven't changed any of the code, I have the three filters in the proper order - the only thing that has changed was the Google analytics code. And actually, I'm testing that on still another profile, so I'm not entirely sure what's going on now.

January 22, 2008 11:08 AM

Netmeg said:

As an update to my previous post, I went and checked, and between and my partners, five ecommerce sites that were using this filter ALL stopped displaying the data on January 15th. How weird is that? Google must have changed something.

January 22, 2008 1:34 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

There have actually been reports of all advanced filters breaking around that same date, but many people have also stated that their filters have begun to work again. I'd check the more recent data again. In the meantime, we're conducting our own investigation concerning why advanced filters have had this little hiccup, and we'll let you know if we find anything important.

January 23, 2008 8:59 AM

Netmeg said:

As of today, 1/23/2008, none of our advanced filters are working.

Thanks in advance for anything you find out.

January 23, 2008 10:51 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

After examining some other data and situations with both custom and advanced filters, it seems this is an issue many people are experiencing. From the Google Analytics help group to our own data, we have noticed two things:

Many custom filters seemed to stop functioning for several accounts for a brief period around Jan8th, but resumed working on the 15th. This includes custom includes and other custom filters.

Advanced filters that use custom fields, however, seems to be having more trouble, and in many cases have not worked since the 15th on January. Among these kinds of filters is the filter described in this article.

As soon as we get a good explanation as to what's been causing these errors, I'll be sure to post an update here.

January 29, 2008 10:42 AM

Steve Racicot said:

Is anyone using this advanced filters getting data? Is it working correctly?

I have had this installed for over a week and have seen no changes to my transaction list under Eccommerce -> Transactions.

Steve

February 18, 2008 11:14 AM

Jeremy Aube said:

@Steve

Any advanced filters that use custom fields have not been working since January 15th, including this one. This should be a temporary issues, but in the meantime, we have posted an article on an alternate set of filters you can use that function exactly the same as this set. You can get your filters there, and then refer to Shawn's article here for addition instruction and information.

February 18, 2008 3:55 PM

Imran Khan said:

Really informative post.
One question: Where can I find the Transaction List, the last image. I am using the old version of analytics code.

Thanks in advance

February 20, 2008 6:39 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Imran:

The Transaction list is under the Ecommerce section in Google Analytics, and will only show up if you have turned on Ecommerce in your profile settings. The exact report you're looking for is called Transactions.

As a note here, I realize these filters have not been working correctly since Jan. 15th. The filters are still correct, but there was a bug with custom fields (which these filters use) that is being resolved. Until then, feel free to look at Jeremy's update, which gets around this temporary issue.

February 20, 2008 8:57 AM

Asher said:

Have these filters every returned to working properly? I added them before reading to the bottom of the comments. I'm finding that when I view transactions I get the transaction number followed by the state.

June 9, 2008 10:49 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Asher:

These filters have been working correctly for a while now. These three filters do not affect the state of a user, so I wonder why you are seeing that information within Google Analytics. My hunch is that either there is a problem with the way you've set up the filters in your profile, or you have another filter that's using the Custom Field that's interfering with the transaction filters. Unfortunately, it's hard to tell you exactly what the problem is without seeing your filter setup.

June 9, 2008 1:15 PM

Duff said:

First of all, great post, Shawn.

I'm having a problem though.
I paid for a banner on another website. The link to my website is tagged properly:
http://www.mywebsite.com?utm_source=Other%2BWebsite&utm_medium=Banner&utm_campaign=Other%2BWebsite

I am getting some transactions through this banner but in my transaction list all I can see is:
mytransID mywebsite.com-referral (mywebsite.com)

However, of course I would like to be able to see:
mytransID Other Website-Banner ()

Do you have any idea about what did I do wrong?

July 23, 2008 5:57 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff:

It looks like you're getting what we call 'self-referrals' - meaning Google Analytics is registering visits from your own site. This actually has nothing to do with the filters, as those look like they are working.

Self-referrals can occur for many different reasons, but the three most common are:

1. Some pages on your site are missing Google Analytics code.
2. You use multiple subdomains and haven't set up the Google Analytics code for subdomains.
3. Your site has multiple main domains.

If any of these apply to you, then you've most likely found the reason for your self-referrals. If none of these apply to you, there may be another problem with your Google Analytics installation, and I'd have to actually see it in order to diagnose the problem.

July 23, 2008 8:41 AM

Duff said:

Just wanted to thank you coz it is now working properly. Indeed, I use 2 domains, one for the website and another one for payments. Again, thanks a lot!

July 24, 2008 11:28 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff: Glad I could help. Thanks for reading!

July 25, 2008 8:08 AM

Tim said:

Hi Sean - I have an old website that we are redirecting all traffic to our new site. I would like to know which specific transactions are coming from the old site. We are using 301 redirects on individual pages. I tried your examples and it is not picking up the old website as the source or medium... Do you have any advice? Thanks

August 26, 2008 3:09 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Tim: I'm pretty sure Jeremy already answered this on a different blog article, but I agree with him that the only real way to do this effectively with Google Analytics is to add a query parameter to the end of the 301 redirect and then use the Site Search report within Google Analytics to see which transactions are coming from customers who were trying to find the old site.

August 28, 2008 7:44 AM

juan cruz aliaga said:

Hi Shawn, great post!
I am arriving late to this one, but I can see how useful could it be to avoid double counting on orders/transactions.
I was just wondering if the associated keywords would be the last ones used on any campaing source and medium. If so, and to keep track of visitors previous visits to purchase, couldn't we also grab the visitor ID (with a new filter) and appends it to the rest of the info??

Rgds,

jc

February 17, 2009 4:25 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Juan:

Just like with normal Google Analytics tracking, the keyword/source/medium reported with the transaction will be the most recent. Also, in regards to your question about visitor ID - that depends on where the ID is stored. There is no built-in visitor ID filter field in Google Analytics for this, but you could send the data from your database to Google Analytics with each transaction using the ecommerce code. If you do this, you'll probably want to read over the Google Analytics Terms of Service just to make sure the information you're passing isn't considered personally identifiable.

February 17, 2009 8:19 AM

liz rz said:

Hi, this is a great filter, but was wondering how i could modify it to show me the transaction date which is a sortable list so i can see which are the most recent orders...with the existing filter i can only sort by revenue, tax, shipping, quantity. I know i can choose date range for the same info, but a sort would be easier. Thanks, this very useful info.

February 19, 2009 10:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

Probably the easiest way to do this is to use Andre Scholten's Table Sorter add-on for Google Analytics (the site is in Dutch). This is also included in the Better Google Analytics Firefox addon from VKI Studios.

February 19, 2009 10:42 AM

liz rz said:

I've added the filters above and now I'd like to export the data to be able to sort the data into a spreadsheet. There is no seperator between the data fields so I can't seperate the referring source and the keyword. Any ideas?

April 20, 2009 10:32 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

It's a little advanced, but you could run a macro on the spreadsheet that splits up the data for you. That's really the only way that I can see doing this quickly. Moving forward, you could modify the filters so that they contain a separator.

April 20, 2009 11:24 AM

liz rz said:

Thanks Shawn! Can you tell me how to add the data separator to the filters, or point toward a resource where I can learn? This is very helpful! Thanks.

April 24, 2009 8:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

In the filters above, you can modify the Output field at the very bottom of each filter to add your own separators. In my example, I use a dash in filter one, parentheses in filter two, and just a space in filter three. You could easily modify these fields to use a different separator (like a comma) that's easier for you.

April 24, 2009 8:46 AM

mp said:

Thank you for great post. We are using Google Analytic about one year. This solution going to change new transactions. Is there is any way to run it on existing data? I'm just wonder is it possible to achieve the same results with advanced reports?
Thank you for your time.

August 6, 2009 1:06 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You could also use the Secondary Segment dropdown in the Transactions report to some extent. With Jeremy's Google Analytics Report Enhancer, you can segment by source/medium. You could use Advanced Segments to look at a specific medium (cpc for example), and then use the Secondary Segment to look at keyword.

I don't think there's a simple way to do all of this in one step, but the information is there, you just may have to dig for it a little.

August 6, 2009 8:12 AM

mp said:

Hello,

I'm trying to add product name to report and result will be like:
tranID | source | medium | keyword | item_name1 item_name2
I'm using the same filters as use I just added new filter that concatenate item name custom_field.
Trans List Mod 1 \x96 same Trans List Mod 1 - separator |
Trans List Mod 2 - same Trans List Mod 2 \x96 separator |
Trans List Mod 3 - add item name to custom field
Field A -> Extract A Custom Field 1 (.*)
Field B -> Extract B E-commerce Item Name (.*)
Output To -> Constructor Custom Field 1 $A1 | $B1
Field A Required Yes
Field B Required Yes/No tried both
Override Output Field Yes
Case Sensitive No
Trans List Mod 4 - same as Trans List Mod 3. \x96 separator |
As a result I'm getting douplicate rows one with item name and another without. Could you please point me the right direction?
Thank you for your time.

August 28, 2009 7:04 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You're going to run into several issues when using any filter that looks at both transactions and products at the same time. The primary issue here is that a single transaction can be associated with more than one product, which means that Google Analytics stores these pieces of data separately within the original database (and maybe even within different databases).

The easiest way to get the product information for a specific transaction is to just click on the ID. You'll then see a list of products in the transaction.

You may also have some success with an opposite approach, although I haven't tried this yet - try adding the transaction ID and source, etc. to the product name (sort of the reverse of what you're doing). As a caution, I would try this in a separate test profile, but it should give you the same kind of report that you were looking for. Hope that helps!

September 1, 2009 10:10 AM

Anagha said:

How can I append the exact search term also to the end of this PPC keyword so I can see which keyword triggered the transaction. What filter should I use

December 14, 2009 2:00 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

Google Analytics does not currently capture the exact search term, so you would have to use a workaround like the one mentioned in this article. Then you would have to modify the filter to include the User Defined variable or whichever field you are using to store the exact search query.

December 14, 2009 9:21 AM

Anagha said:

Thank You for your prompt reply. I wanted to do this using filters and not scripts since I dont have access to the Clients page. So I tried using the filters shown on this page in addition to the filters from http://www.semvironment.com/ppc-management-adwords-keyword-data-exposed-with-google-analytics/.
I applied exact query filters first (referral etc) stored in custom field 2, then applied the filters on this page and appended the custom field 2 to it. But it didnt show the exact keywords for transactions. Am I doing something wrong. Can this be done. Please help

December 14, 2009 8:22 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

I've found those keyword filters from semvironment to not work properly - and also to break conversion and transaction tracking data within the reports. It's actually what prompted us to create the custom script in the first place.

Currently, the only method I've seen to do what you need is to use the custom scripts. This will only change if Google makes the Exact Search Query available within the Google Analytics fields.

December 15, 2009 9:03 AM

Jordan Glogau said:

Shawn:

Its been some time since your described your three filter technique. Do you still think this is the best path to match specific transactions to particular channels?

Do you know anyone that's tried to reconciled this methods with their accounting data. This is something that you can do with Coremetrics?

BTW, I saw you method in Biran Clifton's book and the most important piece of advice he left out, set up a different profile since this stuff can break your data.

Thank you for this helpful post.

August 27, 2011 4:08 PM

Chris said:

Hi Shawn,

We've also done some work with this and also had a lot of head scratching to get the results - great post though and cleared up a couple of areas. Regards

Chris

May 3, 2007 4:56 AM

Shawn Purtell said:

@Chris:

Thanks for the nice comment. Let me know if these new filters work out for you. I've only been using them for a little while, so it would be great to get some feedback.

May 3, 2007 8:42 AM

Mikey said:

Hi Shawn,

Great post mate. Like Chris, I've been scratching my head over this & have a couple of clients that will absolutely love this. Thanks :)

Mikey

May 3, 2007 8:22 PM

Shawn Purtell said:

@Mikey:

Thanks! I hope it turns out to be as useful as I think it might. I'd love to hear feedback from you once you've used the filters with clients.

May 4, 2007 9:05 AM

Krista said:

Great Post. These advanced filters are very usefull. I took your training course on Google Analytics. I was wondering if in the future you are going to offer a whole course on advanced implementation and setup where filters like these are taught and where regular expressions could be learned?

May 17, 2007 10:31 AM

Shawn Purtell said:

@Krista:

Thanks for the compliment. The training course that you took includes the most common advanced implementation options that we've encountered (things like Paypal, cross-domain tracking, etc.). We've also included the general ideas about the types of filters you can create. We're currently revamping the course for our new training series, and it will include more about filters and how you can use them to accomplish specific tasks.

In order to get more specific than that, you really need one-on-one attention, because setting up advanced filters really depends on your site and what kinds of information you want to find. This is one example of something our support plans can do for you on an individual level. We try our best to make this information freely available through our blog.

The same sort of thing applies to regular expressions. Regular expressions can get extremely complex, so we covered the most basic/common ones that you can use in our training course. Again, the more advanced regular expressions are only needed in very specific situations that would require one on one attention.

This brings up another point: Google Analytics is like getting a suit (or dress) fitted - you need to take measurements and personal tastes into consideration when you are setting up analytics. There are some steps that are universally important, but when you start looking at your individual site, no two Google Analytics configurations will be exactly alike.

I hope you found this useful. Thanks again for posting and for taking our course!

May 17, 2007 11:13 AM

Shareen Jordan said:

Hi, Shawn.

I really enjoy reading your blog. Thanks for the information. I was wondering, in the first filter you name the constructor field 'custom field 1' and you call it the same thing in the next filter. But (I think)the second filter refers to the custom filed in the first filter. If they are both named the same thing, does the field from the 1st filter overwrite the field from the second filter? And is there any reason why you wouldn't name them differently? Would there be any benefit in naming them customer field 1 and customer field 2?

Thanks! Shareen

June 5, 2007 3:04 PM

Shawn Purtell said:

@Shareen:

Thanks for the compliments. As far as your question, I only had to use a single custom field across all three filters.

So, filter 1 puts the source and medium into custom field 1.

The second filter reads the custom field from filter 1 and adds the term to what was already there.

The final filter adds the custom field we built in the previous two filters to the transaction id.

This is why the order of these filters is so important. They will not work out of sequence (they also should be next to each other on the filter list).

I didn't use two separate custom fields (although I could have) because I really only needed one.

As far as 'naming' the filter fields, you can't do that. You are given two custom fields you can use. I didn't actually name those, I selected them from the pulldown. Thanks for reading!

June 5, 2007 3:10 PM

Will said:

Great post Shawn - this is gold.

I have a question related to this subject. What I really want to do is to take this info (source and keyword) and pass it into a contact form so that we can implement closed-loop tracking of enquiries.

Do you have any ideas on how that might be done?

Bests,
Will

June 14, 2007 4:05 AM

Shawn Purtell said:

@Will:

It can be done. There are actually two methods I know of to do this. Unfortunately, this kind of thing is too advanced for a blog comment, but feel free to contact us if you want help setting this up.

June 14, 2007 9:07 AM

Al said:

Can this be done for organic traffic ? i.e. finding the keywords that deliver conversions from non-paid natural / SEO sources ? Cheers - Al

July 30, 2007 11:31 AM

Shawn Purtell said:

@Al:

These filters will include organic keywords as well. You can check out the screenshot above for some examples of this.

Thanks for reading!

July 30, 2007 11:50 AM

Brian Hinkle said:

Shawn-

Excellent work. I've just started using GA and was annoyed that there was no built-in functionality for that sort of origin tracking in ecommerce transactions - glad to see it can be added fairly easily!

July 30, 2007 2:38 PM

Shawn Purtell said:

@Brian:

That's the whole idea - making this awesome free tool (GA) more and more useful.

Thanks for the comment!

July 30, 2007 2:50 PM

Fonts said:

I use it and get some interesting (great) results. Some transactions are direct which I assume are bookmarked traffic

#312676 (direct) - (none) ()

and other transactions are like the one below do not have a value for the keyword I suppose since it is another site sending the traffic.

#312632 some-referring-site.com - referral ()

Everything else looks killer!

Thanks.

July 31, 2007 1:48 PM

Shawn Purtell said:

@Fonts:

Thanks for the feedback! Direct sources can mean a couple different things. Usually it means a user typed your URL into the browser directly, but there are some other things that will cause this, like email visits from a program like Outlook.

And you are correct with your second point - referring sites obviously will not have any keyword data, and so the parentheses will be blank.

Thanks again for the feedback!

August 2, 2007 3:58 PM

Nathan Scheffey said:

This is a great use of filters to achieve an extremely useful result. However, I think combining it with your excellent Exact Keyword Matching script really takes it to the next level.
I added another filter to append the User Defined Value (the exact keyword) after the Campaign Term. Now my transaction data shows the exact search string that led to the conversion. Very cool.
Question: is there a place to learn the syntax used in these custom filters (e.g. $A1 ($B1))? It seems pretty straightforward but I can't find any information about it in the GA Help documentation.
Anyway, thank you all for your excellent tools, they really take Google Analytics from good to great.

August 2, 2007 5:55 PM

Shawn Purtell said:

@Nathan:

I agree. If you have Michael's exact keyword tracking script installed, this is a great addition, and we actually do that ourselves.

To be honest, I don't have a specific resource for you concerning regular expression string matching variables, but there are lots of great books and websites on the subject.

August 3, 2007 8:53 AM

Neil said:

Hi Shawn.

I've tried doing this on 2 different analytics accounts, and can't get it to work.

I've copied everything word for word, but the keywords are never added. Could it be because the screenshots are of the previous version of analytics?

August 17, 2007 11:13 AM

Shawn Purtell said:

@Neil:

These filters have been tested and confirmed in the new version of Google Analytics.

I can't say for sure where your problem is occurring, but I can tell you that these filters work fine if used properly.

Is it possible you are having problems with your referring source tracking? Also, remember that keywords only show up for organic and cpc results - not for anything else (referrals, direct, banners, and other sources do not have keywords associated with them).

August 20, 2007 8:51 AM

Prince said:

Great stuff Shawn, very usefull.

Just having 1 problem, the first filter that grabs the source and medium, in the output filed you have $A1 - $B1

Thats exatly how I entered it but in my Transaction I am not getting the "source" I do get the keywords

So I get something like this:
Order27 $A (keyword)

August 21, 2007 12:01 AM

Neil said:

It works! Sort off...

Thanks for your help Shawn. I've just logged into Analytics, and it seems that the filters need to be in place for 24 hours to return anything.

Only wish I should filter on Adwords Campaigns instead of Campaigns (no option that I can see).

August 21, 2007 7:19 AM

Shawn Purtell said:

@Prince:

Looks like there's a problem with one of your filters - the third one I believe (specifically the $A1 part). Make sure there is no space between the $A and the 1. I can tell there is something wrong with your output field because '$A' is showing up in your data, and it should never do that.

August 21, 2007 9:15 AM

Shawn Purtell said:

@Neil:

Glad you got things working. And yeah, Google Analytics data generally takes 24 hours to update completely, so anytime you make a change, you need to give it time.

As to your other wish, I'm not really sure what you're asking. There are filters that can do all kinds of things. If you can be more specific, I may be able to help.

August 21, 2007 9:17 AM

Neil Munn said:

I'm accessing Analytics through my Adwords account. This means all my campaigns are listed under Adword campaigns, which isn't shown in the filters dropdown.

What I'm trying to do is, display the keyword(s) that the user types in to make their transaction eg:

Transaction ID, Source, Medium, (Keyword)

Is this possible?

August 22, 2007 5:59 AM

Shawn Purtell said:

@Neil:

The filter set I provided does this automatically, if the keyword exists. You can see in the image above that the keyword should be present for all organic and cpc (including AdWords) sources.

You should not need any additional filters to achieve this result. If you aren't seeing this data, you may not have the filters set up properly.

*Note - There is a difference between 'what the user types in' and the keyword you are bidding on.

The 'term the user typed in' is called the search term while the keyword you bid on is called the bid term. The bid term is the information you will see.

To find out how to get search term info as well, visit Michael's awesome solution here.

August 22, 2007 9:33 AM

Netmeg said:

Hello - I've been using this filter pretty much since you posted it, and it worked just fine. But I created a new profile for it, and it hasn't worked since. Could it be the new Google Analytics code? I then tried to put it back on the original profile on which I had it, and it *still* doesn't work. I haven't changed any of the code, I have the three filters in the proper order - the only thing that has changed was the Google analytics code. And actually, I'm testing that on still another profile, so I'm not entirely sure what's going on now.

January 22, 2008 11:08 AM

Netmeg said:

As an update to my previous post, I went and checked, and between and my partners, five ecommerce sites that were using this filter ALL stopped displaying the data on January 15th. How weird is that? Google must have changed something.

January 22, 2008 1:34 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

There have actually been reports of all advanced filters breaking around that same date, but many people have also stated that their filters have begun to work again. I'd check the more recent data again. In the meantime, we're conducting our own investigation concerning why advanced filters have had this little hiccup, and we'll let you know if we find anything important.

January 23, 2008 8:59 AM

Netmeg said:

As of today, 1/23/2008, none of our advanced filters are working.

Thanks in advance for anything you find out.

January 23, 2008 10:51 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

After examining some other data and situations with both custom and advanced filters, it seems this is an issue many people are experiencing. From the Google Analytics help group to our own data, we have noticed two things:

Many custom filters seemed to stop functioning for several accounts for a brief period around Jan8th, but resumed working on the 15th. This includes custom includes and other custom filters.

Advanced filters that use custom fields, however, seems to be having more trouble, and in many cases have not worked since the 15th on January. Among these kinds of filters is the filter described in this article.

As soon as we get a good explanation as to what's been causing these errors, I'll be sure to post an update here.

January 29, 2008 10:42 AM

Steve Racicot said:

Is anyone using this advanced filters getting data? Is it working correctly?

I have had this installed for over a week and have seen no changes to my transaction list under Eccommerce -> Transactions.

Steve

February 18, 2008 11:14 AM

Jeremy Aube said:

@Steve

Any advanced filters that use custom fields have not been working since January 15th, including this one. This should be a temporary issues, but in the meantime, we have posted an article on an alternate set of filters you can use that function exactly the same as this set. You can get your filters there, and then refer to Shawn's article here for addition instruction and information.

February 18, 2008 3:55 PM

Imran Khan said:

Really informative post.
One question: Where can I find the Transaction List, the last image. I am using the old version of analytics code.

Thanks in advance

February 20, 2008 6:39 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Imran:

The Transaction list is under the Ecommerce section in Google Analytics, and will only show up if you have turned on Ecommerce in your profile settings. The exact report you're looking for is called Transactions.

As a note here, I realize these filters have not been working correctly since Jan. 15th. The filters are still correct, but there was a bug with custom fields (which these filters use) that is being resolved. Until then, feel free to look at Jeremy's update, which gets around this temporary issue.

February 20, 2008 8:57 AM

Asher said:

Have these filters every returned to working properly? I added them before reading to the bottom of the comments. I'm finding that when I view transactions I get the transaction number followed by the state.

June 9, 2008 10:49 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Asher:

These filters have been working correctly for a while now. These three filters do not affect the state of a user, so I wonder why you are seeing that information within Google Analytics. My hunch is that either there is a problem with the way you've set up the filters in your profile, or you have another filter that's using the Custom Field that's interfering with the transaction filters. Unfortunately, it's hard to tell you exactly what the problem is without seeing your filter setup.

June 9, 2008 1:15 PM

Duff said:

First of all, great post, Shawn.

I'm having a problem though.
I paid for a banner on another website. The link to my website is tagged properly:
http://www.mywebsite.com?utm_source=Other%2BWebsite&utm_medium=Banner&utm_campaign=Other%2BWebsite

I am getting some transactions through this banner but in my transaction list all I can see is:
mytransID mywebsite.com-referral (mywebsite.com)

However, of course I would like to be able to see:
mytransID Other Website-Banner ()

Do you have any idea about what did I do wrong?

July 23, 2008 5:57 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff:

It looks like you're getting what we call 'self-referrals' - meaning Google Analytics is registering visits from your own site. This actually has nothing to do with the filters, as those look like they are working.

Self-referrals can occur for many different reasons, but the three most common are:

1. Some pages on your site are missing Google Analytics code.
2. You use multiple subdomains and haven't set up the Google Analytics code for subdomains.
3. Your site has multiple main domains.

If any of these apply to you, then you've most likely found the reason for your self-referrals. If none of these apply to you, there may be another problem with your Google Analytics installation, and I'd have to actually see it in order to diagnose the problem.

July 23, 2008 8:41 AM

Duff said:

Just wanted to thank you coz it is now working properly. Indeed, I use 2 domains, one for the website and another one for payments. Again, thanks a lot!

July 24, 2008 11:28 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff: Glad I could help. Thanks for reading!

July 25, 2008 8:08 AM

Tim said:

Hi Sean - I have an old website that we are redirecting all traffic to our new site. I would like to know which specific transactions are coming from the old site. We are using 301 redirects on individual pages. I tried your examples and it is not picking up the old website as the source or medium... Do you have any advice? Thanks

August 26, 2008 3:09 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Tim: I'm pretty sure Jeremy already answered this on a different blog article, but I agree with him that the only real way to do this effectively with Google Analytics is to add a query parameter to the end of the 301 redirect and then use the Site Search report within Google Analytics to see which transactions are coming from customers who were trying to find the old site.

August 28, 2008 7:44 AM

juan cruz aliaga said:

Hi Shawn, great post!
I am arriving late to this one, but I can see how useful could it be to avoid double counting on orders/transactions.
I was just wondering if the associated keywords would be the last ones used on any campaing source and medium. If so, and to keep track of visitors previous visits to purchase, couldn't we also grab the visitor ID (with a new filter) and appends it to the rest of the info??

Rgds,

jc

February 17, 2009 4:25 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Juan:

Just like with normal Google Analytics tracking, the keyword/source/medium reported with the transaction will be the most recent. Also, in regards to your question about visitor ID - that depends on where the ID is stored. There is no built-in visitor ID filter field in Google Analytics for this, but you could send the data from your database to Google Analytics with each transaction using the ecommerce code. If you do this, you'll probably want to read over the Google Analytics Terms of Service just to make sure the information you're passing isn't considered personally identifiable.

February 17, 2009 8:19 AM

liz rz said:

Hi, this is a great filter, but was wondering how i could modify it to show me the transaction date which is a sortable list so i can see which are the most recent orders...with the existing filter i can only sort by revenue, tax, shipping, quantity. I know i can choose date range for the same info, but a sort would be easier. Thanks, this very useful info.

February 19, 2009 10:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

Probably the easiest way to do this is to use Andre Scholten's Table Sorter add-on for Google Analytics (the site is in Dutch). This is also included in the Better Google Analytics Firefox addon from VKI Studios.

February 19, 2009 10:42 AM

liz rz said:

I've added the filters above and now I'd like to export the data to be able to sort the data into a spreadsheet. There is no seperator between the data fields so I can't seperate the referring source and the keyword. Any ideas?

April 20, 2009 10:32 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

It's a little advanced, but you could run a macro on the spreadsheet that splits up the data for you. That's really the only way that I can see doing this quickly. Moving forward, you could modify the filters so that they contain a separator.

April 20, 2009 11:24 AM

liz rz said:

Thanks Shawn! Can you tell me how to add the data separator to the filters, or point toward a resource where I can learn? This is very helpful! Thanks.

April 24, 2009 8:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

In the filters above, you can modify the Output field at the very bottom of each filter to add your own separators. In my example, I use a dash in filter one, parentheses in filter two, and just a space in filter three. You could easily modify these fields to use a different separator (like a comma) that's easier for you.

April 24, 2009 8:46 AM

mp said:

Thank you for great post. We are using Google Analytic about one year. This solution going to change new transactions. Is there is any way to run it on existing data? I'm just wonder is it possible to achieve the same results with advanced reports?
Thank you for your time.

August 6, 2009 1:06 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You could also use the Secondary Segment dropdown in the Transactions report to some extent. With Jeremy's Google Analytics Report Enhancer, you can segment by source/medium. You could use Advanced Segments to look at a specific medium (cpc for example), and then use the Secondary Segment to look at keyword.

I don't think there's a simple way to do all of this in one step, but the information is there, you just may have to dig for it a little.

August 6, 2009 8:12 AM

mp said:

Hello,

I'm trying to add product name to report and result will be like:
tranID | source | medium | keyword | item_name1 item_name2
I'm using the same filters as use I just added new filter that concatenate item name custom_field.
Trans List Mod 1 \x96 same Trans List Mod 1 - separator |
Trans List Mod 2 - same Trans List Mod 2 \x96 separator |
Trans List Mod 3 - add item name to custom field
Field A -> Extract A Custom Field 1 (.*)
Field B -> Extract B E-commerce Item Name (.*)
Output To -> Constructor Custom Field 1 $A1 | $B1
Field A Required Yes
Field B Required Yes/No tried both
Override Output Field Yes
Case Sensitive No
Trans List Mod 4 - same as Trans List Mod 3. \x96 separator |
As a result I'm getting douplicate rows one with item name and another without. Could you please point me the right direction?
Thank you for your time.

August 28, 2009 7:04 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You're going to run into several issues when using any filter that looks at both transactions and products at the same time. The primary issue here is that a single transaction can be associated with more than one product, which means that Google Analytics stores these pieces of data separately within the original database (and maybe even within different databases).

The easiest way to get the product information for a specific transaction is to just click on the ID. You'll then see a list of products in the transaction.

You may also have some success with an opposite approach, although I haven't tried this yet - try adding the transaction ID and source, etc. to the product name (sort of the reverse of what you're doing). As a caution, I would try this in a separate test profile, but it should give you the same kind of report that you were looking for. Hope that helps!

September 1, 2009 10:10 AM

Anagha said:

How can I append the exact search term also to the end of this PPC keyword so I can see which keyword triggered the transaction. What filter should I use

December 14, 2009 2:00 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

Google Analytics does not currently capture the exact search term, so you would have to use a workaround like the one mentioned in this article. Then you would have to modify the filter to include the User Defined variable or whichever field you are using to store the exact search query.

December 14, 2009 9:21 AM

Anagha said:

Thank You for your prompt reply. I wanted to do this using filters and not scripts since I dont have access to the Clients page. So I tried using the filters shown on this page in addition to the filters from http://www.semvironment.com/ppc-management-adwords-keyword-data-exposed-with-google-analytics/.
I applied exact query filters first (referral etc) stored in custom field 2, then applied the filters on this page and appended the custom field 2 to it. But it didnt show the exact keywords for transactions. Am I doing something wrong. Can this be done. Please help

December 14, 2009 8:22 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

I've found those keyword filters from semvironment to not work properly - and also to break conversion and transaction tracking data within the reports. It's actually what prompted us to create the custom script in the first place.

Currently, the only method I've seen to do what you need is to use the custom scripts. This will only change if Google makes the Exact Search Query available within the Google Analytics fields.

December 15, 2009 9:03 AM

Jordan Glogau said:

Shawn:

Its been some time since your described your three filter technique. Do you still think this is the best path to match specific transactions to particular channels?

Do you know anyone that's tried to reconciled this methods with their accounting data. This is something that you can do with Coremetrics?

BTW, I saw you method in Biran Clifton's book and the most important piece of advice he left out, set up a different profile since this stuff can break your data.

Thank you for this helpful post.

August 27, 2011 4:08 PM

Chris said:

Hi Shawn,

We've also done some work with this and also had a lot of head scratching to get the results - great post though and cleared up a couple of areas. Regards

Chris

May 3, 2007 4:56 AM

Shawn Purtell said:

@Chris:

Thanks for the nice comment. Let me know if these new filters work out for you. I've only been using them for a little while, so it would be great to get some feedback.

May 3, 2007 8:42 AM

Mikey said:

Hi Shawn,

Great post mate. Like Chris, I've been scratching my head over this & have a couple of clients that will absolutely love this. Thanks :)

Mikey

May 3, 2007 8:22 PM

Shawn Purtell said:

@Mikey:

Thanks! I hope it turns out to be as useful as I think it might. I'd love to hear feedback from you once you've used the filters with clients.

May 4, 2007 9:05 AM

Krista said:

Great Post. These advanced filters are very usefull. I took your training course on Google Analytics. I was wondering if in the future you are going to offer a whole course on advanced implementation and setup where filters like these are taught and where regular expressions could be learned?

May 17, 2007 10:31 AM

Shawn Purtell said:

@Krista:

Thanks for the compliment. The training course that you took includes the most common advanced implementation options that we've encountered (things like Paypal, cross-domain tracking, etc.). We've also included the general ideas about the types of filters you can create. We're currently revamping the course for our new training series, and it will include more about filters and how you can use them to accomplish specific tasks.

In order to get more specific than that, you really need one-on-one attention, because setting up advanced filters really depends on your site and what kinds of information you want to find. This is one example of something our support plans can do for you on an individual level. We try our best to make this information freely available through our blog.

The same sort of thing applies to regular expressions. Regular expressions can get extremely complex, so we covered the most basic/common ones that you can use in our training course. Again, the more advanced regular expressions are only needed in very specific situations that would require one on one attention.

This brings up another point: Google Analytics is like getting a suit (or dress) fitted - you need to take measurements and personal tastes into consideration when you are setting up analytics. There are some steps that are universally important, but when you start looking at your individual site, no two Google Analytics configurations will be exactly alike.

I hope you found this useful. Thanks again for posting and for taking our course!

May 17, 2007 11:13 AM

Shareen Jordan said:

Hi, Shawn.

I really enjoy reading your blog. Thanks for the information. I was wondering, in the first filter you name the constructor field 'custom field 1' and you call it the same thing in the next filter. But (I think)the second filter refers to the custom filed in the first filter. If they are both named the same thing, does the field from the 1st filter overwrite the field from the second filter? And is there any reason why you wouldn't name them differently? Would there be any benefit in naming them customer field 1 and customer field 2?

Thanks! Shareen

June 5, 2007 3:04 PM

Shawn Purtell said:

@Shareen:

Thanks for the compliments. As far as your question, I only had to use a single custom field across all three filters.

So, filter 1 puts the source and medium into custom field 1.

The second filter reads the custom field from filter 1 and adds the term to what was already there.

The final filter adds the custom field we built in the previous two filters to the transaction id.

This is why the order of these filters is so important. They will not work out of sequence (they also should be next to each other on the filter list).

I didn't use two separate custom fields (although I could have) because I really only needed one.

As far as 'naming' the filter fields, you can't do that. You are given two custom fields you can use. I didn't actually name those, I selected them from the pulldown. Thanks for reading!

June 5, 2007 3:10 PM

Will said:

Great post Shawn - this is gold.

I have a question related to this subject. What I really want to do is to take this info (source and keyword) and pass it into a contact form so that we can implement closed-loop tracking of enquiries.

Do you have any ideas on how that might be done?

Bests,
Will

June 14, 2007 4:05 AM

Shawn Purtell said:

@Will:

It can be done. There are actually two methods I know of to do this. Unfortunately, this kind of thing is too advanced for a blog comment, but feel free to contact us if you want help setting this up.

June 14, 2007 9:07 AM

Al said:

Can this be done for organic traffic ? i.e. finding the keywords that deliver conversions from non-paid natural / SEO sources ? Cheers - Al

July 30, 2007 11:31 AM

Shawn Purtell said:

@Al:

These filters will include organic keywords as well. You can check out the screenshot above for some examples of this.

Thanks for reading!

July 30, 2007 11:50 AM

Brian Hinkle said:

Shawn-

Excellent work. I've just started using GA and was annoyed that there was no built-in functionality for that sort of origin tracking in ecommerce transactions - glad to see it can be added fairly easily!

July 30, 2007 2:38 PM

Shawn Purtell said:

@Brian:

That's the whole idea - making this awesome free tool (GA) more and more useful.

Thanks for the comment!

July 30, 2007 2:50 PM

Fonts said:

I use it and get some interesting (great) results. Some transactions are direct which I assume are bookmarked traffic

#312676 (direct) - (none) ()

and other transactions are like the one below do not have a value for the keyword I suppose since it is another site sending the traffic.

#312632 some-referring-site.com - referral ()

Everything else looks killer!

Thanks.

July 31, 2007 1:48 PM

Shawn Purtell said:

@Fonts:

Thanks for the feedback! Direct sources can mean a couple different things. Usually it means a user typed your URL into the browser directly, but there are some other things that will cause this, like email visits from a program like Outlook.

And you are correct with your second point - referring sites obviously will not have any keyword data, and so the parentheses will be blank.

Thanks again for the feedback!

August 2, 2007 3:58 PM

Nathan Scheffey said:

This is a great use of filters to achieve an extremely useful result. However, I think combining it with your excellent Exact Keyword Matching script really takes it to the next level.
I added another filter to append the User Defined Value (the exact keyword) after the Campaign Term. Now my transaction data shows the exact search string that led to the conversion. Very cool.
Question: is there a place to learn the syntax used in these custom filters (e.g. $A1 ($B1))? It seems pretty straightforward but I can't find any information about it in the GA Help documentation.
Anyway, thank you all for your excellent tools, they really take Google Analytics from good to great.

August 2, 2007 5:55 PM

Shawn Purtell said:

@Nathan:

I agree. If you have Michael's exact keyword tracking script installed, this is a great addition, and we actually do that ourselves.

To be honest, I don't have a specific resource for you concerning regular expression string matching variables, but there are lots of great books and websites on the subject.

August 3, 2007 8:53 AM

Neil said:

Hi Shawn.

I've tried doing this on 2 different analytics accounts, and can't get it to work.

I've copied everything word for word, but the keywords are never added. Could it be because the screenshots are of the previous version of analytics?

August 17, 2007 11:13 AM

Shawn Purtell said:

@Neil:

These filters have been tested and confirmed in the new version of Google Analytics.

I can't say for sure where your problem is occurring, but I can tell you that these filters work fine if used properly.

Is it possible you are having problems with your referring source tracking? Also, remember that keywords only show up for organic and cpc results - not for anything else (referrals, direct, banners, and other sources do not have keywords associated with them).

August 20, 2007 8:51 AM

Prince said:

Great stuff Shawn, very usefull.

Just having 1 problem, the first filter that grabs the source and medium, in the output filed you have $A1 - $B1

Thats exatly how I entered it but in my Transaction I am not getting the "source" I do get the keywords

So I get something like this:
Order27 $A (keyword)

August 21, 2007 12:01 AM

Neil said:

It works! Sort off...

Thanks for your help Shawn. I've just logged into Analytics, and it seems that the filters need to be in place for 24 hours to return anything.

Only wish I should filter on Adwords Campaigns instead of Campaigns (no option that I can see).

August 21, 2007 7:19 AM

Shawn Purtell said:

@Prince:

Looks like there's a problem with one of your filters - the third one I believe (specifically the $A1 part). Make sure there is no space between the $A and the 1. I can tell there is something wrong with your output field because '$A' is showing up in your data, and it should never do that.

August 21, 2007 9:15 AM

Shawn Purtell said:

@Neil:

Glad you got things working. And yeah, Google Analytics data generally takes 24 hours to update completely, so anytime you make a change, you need to give it time.

As to your other wish, I'm not really sure what you're asking. There are filters that can do all kinds of things. If you can be more specific, I may be able to help.

August 21, 2007 9:17 AM

Neil Munn said:

I'm accessing Analytics through my Adwords account. This means all my campaigns are listed under Adword campaigns, which isn't shown in the filters dropdown.

What I'm trying to do is, display the keyword(s) that the user types in to make their transaction eg:

Transaction ID, Source, Medium, (Keyword)

Is this possible?

August 22, 2007 5:59 AM

Shawn Purtell said:

@Neil:

The filter set I provided does this automatically, if the keyword exists. You can see in the image above that the keyword should be present for all organic and cpc (including AdWords) sources.

You should not need any additional filters to achieve this result. If you aren't seeing this data, you may not have the filters set up properly.

*Note - There is a difference between 'what the user types in' and the keyword you are bidding on.

The 'term the user typed in' is called the search term while the keyword you bid on is called the bid term. The bid term is the information you will see.

To find out how to get search term info as well, visit Michael's awesome solution here.

August 22, 2007 9:33 AM

Netmeg said:

Hello - I've been using this filter pretty much since you posted it, and it worked just fine. But I created a new profile for it, and it hasn't worked since. Could it be the new Google Analytics code? I then tried to put it back on the original profile on which I had it, and it *still* doesn't work. I haven't changed any of the code, I have the three filters in the proper order - the only thing that has changed was the Google analytics code. And actually, I'm testing that on still another profile, so I'm not entirely sure what's going on now.

January 22, 2008 11:08 AM

Netmeg said:

As an update to my previous post, I went and checked, and between and my partners, five ecommerce sites that were using this filter ALL stopped displaying the data on January 15th. How weird is that? Google must have changed something.

January 22, 2008 1:34 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

There have actually been reports of all advanced filters breaking around that same date, but many people have also stated that their filters have begun to work again. I'd check the more recent data again. In the meantime, we're conducting our own investigation concerning why advanced filters have had this little hiccup, and we'll let you know if we find anything important.

January 23, 2008 8:59 AM

Netmeg said:

As of today, 1/23/2008, none of our advanced filters are working.

Thanks in advance for anything you find out.

January 23, 2008 10:51 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Netmeg:

After examining some other data and situations with both custom and advanced filters, it seems this is an issue many people are experiencing. From the Google Analytics help group to our own data, we have noticed two things:

Many custom filters seemed to stop functioning for several accounts for a brief period around Jan8th, but resumed working on the 15th. This includes custom includes and other custom filters.

Advanced filters that use custom fields, however, seems to be having more trouble, and in many cases have not worked since the 15th on January. Among these kinds of filters is the filter described in this article.

As soon as we get a good explanation as to what's been causing these errors, I'll be sure to post an update here.

January 29, 2008 10:42 AM

Steve Racicot said:

Is anyone using this advanced filters getting data? Is it working correctly?

I have had this installed for over a week and have seen no changes to my transaction list under Eccommerce -> Transactions.

Steve

February 18, 2008 11:14 AM

Jeremy Aube said:

@Steve

Any advanced filters that use custom fields have not been working since January 15th, including this one. This should be a temporary issues, but in the meantime, we have posted an article on an alternate set of filters you can use that function exactly the same as this set. You can get your filters there, and then refer to Shawn's article here for addition instruction and information.

February 18, 2008 3:55 PM

Imran Khan said:

Really informative post.
One question: Where can I find the Transaction List, the last image. I am using the old version of analytics code.

Thanks in advance

February 20, 2008 6:39 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Imran:

The Transaction list is under the Ecommerce section in Google Analytics, and will only show up if you have turned on Ecommerce in your profile settings. The exact report you're looking for is called Transactions.

As a note here, I realize these filters have not been working correctly since Jan. 15th. The filters are still correct, but there was a bug with custom fields (which these filters use) that is being resolved. Until then, feel free to look at Jeremy's update, which gets around this temporary issue.

February 20, 2008 8:57 AM

Asher said:

Have these filters every returned to working properly? I added them before reading to the bottom of the comments. I'm finding that when I view transactions I get the transaction number followed by the state.

June 9, 2008 10:49 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Asher:

These filters have been working correctly for a while now. These three filters do not affect the state of a user, so I wonder why you are seeing that information within Google Analytics. My hunch is that either there is a problem with the way you've set up the filters in your profile, or you have another filter that's using the Custom Field that's interfering with the transaction filters. Unfortunately, it's hard to tell you exactly what the problem is without seeing your filter setup.

June 9, 2008 1:15 PM

Duff said:

First of all, great post, Shawn.

I'm having a problem though.
I paid for a banner on another website. The link to my website is tagged properly:
http://www.mywebsite.com?utm_source=Other%2BWebsite&utm_medium=Banner&utm_campaign=Other%2BWebsite

I am getting some transactions through this banner but in my transaction list all I can see is:
mytransID mywebsite.com-referral (mywebsite.com)

However, of course I would like to be able to see:
mytransID Other Website-Banner ()

Do you have any idea about what did I do wrong?

July 23, 2008 5:57 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff:

It looks like you're getting what we call 'self-referrals' - meaning Google Analytics is registering visits from your own site. This actually has nothing to do with the filters, as those look like they are working.

Self-referrals can occur for many different reasons, but the three most common are:

1. Some pages on your site are missing Google Analytics code.
2. You use multiple subdomains and haven't set up the Google Analytics code for subdomains.
3. Your site has multiple main domains.

If any of these apply to you, then you've most likely found the reason for your self-referrals. If none of these apply to you, there may be another problem with your Google Analytics installation, and I'd have to actually see it in order to diagnose the problem.

July 23, 2008 8:41 AM

Duff said:

Just wanted to thank you coz it is now working properly. Indeed, I use 2 domains, one for the website and another one for payments. Again, thanks a lot!

July 24, 2008 11:28 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Duff: Glad I could help. Thanks for reading!

July 25, 2008 8:08 AM

Tim said:

Hi Sean - I have an old website that we are redirecting all traffic to our new site. I would like to know which specific transactions are coming from the old site. We are using 301 redirects on individual pages. I tried your examples and it is not picking up the old website as the source or medium... Do you have any advice? Thanks

August 26, 2008 3:09 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Tim: I'm pretty sure Jeremy already answered this on a different blog article, but I agree with him that the only real way to do this effectively with Google Analytics is to add a query parameter to the end of the 301 redirect and then use the Site Search report within Google Analytics to see which transactions are coming from customers who were trying to find the old site.

August 28, 2008 7:44 AM

juan cruz aliaga said:

Hi Shawn, great post!
I am arriving late to this one, but I can see how useful could it be to avoid double counting on orders/transactions.
I was just wondering if the associated keywords would be the last ones used on any campaing source and medium. If so, and to keep track of visitors previous visits to purchase, couldn't we also grab the visitor ID (with a new filter) and appends it to the rest of the info??

Rgds,

jc

February 17, 2009 4:25 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Juan:

Just like with normal Google Analytics tracking, the keyword/source/medium reported with the transaction will be the most recent. Also, in regards to your question about visitor ID - that depends on where the ID is stored. There is no built-in visitor ID filter field in Google Analytics for this, but you could send the data from your database to Google Analytics with each transaction using the ecommerce code. If you do this, you'll probably want to read over the Google Analytics Terms of Service just to make sure the information you're passing isn't considered personally identifiable.

February 17, 2009 8:19 AM

liz rz said:

Hi, this is a great filter, but was wondering how i could modify it to show me the transaction date which is a sortable list so i can see which are the most recent orders...with the existing filter i can only sort by revenue, tax, shipping, quantity. I know i can choose date range for the same info, but a sort would be easier. Thanks, this very useful info.

February 19, 2009 10:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

Probably the easiest way to do this is to use Andre Scholten's Table Sorter add-on for Google Analytics (the site is in Dutch). This is also included in the Better Google Analytics Firefox addon from VKI Studios.

February 19, 2009 10:42 AM

liz rz said:

I've added the filters above and now I'd like to export the data to be able to sort the data into a spreadsheet. There is no seperator between the data fields so I can't seperate the referring source and the keyword. Any ideas?

April 20, 2009 10:32 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

It's a little advanced, but you could run a macro on the spreadsheet that splits up the data for you. That's really the only way that I can see doing this quickly. Moving forward, you could modify the filters so that they contain a separator.

April 20, 2009 11:24 AM

liz rz said:

Thanks Shawn! Can you tell me how to add the data separator to the filters, or point toward a resource where I can learn? This is very helpful! Thanks.

April 24, 2009 8:37 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@liz rz:

In the filters above, you can modify the Output field at the very bottom of each filter to add your own separators. In my example, I use a dash in filter one, parentheses in filter two, and just a space in filter three. You could easily modify these fields to use a different separator (like a comma) that's easier for you.

April 24, 2009 8:46 AM

mp said:

Thank you for great post. We are using Google Analytic about one year. This solution going to change new transactions. Is there is any way to run it on existing data? I'm just wonder is it possible to achieve the same results with advanced reports?
Thank you for your time.

August 6, 2009 1:06 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You could also use the Secondary Segment dropdown in the Transactions report to some extent. With Jeremy's Google Analytics Report Enhancer, you can segment by source/medium. You could use Advanced Segments to look at a specific medium (cpc for example), and then use the Secondary Segment to look at keyword.

I don't think there's a simple way to do all of this in one step, but the information is there, you just may have to dig for it a little.

August 6, 2009 8:12 AM

mp said:

Hello,

I'm trying to add product name to report and result will be like:
tranID | source | medium | keyword | item_name1 item_name2
I'm using the same filters as use I just added new filter that concatenate item name custom_field.
Trans List Mod 1 \x96 same Trans List Mod 1 - separator |
Trans List Mod 2 - same Trans List Mod 2 \x96 separator |
Trans List Mod 3 - add item name to custom field
Field A -> Extract A Custom Field 1 (.*)
Field B -> Extract B E-commerce Item Name (.*)
Output To -> Constructor Custom Field 1 $A1 | $B1
Field A Required Yes
Field B Required Yes/No tried both
Override Output Field Yes
Case Sensitive No
Trans List Mod 4 - same as Trans List Mod 3. \x96 separator |
As a result I'm getting douplicate rows one with item name and another without. Could you please point me the right direction?
Thank you for your time.

August 28, 2009 7:04 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@mp:

You're going to run into several issues when using any filter that looks at both transactions and products at the same time. The primary issue here is that a single transaction can be associated with more than one product, which means that Google Analytics stores these pieces of data separately within the original database (and maybe even within different databases).

The easiest way to get the product information for a specific transaction is to just click on the ID. You'll then see a list of products in the transaction.

You may also have some success with an opposite approach, although I haven't tried this yet - try adding the transaction ID and source, etc. to the product name (sort of the reverse of what you're doing). As a caution, I would try this in a separate test profile, but it should give you the same kind of report that you were looking for. Hope that helps!

September 1, 2009 10:10 AM

Anagha said:

How can I append the exact search term also to the end of this PPC keyword so I can see which keyword triggered the transaction. What filter should I use

December 14, 2009 2:00 AM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

Google Analytics does not currently capture the exact search term, so you would have to use a workaround like the one mentioned in this article. Then you would have to modify the filter to include the User Defined variable or whichever field you are using to store the exact search query.

December 14, 2009 9:21 AM

Anagha said:

Thank You for your prompt reply. I wanted to do this using filters and not scripts since I dont have access to the Clients page. So I tried using the filters shown on this page in addition to the filters from http://www.semvironment.com/ppc-management-adwords-keyword-data-exposed-with-google-analytics/.
I applied exact query filters first (referral etc) stored in custom field 2, then applied the filters on this page and appended the custom field 2 to it. But it didnt show the exact keywords for transactions. Am I doing something wrong. Can this be done. Please help

December 14, 2009 8:22 PM

Shawn Purtell, Senior Web Analytics Engineer Author Profile Page said:

@Anagha:

I've found those keyword filters from semvironment to not work properly - and also to break conversion and transaction tracking data within the reports. It's actually what prompted us to create the custom script in the first place.

Currently, the only method I've seen to do what you need is to use the custom scripts. This will only change if Google makes the Exact Search Query available within the Google Analytics fields.

December 15, 2009 9:03 AM

Jordan Glogau said:

Shawn:

Its been some time since your described your three filter technique. Do you still think this is the best path to match specific transactions to particular channels?

Do you know anyone that's tried to reconciled this methods with their accounting data. This is something that you can do with Coremetrics?

BTW, I saw you method in Biran Clifton's book and the most important piece of advice he left out, set up a different profile since this stuff can break your data.

Thank you for this helpful post.

August 27, 2011 4:08 PM

Chris said:

Hi Shawn,

We've also done some work with this and also had a lot of head scratching to get the results - great post though and cleared up a couple of areas. Regards

Chris

May 3, 2007 4:56 AM

Shawn Purtell said:

@Chris:

Thanks for the nice comment. Let me know if these new filters work out for you. I've only been using them for a little while, so it would be great to get some feedback.

May 3, 2007 8:42 AM

Mikey said:

Hi Shawn,

Great post mate. Like Chris, I've been scratching my head over this & have a couple of clients that will absolutely love this. Thanks :)

Mikey

May 3, 2007 8:22 PM

Shawn Purtell said:

@Mikey:

Thanks! I hope it turns out to be as useful as I think it might. I'd love to hear feedback from you once you've used the filters with clients.

May 4, 2007 9:05 AM

Krista said:

Great Post. These advanced filters are very usefull. I took your training course on Google Analytics. I was wondering if in the future you are going to offer a whole course on advanced implementation and setup where filters like these are taught and where regular expressions could be learned?

May 17, 2007 10:31 AM

Shawn Purtell said:

@Krista:

Thanks for the compliment. The training course that you took includes the most common advanced implementation options that we've encountered (things like Paypal, cross-domain tracking, etc.). We've also included the general ideas about the types of filters you can create. We're currently revamping the course for our new training series, and it will include more about filters and how you can use them to accomplish specific tasks.

In order to get more specific than that, you really need one-on-one attention, because setting up advanced filters really depends on your site and what kinds of information you want to find. This is one example of something our support plans can do for you on an individual level. We try our best to make this information freely available through our blog.

The same sort of thing applies to regular expressions. Regular expressions can get extremely complex, so we covered the most basic/common ones that you can use in our training course. Again, the more advanced regular expressions are only needed in very specific situations that would require one on one attention.

This brings up another point: Google Analytics is like getting a suit (or dress) fitted - you need to take measurements and personal tastes into consideration when you are setting up analytics. There are some steps that are universally important, but when you start looking at your individual site, no two Google Analytics configurations will be exactly alike.

I hope you found this useful. Thanks again for posting and for taking our course!

May 17, 2007 11:13 AM

Shareen Jordan said:

Hi, Shawn.

I really enjoy reading your blog. Thanks for the information. I was wondering, in the first filter you name the constructor field 'custom field 1' and you call it the same thing in the next filter. But (I think)the second filter refers to the custom filed in the first filter. If they are both named the same thing, does the field from the 1st filter overwrite the field from the second filter? And is there any reason why you wouldn't name them differently? Would there be any benefit in naming them customer field 1 and customer field 2?

Thanks! Shareen

June 5, 2007 3:04 PM

Shawn Purtell said:

@Shareen:

Thanks for the compliments. As far as your question, I only had to use a single custom field across all three filters.

So, filter 1 puts the source and medium into custom field 1.

The second filter reads the custom field from filter 1 and adds the term to what was already there.

The final filter adds the custom field we built in the previous two filters to the transaction id.

This is why the order of these filters is so important. They will not work out of sequence (they also should be next to each other on the filter list).

I didn't use two separate custom fields (although I could have) because I really only needed one.

As far as 'naming' the filter fields, you can't do that. You are given two custom fields you can use. I didn't actually name those, I selected them from the pulldown. Thanks for reading!

June 5, 2007 3:10 PM

Will said:

Great post Shawn - this is gold.

I have a question related to this subject. What I really want to do is to take this info (source and keyword) and pass it into a contact form so that we can implement closed-loop tracking of enquiries.

Do you have any ideas on how that might be done?

Bests,
Will

June 14, 2007 4:05 AM

Shawn Purtell said:

@Will:

It can be done. There are actually two methods I know of to do this. Unfortunately, this kind of thing is too advanced for a blog comment, but feel free to contact us if you want help setting this up.

June 14, 2007 9:07 AM

Al said:

Can this be done for organic traffic ? i.e. finding the keywords that deliver conversions from non-paid natural / SEO sources ? Cheers - Al

July 30, 2007 11:31 AM

Shawn Purtell said:

@Al:

These filters will include organic keywords as well. You can check out the screenshot above for some examples of this.

Thanks for reading!

July 30, 2007 11:50 AM

Brian Hinkle said:

Shawn-

Excellent work. I've just started using GA and was annoyed that there was no built-in functionality for that sort of origin tracking in ecommerce transactions - glad to see it can be added fairly easily!

July 30, 2007 2:38 PM

Shawn Purtell said:

@Brian:

That's the whole idea - making this awesome free tool (GA) more and more useful.

Thanks for the comment!

July 30, 2007 2:50 PM

Fonts said:

I use it and get some interesting (great) results. Some transactions are direct which I assume are bookmarked traffic

#312676 (direct) - (none) ()

and other transactions are like the one below do not have a value for the keyword I suppose since it is another site sending the traffic.

#312632 some-referring-site.com - referral ()

Everything else looks killer!

Thanks.

July 31, 2007 1:48 PM

Shawn Purtell said:

@Fonts:

Thanks for the feedback! Direct sources can mean a couple different things. Usually it means a user typed your URL into the browser directly, but there are some other things that will cause this, like email visits from a program like Outlook.

And you are correct with your second point - referring sites obviously will not have any keyword data, and so the parentheses will be blank.

Thanks again for the feedback!

August 2, 2007 3:58 PM

Nathan Scheffey said:

This is a