Skip to content

Replace polyfill for window.ga (the Google Analytics callback) with a if-exists-call

Sandeep Kadam requested to merge github/fork/wbazant/v1.2 into v1.2

Created by: wbazant

Expression Atlas had no analytics since its switch to foundation, this is an attempt to bring them back.

Explanation of the problem and why the solution works:

Google tells you to use analytics by including this snippet:

i[r] is window['ga'] and if it's something truthy ([] is truthy) the snippet does nothing.

At the same time foundationExtendEBI.js can not rely on window.ga being there (individual teams will have their own tracker, or not) so add an if-exists-then before each function call.

Merge request reports