Skip to content

Commit

Permalink
Add option for nonInteraction set to true
Browse files Browse the repository at this point in the history
This matches the previous analytics track event function.

From @36degrees:

The sixth element in the trackEvent array means means that opt_noninteraction is true, which means that the 'event hit will not be used in bounce-rate calculation'.

as per https://developers.google.com/analytics/devguides/collection/analyticsjs/events#non_interaction_events
  • Loading branch information
NickColley committed Sep 25, 2018
1 parent 67efd18 commit 7b827c5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion javascripts/stageprompt.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@

GOVUK.performance.sendGoogleAnalyticsEvent = function (category, event, label) {
if (global.ga && typeof global.ga === 'function') {
global.ga('send', 'event', category, event, label)
global.ga('send', 'event', category, event, label, {
nonInteraction: true
})
} else {
global._gaq.push(['_trackEvent', category, event, label, undefined, true])
}
Expand Down

0 comments on commit 7b827c5

Please sign in to comment.