alphagov/govuk_frontend_toolkit

Google analytics error

bendiggle opened this issue · 2 comments

Currently our google analytics is not working for version 7.4.2.

It is erroring here: https://github.com/alphagov/govuk_frontend_toolkit/blob/master/javascripts/govuk/analytics/analytics.js#L102, where location is undefined.

Below is an image of the errors in the browser.

screen shot 2018-03-06 at 16 13 54

Any ideas?

Thanks for raising this. That function is called from trackPageview which passes window.location as the location argument.

The error you're seeing suggests that window.location is undefined, which would be unusual – is there anything you're doing in your code that could be causing this?

Hi @36degrees, thanks for getting back to me. This problem has been resolved. It was an issue with our webpack config.
Thanks again!