Skip to content

Commit

Permalink
adding new ga cookie nammes
Browse files Browse the repository at this point in the history
  • Loading branch information
liyokuna committed Apr 26, 2020
1 parent 1e776da commit 9ad42e0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class CookieServiceComponent implements OnInit {
this.isOpened.emit(this.showAlertCookie);
}

if (this.cookiemanager.getCookie('consent') && this.showAlertCookie) {
if (this.cookiemanager.getCookie('consent') && !this.showAlertCookie) {
const TrackNavigator = navigator.doNotTrack;
if ( (TrackNavigator === '1' || TrackNavigator === 'yes' ) ) {
this.cookiemanager.rejectCookie(this.GA_ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Injectable } from '@angular/core';
export class CookieServiceService {

constructor() { }
private GA_COOKIE_NAMES = ['__utma', '__utmb', '__utmc', '__utmz', '_ga', '_gat'];
private GA_COOKIE_NAMES = ['__utma', '__utmb', '__utmc', '__utmz', '_ga', '_gid', '_gat', '_gat_gtag'];

public setCookie(name: string, val: boolean, domain: string) {
const date = new Date();
Expand Down Expand Up @@ -43,6 +43,7 @@ export class CookieServiceService {
this.deleteCookie(`ga-disable-${gaId}`);
this.deleteCookie('consent');
window[`ga-disable-${gaId}`] = true;
window[`_gat_gtag_${gaId}`] = false;
this.GA_COOKIE_NAMES.forEach((cookieName) => {
this.deleteCookie(cookieName);
});
Expand Down

0 comments on commit 9ad42e0

Please sign in to comment.