Can't seem to get Google Analytics to work with my Story

Jul 27, 2021

Wondering if anyone can assist me understand why I can't seem to get Google Analytics to work with my story. 

I think I have a pretty good handle on the process where I need to embed code in my story.html file (in the <head> section)

I've tried the following formats but have not been able to see my usage reflect on my google analytics dashboard. 

I tried using the global tag provided by Google (measurement ID altered for privacy):

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src=""></script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-K7G2L9ZBTV');

I've also tried:

<script>||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', 'G-K7G2L9ZBTV', 'auto');
ga('set', 'appName', 'Google Analytics Example');
<script async src=""></script>

as per advised here

neither seems to work. 

Although it seems like a fever dream at this point, I was able to briefly get the page visit tracking to work, but in my process of getting event tracking set up I broke things. 

Any advice would be appreciated. I can also answer any questions to help clarify the steps i've taken. 


3 Replies