diff --git a/app/assets/javascripts/analytics/custom-dimensions.js b/app/assets/javascripts/analytics/custom-dimensions.js index 59d808548..9e9f8281a 100644 --- a/app/assets/javascripts/analytics/custom-dimensions.js +++ b/app/assets/javascripts/analytics/custom-dimensions.js @@ -125,6 +125,8 @@ var policyAreaLinks = $('section.document-block a').length + $('section .collection-list h2 a').length + var whitehallFinderPageLinks = + $('.document-list .document-row h3 a').length; var linksCount = relatedLinks || @@ -133,7 +135,8 @@ leafLinks || browsePageLinks || topicPageLinks || - policyAreaLinks; + policyAreaLinks || + whitehallFinderPageLinks; return linksCount; } diff --git a/spec/javascripts/analytics/static-analytics-spec.js b/spec/javascripts/analytics/static-analytics-spec.js index f4cdc59f8..c583678e2 100644 --- a/spec/javascripts/analytics/static-analytics-spec.js +++ b/spec/javascripts/analytics/static-analytics-spec.js @@ -706,6 +706,53 @@ describe("GOVUK.StaticAnalytics", function() { expect(pageViewObject.dimension26).toEqual('2'); }); }); + + describe('on a whitehall finder page (e.g Announcements)', function() { + beforeEach(function() { + $('body').append('\ +