mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-09 13:29:48 -04:00
Merge pull request #3315 from alphagov/send-generic-title-to-google-analytics
Make analytics send the same title for all pages
This commit is contained in:
@@ -15,6 +15,7 @@
|
|||||||
window.ga('set', 'anonymizeIp', config.anonymizeIp);
|
window.ga('set', 'anonymizeIp', config.anonymizeIp);
|
||||||
window.ga('set', 'allowAdFeatures', config.allowAdFeatures);
|
window.ga('set', 'allowAdFeatures', config.allowAdFeatures);
|
||||||
window.ga('set', 'transport', config.transport);
|
window.ga('set', 'transport', config.transport);
|
||||||
|
window.ga('set', 'title', 'GOV.UK Notify');
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ describe("Analytics", () => {
|
|||||||
expect(setUpArguments[1]).toEqual(['set', 'anonymizeIp', true]);
|
expect(setUpArguments[1]).toEqual(['set', 'anonymizeIp', true]);
|
||||||
expect(setUpArguments[2]).toEqual(['set', 'allowAdFeatures', false]);
|
expect(setUpArguments[2]).toEqual(['set', 'allowAdFeatures', false]);
|
||||||
expect(setUpArguments[3]).toEqual(['set', 'transport', 'beacon']);
|
expect(setUpArguments[3]).toEqual(['set', 'transport', 'beacon']);
|
||||||
|
expect(setUpArguments[4]).toEqual(['set', 'title', 'GOV.UK Notify']);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -111,10 +111,10 @@ describe("Analytics init", () => {
|
|||||||
|
|
||||||
test("A pageview will be registered", () => {
|
test("A pageview will be registered", () => {
|
||||||
|
|
||||||
expect(window.ga.mock.calls.length).toEqual(5);
|
expect(window.ga.mock.calls.length).toEqual(6);
|
||||||
|
|
||||||
// The first 4 calls configure the analytics tracker. All subsequent calls send data
|
// The first 5 calls configure the analytics tracker. All subsequent calls send data
|
||||||
expect(window.ga.mock.calls[4]).toEqual(['send', 'pageview', '/privacy']);
|
expect(window.ga.mock.calls[5]).toEqual(['send', 'pageview', '/privacy']);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -231,8 +231,8 @@ describe("Cookie settings", () => {
|
|||||||
expect(window.GOVUK.initAnalytics).toHaveBeenCalled();
|
expect(window.GOVUK.initAnalytics).toHaveBeenCalled();
|
||||||
|
|
||||||
expect(window.ga).toHaveBeenCalled();
|
expect(window.ga).toHaveBeenCalled();
|
||||||
// the first 4 calls are configuration
|
// the first 5 calls are configuration
|
||||||
expect(window.ga.mock.calls[4]).toEqual(['send', 'pageview', '/privacy']);
|
expect(window.ga.mock.calls[5]).toEqual(['send', 'pageview', '/privacy']);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user