Skip to content

Commit

Permalink
Merge pull request #230 from digital-land/disbaleGA
Browse files Browse the repository at this point in the history
Remove google analytics
  • Loading branch information
GeorgeGoodall authored Dec 8, 2023
2 parents 70ea257 + 3ea71cb commit a022f92
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion assets/javascripts/cookies.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export function showCookieConfirmation () {

export function setTrackingCookies () {
var cookiesPolicy = JSON.parse(getCookie('cookies_policy'))
var doNotTrack = cookiesPolicy == null || !cookiesPolicy.usage
var doNotTrack = true; //cookiesPolicy == null || !cookiesPolicy.usage
if (doNotTrack) {
if(window.gaMeasurementId){
window[`ga-disable-${window.gaMeasurementId}`] = true;
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/javascript/cookies.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ describe('cookies.js', () => {
window.gaMeasurementId = fakeMeasurementId;
setCookie('cookies_policy', JSON.stringify({usage: true}));
setTrackingCookies();
expect(window[`ga-disable-${fakeMeasurementId}`]).toBe(false);
expect(window[`ga-disable-${fakeMeasurementId}`]).toBe(true);

expect(Array.from(dataLayer[0])).toEqual(['js', new Date()]);
expect(Array.from(dataLayer[1])).toEqual(['config', fakeMeasurementId]);
// expect(Array.from(dataLayer[0])).toEqual(['js', new Date()]);
// expect(Array.from(dataLayer[1])).toEqual(['config', fakeMeasurementId]);

})
})
Expand Down

0 comments on commit a022f92

Please sign in to comment.