Skip to content

Commit

Permalink
Merge branch 'master' into CON-2796-Create-version-5-legal-agreement
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Howes committed Jan 15, 2021
2 parents e89666c + af48392 commit 2d469f5
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,20 @@

@section pageSpecificJS {
<script type="text/javascript">
$(function () {
sfa.homePage.init();
$(function () {
var pageTitle = $('h1.govuk-heading-xl').text().trim();
$('.govuk-radios').each(function () {
var dataLayerObj
var radios = $(this).find('input:radio');
radios.on('change', function () {
dataLayerObj = {
event: 'radio button selected',
page: pageTitle,
radio: this.id
}
window.dataLayer.push(dataLayerObj)
})
});
});
</script>
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,27 @@
</div>
</div>

@section pageSpecificJS {
<script type="text/javascript">
$(function () {
var pageTitle = $('h1.govuk-heading-xl').text().trim();
$('.govuk-radios').each(function () {
var dataLayerObj
var radios = $(this).find('input:radio');
radios.on('change', function () {
dataLayerObj = {
event: 'radio button selected',
page: pageTitle,
radio: this.id
}
window.dataLayer.push(dataLayerObj)
})
});
});
</script>
}



@*<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,17 +177,33 @@
@section pageSpecificJS {
<script>
$(function () {
var filterForm = $('#filter');
//if (filterForm.length > 0) {
var radios = filterForm.find('input:radio');
var pageTitle = $('h1.govuk-heading-xl').text().trim();
var formFilter = $('form#filter');
var dataLayerObj
var radios = formFilter.find('input:radio');
radios.on('change', function () {
var radioLabel = radios.filter(':checked').siblings('label').text();
dataLayer.push({
var radioLabel = $(this).siblings('label').text().trim().substring(0, 30)
dataLayerObj = {
event: 'radio button selected',
page: pageTitle,
radio: radioLabel
}
window.dataLayer.push(dataLayerObj)
// Keep existing DL push
window.dataLayer.push({
'cd1': radioLabel
});
filterForm.submit();
});
//}
// Submit form
formFilter.submit()
})
});
</script>
}
Expand Down

0 comments on commit 2d469f5

Please sign in to comment.