4
votes

I enter a legacy codebase that has their analytics setup already. I am a bit new to Google Analytics but in our codebase, analytics events are pushed into a data_layerarray on the window and Google Tag Manager (GTM) consume it at some point. I notice that on my network tag (and when running the GA debugger tool) it appears analytics.js is called and initialized twice. One from gtm.js where we initialized somewhere in our codebase but the other initiator is from https://www.google-analytics.com/analytics.js. I look all over the codebase and it doesn't appear this link is called anywhere and when I view the page as a rendered page, I do see two script tag calling for this script.

Is this normal or am I definitely missing a init function somewhere?

image of network tab

1

1 Answers

2
votes

This is normal when your website is HTTP not HTTPS. You can see the first call has a 307 status code which is for temp-redirect from HTTP to HTTPS. It is not being loaded twice.

GTM.js loads analytics.js and that is normal.