Log in to your account
Sign up

How To Use GTM To Rename URLs & Page Titles in Google Analytics

08 January 2019 | 0 comments | Posted by Che Kohler in nichemarket Advice

Rewrite links in GA with GTM

Digital marketing is all about data and insights. If you cannot accurately evaluate and measure results, you will never know how to improve which will eventually catch up to you and leave room for your competition outperform you in critical areas. Which is why data scientists and data analyst positions have become such converted roles as they help weed through the mountain of data to find key insights. 

One of the main reasons data analysis isn't always as useful as it should be is due to the input of dirty data. Depending on the seriousness of the crime it can take months to clean up a reasonable amount of data to pull out any relevant trends and even then you're dealing with a smaller sample due to the cleanup. 

Since Google Analytics is usually the tracking tool of choice, the usual dirty data culprit in this tool is the recording of poorly structured or non-descriptive URLs and even in some cases page titles too. There are very few websites that give their URL structure much thought, and it naturally hurts them when it comes to reporting with Google Analytics.

Reporting tends to suffer from poor URL structure

Usually, sites who are committed to change often have to bite the bullet and revamp their entire URL structure or require dev for URL rewrites which often means SEO needs to get involved with a URL clean up which can get messy.

Thankfully Google has realised that sites don't always consider SEO and URL best practices when creating a website, so they've given us the option of rewriting URLs in Google Tag Manager. 

Why would you want to rewrite your URLs

There are many reasons you may want to revise your URL's, and all of them stem from CMS limitations. No CMS is perfect, and neither is their ULR structures especially when you weren't the one to plan out the URL structure from the beginning. 

Your URL's and subfolders may not reflect the way your content is hosted, or you may be running encoded URLs, which can well cause pain for any digital marketer trying to extract reports. 

Secondly, Google Analytics is a page view tool by nature and it simply basis it's tracking each time a traditional URL is loaded into the browser, so it may not always be suited to how you want to structure your data or your reporting. 

Popular reasons why you would rewrite your URLs

  • URLs are not descriptive
  • URLs are encoded
  • URL's have a poor structure or no apparent structure
  • URL's don't change as with Angular JS and React JS front ends

How to rewrite your URLs with GTM

  • Head over to Google Tag Manager
  • Create a new tag by clicking "NEW."
  • Provide a name for your tag IE - Blog Search URL Rewrite
  • Select Google Analytics - Universal Analytics Tag
  • Set Track Type to "Page View"
  • Check the box that says "Enable overriding setting sin this tag."
  • Include your Google Analytics tracking ID
  • Click on the drop-down menu that says "More Settings."
  • Then click on the drop-down menu that says "Fields to Set."
  • Under field name select page
  • Add the URL structure you want as a rewrite
  • Click "Add Field"
  • Select the filed name title
  • Add the title structure you would like to see in google analytics
  • Set your trigger
  • Click save & publish

Note: This will affect your page view count by adding a duplicate pageview to your account, so if this bothers you, you may need to add an additional step to not fire your standard pageview tag on those affected URLs.

I personally don't mind since they can always be filtered out in reporting with a simple Regex filter.

Protip! This workaround is ideal for complex search URLs and making sure Google understands and captures all internal search queries performed on your site. We currently use it on nichemarket and it works really well. 

Rewrite the wrongs of the past

Now that you can accurately categorise your data in Google Analytics it will become a pleasure to work through. Whether you're running reports in Data Studios, third-party tools or merely good old excel. 

Making sure your data is cleaner will save you so much time and help you gain better insight into how users navigate and use your website. 

Contact us

If you want to know more about digital marketing or reporting for your site, don’t be shy we’re happy to assist. Simply contact us

Tags: google analytics, google tag manager, tracking

Previous: {{ previousBlog.sTitle }}

Posted {{ previousBlog.dtDatePosting }}

Next: {{ nextBlog.sTitle }}

Posted {{ nextBlog.dtDatePosting }}

You might also like

Google Adsense plugin to be discontinued

AdSense Will Discontinue WordPress Plugin By May 2017

03 March 2017

Posted by Che Kohler in nichemarket Advice

AdSense will no longer support integration into WordPress sites via its plugin and if you would like to continue to serve ads on your site take these...

Read more
Write a guest post for nichemarket

Write For Us - How to Submit A Guest Post

26 March 2019

Posted by Che Kohler in Updates

We welcome contributions from writers, content creators, journalists and business owners who are willing to share their expertise with our community

Read more

Leave us a comment


{{comment.iDayLastEdit}} day ago

{{comment.iDayLastEdit}} days ago


Sign up for our newsletter