Today I wanted to send a quick Substack explaining two issues I found with Substack’s Google Analytics implementation.
Generally I write more *actionable* articles for you all but I thought that these issue might give you a better understanding of how Google Analytics and Google Tag Manager works.
Both of the issues I found have the same solution, so let’s dive in.
Substack Utilizes an Iframe For Email Signup
The first issue is only applicable is you have an email collection form on a separate website. An Iframe is essentially a web page inside of a web page.
When bowtiedopossum.com loads, it also loads up bowtiedopossum.substack.com.
This is an issue because when bowtiedopossum.substack.com loads, my Google Tag Manager fires and deploys the Google Analytics Universal Analytics and GA4 tags from my Substack page.
Note: If you’ve followed my guide, you’re deploying GA via GTM. In this instance, GA doesn’t actually live on your site. GTM lives on your site and deploys GA *under certain trigger configurations*. This will be important below.
The ideal solution here is to not have the email capture as an Iframe. Since I’m not about to hassle the devs and analytics teams at Substack to get this fixed, it’s up to me to find a solution.
Google Tag Manager Deploys on Writer Pages
The second issue with Substack’s implementation of GA or GTM codes is that it deploys on every page of your subdomain. Given the writer of the Substack likely spends a lot of time on their platform, there’s a lot of “visitors” and “pageviews” that shouldn’t show up because it’s actually the writer.
This can be filtered in UA (Universal Analytics) through excluding your IP address in views but not as easily in GA4.
The real solution should be to have the platform check whether the admin of the subdomain is logged in and if so, don’t implement the tags.
Again, I’m not about to hassle the devs so I built an *almost* perfect solution to bypass these two issues.
First, you’re going to want to go to your GTM tags. The tags should have an “All Pages” firing trigger.
Mine below have a “Page View Trigger” since I’ve already changed it.
Then click into the trigger and change it to a “Page View” trigger. Then change the trigger from firing on “All Page Views” to “Some Page Views”.
Lastly, you’re going to want to add the below conditions to the trigger.
What these conditions do is tell Google Tag Manager that the below tags should *only* be fired when the conditions are met.
The first “Page URL” above excludes the embed page that is firing on your secondary website through the embedded form. The GTM container will still fire, but no analytics tags will fire and pass data back to GA.
The next two URLs are URLs that only the writer has access to. Hence filtering out the majority of the writer’s traffic.
The one problem with this solution lies in the fact that the home page (bowtiedopossum.substack.com) and the actual posts are still included. If you or I go to the homepage or posts, the tag will still fire. It could be excluded, but then you’d miss out on see the analytics of users that visit that page.
I hoped you learned a little more about GTM and the fact that it is way more powerful than just implementing marketing tags that could very easily just go into the header.
If you liked this post, please like it, share on social media, or email it to your friends/colleagues. Definitely bookmark it as you’ll want to come back again through your WiFi Money Journey.
If you want to get smarter about all things digital, upgrade today from free to paid for only $10 a month. The paid posts are where I dive even further into the weeds to help you truly understand and capitalize on the digital landscape.