It won't work with Google Tag Manager
See original GitHub issueIn your article Google Analytics is described. Google Tag Manager now replaces Google Analytics and is different. GTM first load a js file. That js file then loads “google-analytics.com/analytics.js”.
However, there’s no difrect link to “google-analytics.com/collect” in analytics.js
anymore. Instead there’re different kinds of other links to:
- “/r/collect”
- https://stats.g.doubleclick.net/j/collect
- etc…
Which ones should be proxied? Which ones not?
How to work with all that now?
Issue Analytics
- State:
- Created 4 years ago
- Comments:27 (15 by maintainers)
Top Results From Across the Web
Troubleshoot issues - Tag Manager Help - Google Support
Container snippet problems: The Tag Manager container snippet might be installed incorrectly on your site. Use Tag Assistant to help verify installation.
Read more >16 Most common Google Tag Manager mistakes
16 Most common Google Tag Manager mistakes · Table of Contents · #1. Viewing the wrong Google tag manager container · #2. Container...
Read more >5 Ways to Troubleshoot Your Google Tag Manager Installation
1) Write Good Code and Validate Your JavaScript · 2) Use Google Tag Manager's Preview Link to debug in Firefox with Firebug ·...
Read more >5 Common Google Tag Manager Problems | Advance Metrics
Figure out why your Google Tag Manager tags do not fire by going through our list of common GTM errors and their solution....
Read more >Google Analytics not working? Here are 21 ways to fix it
Tags not firing: Look at Google Tag Manager preview mode and check if the tag is firing or not. Ensure your tag is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Okay, I’ll double check.
I love you’ve started the issue from one question, and after a lengthy discussion it turns out to be a completely different question ♥ But we’re nailing it!
At the first glance, it is not different. Do not state that until you clearly understand the problem ^^
So I went and checked. Everything works just fine if we ignore SSL errors on localhost. Please remember to always describe what exactly doesn’t work for you, as it takes time to guess every time.
Note that on
localhost
there is nohttps
set up, and, most likely, in your case the script fails because it requests analytics through the secure connectionhttps://localhost/www.google-analytics.com/analytics.js
(notehttps
) which is not enabled in NodeJS proxy. Your proxy path-forwarding should handle https forwarding and request the NodeJS proxy via http only. To make it work on localhost, if it’s your case, you can cheat a little with the config file like this:Please describe what exactly doesn’t work for you or was it your case. Hope this helps. Please, describe issues in very much detail, because it takes time to dig in and understand why you asking.