Skip to content

Commit

Permalink
Send cross domain events as final tracking step
Browse files Browse the repository at this point in the history
We modify the options object for cross domain tracking, this
alters the default behaviour. We should be performing our
own event tracking first.
  • Loading branch information
Steve Laing committed Oct 5, 2018
1 parent feeb69a commit e482f97
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/assets/javascripts/modules/track-radio-group.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
if (typeof checkedValue === 'undefined') {
checkedValue = 'submitted-without-choosing'
}

GOVUK.analytics.trackEvent('Radio button chosen', checkedValue + (withHint ? '-with-hint' : ''), options)

if (typeof element.attr('data-tracking-code') !== 'undefined') {
addCrossDomainTracking(element, $checkedOption, options)
}
GOVUK.analytics.trackEvent('Radio button chosen', checkedValue + (withHint ? '-with-hint' : ''), options)
})
}

Expand Down

0 comments on commit e482f97

Please sign in to comment.