0

I am trying to track javascript errors in Google Analytics (analytics.js) but without Google Tag Manager, since I am using another TMS.

I have tried the codes given by @lisburnite here : Logging javascript errors within Google Analytics

But they do not seem to trigger any errors hits. The question was from 2016, so any more recent codes?

Thanks !

2
  • That question links to a documentation that was last updated in July this year. Have you tried what was written in there? developers.google.com/analytics/devguides/collection/… Commented Nov 20, 2018 at 18:15
  • Yes i've seen it, but I dont really see how it is related. It seems to be useful for tracking the fact that the jserror tracking fails, but not for tracking any javascript errors on the page, no?
    – jeremy
    Commented Nov 21, 2018 at 14:50

1 Answer 1

0

As user mrded mentioned in the later answer in the post you referred to, are you sure you: 1. have jQuery loaded at the right moment 2. have jQuery with "$" loaded at all (and not with "jQuery" instead)

Did you try his code instead?

2
  • Thanks for the reply. Yes jquery is defined before, and with $ As for his code, I tried it. It did trigger a hit with the data, but no pageview for Google Analytics Furthermore, I do not want to implement the GA + this one because I do not want to call the analytics.js twice in the page
    – jeremy
    Commented Nov 21, 2018 at 11:06
  • how do you mean "no pageview"? and you don't need to implement his code as a whole, but only the part with sending the event and defining the error tracking
    – IgorKol
    Commented Nov 21, 2018 at 16:07

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.