Remove Query Strings with GTM

Remove URL query string via Google Tag Manager

A few days ago I was looking at the tracking for a hybrid iOS/Android app where the Apps appended a query string to the URLs in app. Given this, I had two versions of each URL in Google Analytics, looking something like this:


The first one is the URL that is being used on the desktop version of the site, no matter of you are browsing with a laptop, mobile phone or tablet. The latter one is the URL being used if you open the link from within the app on your phone.

An easier way of doing this is probably using rewrite filters in Google Analytics, but since I want to do most things in Google Tag Manager this is how I solved the issue, takingĀ into account that we don’t want to get rid of the query string in its entirety but only that part.

Read More
Google Tag Manager and Contact Form 7

Contact Form 7 on WordPress with Google Tag Manager

Just the other day, I was holding a lecture for some students studying web analytics here i Stockholm. I was there to talk about Google Tag Manager and after some hours I received a question we looked into.


How do I send a Form Submit to GTM via the Contact Form 7 plugin in WordPress?

This is actually very easy to achieve, and I’ll walk you through both ways of doing it right here. Both with a GTM Plugin in WordPress, and without.

Read More

Remove logged in userdata from WordPress via Google Tag Manager

When you are working with any kind of data, one important thing is to keep it as clean as possible from data that really doesn’t matter. Or that could twist the important data around for that matter.

No matter what kind of web analytics tool you are using, you should always make sure to exclude your own data. Reason being that what you do on your own site usually differs a lot from what your actual visitors are doing.

Today we’re going to follow up on my previous post where we installed Google Tag Manager to collect data on a site. The next natural step is making sure we clean up our own data from the collection.

Read More

Installing Google Tag Manager on WordPress – The Complete Guide

!!! UPDATED 2016-09-28 !!! – New screenshots and adaptions to newest version of GTM –

One of the most important things on any site is to have some kind of web analytics tools setup so that you can track what is happening on your site. While there are many web analytics platforms out there my sole focus is on Google Analytics.

This guide is for those who want an easy way of installing Google Analytics through Google Tag Manager.

What you need in order to make this work:

  • A Google Account (free)
  • A self hosted WordPress installation (not residing on
  • A cup of coffee
Read More