This is the 12th lesson video from my course The Exact Process For Setting Up Google Analytics – https://www.thequantifiedweb.com/exactga.
I decided to post the videos from the lessons publicly, but I encourage you to log into the course because from within the course you can access the written notes and the checklists, plus access my special offer. The course is completely free to register 🙂
In this lesson, you’ll be learning about how to create filters that clean up your website URLs in Google Analytics by removing all the bits and bobs of code that end up at the end of the URL. This step is really important to getting accurate pageview numbers in Google Analytics as it prevents your page views from being split up into thousands of different combinations.
Trust me your SEO team will thank you when you apply this filter!
This filter will also fix Facebook’s fbclid ID which is being appended to the end of your page URLs in Google Analytics and creating a big mess. This issue is impacting people worldwide as it is leading to Facebook views being separated from the rest of your page views, leading to incorrect pageview values when you try to see which pages are effective in engaging visitors on your website.
Click to Open Transcription of Video
Hi! Welcome to Lesson Twelve of the Exact Process for Setting Up Google Analytics by The Quantified Web. In this lesson, we are going to go through removing parameters from the end of the page URL. So what we’re going to do is Creating a Remove All Parameters Filter.
Now, to see this lesson you want to go to www.thequantifiedweb.com/exactga and you want to put your email address in here and then click on Get Started Today. Now, let’s scroll down to the Create Remove All Params Filters and here’s how to do it.
Now, this is another one with a little exclamation mark because, with all of these filters, we do need to copy the text in exactly the way it’s written because if there are incorrect spaces or the characters are typed in wrong then the filter might not work and then you’ll have unusual results. My, my team members actually put this in because they got some weird results and I corrected them. So rather than be corrected by Petra, they thought, “Good idea to put in a little exclamation mark.”
Alright, so what we’re going to be doing is removing parameters from the end of the URL. So if you saw one of my earlier lessons, you’ll see where I showed you an example. So I’m just going to put an exclamation, sorry, a question mark here. Now, can you see how we’ve now — when I typed in a question mark, we’ve suddenly got this cf_uvid= and then all of this stuff. So this is actually called a parameter. Now, if this was changing to some other ID then you would actually have lots and lots of different parameters and they would all be changing the page name.
Alright, so I don’t know if that sound was coming through to your head – the family member that was kicking – I don’t know what they were kicking. I had a child kicking something in the room next door. Alright, hopefully, it’s to be quiet now.
Alright, so what I was saying was if we have all these different values in here then it’s going to look like people have looked at different pages when in actual fact it was the same page. So if we remove the parameter – go away – from the page name then every time someone looks at this page it will get aggregated which means that the — so let me just explain what this aggregated business is.
So you’ve got the page name on one side and then you got the numbers on the other side. So the numbers will be how many people looked that up, you know, basically, it was how many Pageviews there were, what the conversion rate was, how much time people spend on it, etcetera. Now, those numbers get added up in Google Analytics based on all of the times people looked at that particular page.
But if you have a hundred different page names or representing the same page, that pie is going to be split a hundred different times and you’ll have you know, one Page name with one parameter saying one person looked at it and then another one with another parameter saying one person looked at it and another one with another parameter saying one person looked it up when in actual fact there might have been a hundred people looking at that page, it’s just the parameter changed.
So we want to be getting rid of those parameters in the Filtered Data with No Parameters view which is the one that we’re going to use for SEO, for reports, for basically looking at in Google Analytics in general.
There are some times when you want to see the parameters and that’s why we have another view where we keep them in. Alright, so let’s go through how to remove those parameters from your Google Analytics.
Okay, so first up we want to create the filter so let’s go in. Now, we want to — oh look, I haven’t said what the name of the views. Well, we’re actually going to go into the Filtered Data with No Params view. Okay, so that’s the one we want and we do that in Admin. Alright, and then we’re going to create the filter that — alright, actually I know I have set up. Select the Filtered Data No Params view, go to Administration, View Filters and click the Add Filter.
Alrighty, and then name the filter Remove All Params. Sometimes there can be a little bit of irregularity between the different procedures because I actually train my team to help write them as well. So we have an interesting process behind the scenes, we actually record videos of everything that we do and then write them all up as procedures.
So alrighty, now we’re going to set up the Filter Type and Filter Field and it’s going to be a Custom one again and this time though we want a Search and replace Filter and we’re going to set the Filter Field to Request URI. Okay, Request URI here, there it is.
Now, this one is a bit of a funny one. So under Request URI, the Search String we want to type in is this one here. Now, actually, let me explain what a Search and Replace does. So what the Search and Replace is going to do is it’s going to look for any instance of this string and it’s going to replace it with this string.
So this backslash here is telling us that we want exactly a question mark here. If we didn’t have the backslash, this question mark would have a special meaning in geeky programmer language. The question mark can be used as a wildcard to mean, to mean a character. So we have to use the backslash to say that it needs to be a question mark.
Alrighty, and then we’re actually going to leave the Replace String empty. So what this is saying is if we find — oh actually, I didn’t continue to explain what this is. So this backslash and then question mark represents a literal question mark, whereas this dot star actually is not literal. This is a wildcard and this means it could be anything at all. So if you see a dot star(.*) like that it means nothing or anything.
So if we have any URL because your Request URI is the page URL, we have any URL that has a question mark in it followed by anything at all, we’re going to replace that with nothing. As in, it’s going to delete it. So what we’re doing now is deleting the question mark plus anything behind it.
Alright, so we’re going to Verify this filter and we can see there are some situations here where that would have made a difference. So if this particular situation is an e-commerce one and so you can see we have variants. So this one we have variant 566802 and then we’ve got this one it has variant 654215. Now it could well be that if it wasn’t for these variants we’d be having different numbers of Pageviews.
So this particular client doesn’t have a lot of volume of traffic actually but if we had a lot more traffic, we’d see a lot of things in here and we would see these numbers that change but because we have — actually, this one here is an interesting example. So Facebook, sorry, I’ve kind of changed topic but I’ll get back to it.
So Facebook has started doing this new thing where they put in fbclid. So Facebook something ID and they like put in a lot of bunk of junk in there and I don’t know if this is specifically to upset Google Analytics but basically what the result of this is anything that has this fbclid in there will break the number of pageviews because the fbclid changes each time and you end up with each one just having just one session.
So what happened here is by removing that parameter, it’s rightfully identified that this is actually just a view of the Home page and it’s merged into just the Home page. So before you could see the Home page had fifteen sessions and this one which was actually the Home page that had the fbclid on it had one page view and now that we have removed the parameters on the end, it has correctly now said that we’ve had sixteen sessions and it’s also added up the Pageviews so we had twenty Pageviews and sixteen sessions of the Home page which is true because it was the Home page that someone looked at so they had this, with parameters on the end.
So oops, so you’ll see that if we had been — if we had a whole lot of people that were looking at different variants here in e-commerce then it would have also shown across here that we would have been basically squashing the number of pages. This can have a huge impact when you have a large e-commerce store with lots of different variations or lots of different products. Because on e-commerce stores you often have things that will have like order by price or order by alphabet or order all these different things and it completely breaks down the Pageviews. If you have let’s say selling shoes and you’ve got, I don’t know, one shoe called Louis, a shoe called Ellie and a shoe called Fredo. And then you had Louis Order by Price and then Variant Black or Variant Brown then you can’t see how many people looked at the Louis shoe because you’ve just got all these junk in the end. This is going to fix all that so you can see exactly how many people looked at this page.
Hopefully, I didn’t just rumble too much then I explained it properly. Alright, so, in this case, it has — so we either want to see the filter won’t change the data, that would mean that you didn’t really have parameters or if it does have a table you want to see that it has correctly stripped the parameters of the end which it has done in this case. Alright, and then we want to Save it.
Again that’s a pretty short procedure this one. But this one is actually really important and I strongly urge you to set this up especially if you have e-commerce. But now that Facebook has been putting in these Facebook ID’s, honestly, I think that everyone needs this particular filter. Not that the other ones aren’t important. Basically, all of these filters in here are really important but this particular one can make a huge mess of your Google Analytics and really impact the attempts of your SEO Team or other teams to work out what’s going on when it’s split up in so many different Pageviews like this. It just makes it nonsensical. And it removes your ability to look at data in a human way.
Alrighty, well the next one we are going to go through is Removing Trailing Slashes. That’s basically, depending on how you have web pages set up. Some pages would have that it the end and some pages don’t. The page works either way but Google Analytics counts it as two separate ones. So I’ve got a filter, just on how to get rid of a slash on the end. Alrighty, we’ll go through that one next. Hope you have a good day!
If you liked this video and want to find the next one, look out for How to Create a “Remove Trailing Slashes” Filter in Google Analytics. This next lesson will show you how to prevent your pageviews from being split in half between those that have a slash at the end, and those that do not. A really pesky problem plaguing many Google Analytics setups!