Is Google Analytics user ID getting broken?

Because another post said Google Analytics 4 probably doesn’t work with open edx, I tried creating a Universal Access (UA) property to run a test with. I used the exact googleanalytics plugin format specified here:

http://docs.tutor.overhang.io/plugins/examples.html?hSince%20it%20looks%20likeighlight=google%20analytics

But when I then go to the site, I don’t see any web traffic on the google analytics console. Looking at the page source, I see that my UA-201443306 number has been converted into

_gaq.push([‘_setAccount’, ‘UA\u002D201443306’]);

That seems to be encoding the “-” for some reason. That seems like it shouldn’t be necessary, since I’m just typing in ASCII (not even copying and pasting.) And I think that’s then breaking the Google Analytics tracking capability which is what’s leading to no traffic showing up?

Is this something in the core open edx which is broken, or is this possibly a Tutor specific issue? (It seems too simple to be a Tutor issue to me, which is why I’m posting it here first.)

I saw the same issue so I worked around it with the instructions from @lpm0073 from here:

@lpm0073 I have a question though: Does your configuration show you each class page name in google analytics? All class About pages just show up as a “/” URL in google analytics for me…

When I view the page source I see it has:

<!-- dummy Segment -->
<script type="text/javascript">
  var analytics = {
    track: function() { return; },
    trackLink: function() { return; },
    pageview: function() { return; },
    page: function() { return; }
  };
</script>
<!-- end dummy Segment -->

And that function() is what we deleted by removing the template code and inserting our own, which has a function named gtag(). I don’t see any reference to that dummy segment in main.html, so should I rename gtag() to function() to get better results? Or will that just break google analytics? (Or do you know where I would replace the function() calls with gtag calls()?)

Edit: Now stuff seems to be showing the full URLs. Maybe google analytics just took a bit to start working properly…