Skip to content

Commit

Permalink
consent params
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderkirtzel committed Jul 18, 2024
1 parent 154cdee commit eb0cbb2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/destinations/web/etag/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ describe('Destination etag', () => {

expect(requestedUrl(mockSend)).toContain('v=2');
expect(requestedUrl(mockSend)).toContain('tid=' + measurementId);
expect(requestedUrl(mockSend)).toContain('gcs=G111');
expect(requestedUrl(mockSend)).toContain('_z=fetch');
expect(requestedUrl(mockSend)).toContain('tfd=42000');
expect(requestedUrl(mockSend)).toMatch(/_p=\d/);
Expand Down Expand Up @@ -127,6 +126,15 @@ describe('Destination etag', () => {
);
});

test('consent params', () => {
push(event, { measurementId });

expect(requestedUrl(mockSend)).toContain('gcs=G111');
expect(requestedUrl(mockSend)).toContain('dma=1');
expect(requestedUrl(mockSend)).toContain('dma_cps=syphamo');
expect(requestedUrl(mockSend)).toContain('pscdl=noapi');
});

test('session id', () => {
push({});
expect(requestedUrl(mockSend)).toContain('sid=1006242960'); // hash of undefined
Expand Down
3 changes: 3 additions & 0 deletions packages/destinations/web/etag/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ function getConsentMode(): ParametersConsent {
return {
gcs: 'G111', // Status
// gcd: '11t1t1t1t5', // Default (granted)
dma: 1, // Activate Digital Markets Act
dma_cps: 'syphamo', // Share consent with Google tools by default (custom PII only)
pscdl: 'noapi', // Privacy Sandbox
};
}

Expand Down
3 changes: 3 additions & 0 deletions packages/destinations/web/etag/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ export interface ParametersEvent extends WalkerOS.AnyObject {
export interface ParametersConsent {
gcs?: string; // Consent mode status
gcd?: string; // Consent mode default
dma?: number; // Digital Markets Act
dma_cps?: string; // Consent mode data processing
pscdl?: string; // Privacy Sandbox
}

export interface ParametersDevice extends WalkerOS.AnyObject {
Expand Down

0 comments on commit eb0cbb2

Please sign in to comment.