From 756b4c755e51c46caa49e255510cf453968b7e0f Mon Sep 17 00:00:00 2001 From: Vincent Germain Date: Mon, 9 Oct 2023 14:30:17 +0200 Subject: [PATCH 1/4] fix(cookies): keep special condition for google ads --- .../src/CookieConsentProvider/useSegmentIntegrations.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cookie-consent/src/CookieConsentProvider/useSegmentIntegrations.ts b/packages/cookie-consent/src/CookieConsentProvider/useSegmentIntegrations.ts index b853d06c3..e2c96deca 100644 --- a/packages/cookie-consent/src/CookieConsentProvider/useSegmentIntegrations.ts +++ b/packages/cookie-consent/src/CookieConsentProvider/useSegmentIntegrations.ts @@ -37,8 +37,8 @@ const transformSegmentIntegrationsToIntegrations = ( segmentIntegrations: SegmentIntegrations, ): Integrations => [defaultSegmentIoIntegration, ...segmentIntegrations].map( - ({ category, name }) => ({ - name, + ({ category, creationName, name }) => ({ + name: name === 'Google Ads (Gtag)' ? creationName : name, category: CATEGORY_MATCH[category] ?? 'marketing', }), ) From 0611e8625b9dbc71248bacbec265784a5d9a66b2 Mon Sep 17 00:00:00 2001 From: Vincent Germain Date: Mon, 9 Oct 2023 14:30:43 +0200 Subject: [PATCH 2/4] docs: add comment --- .../src/CookieConsentProvider/useSegmentIntegrations.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/cookie-consent/src/CookieConsentProvider/useSegmentIntegrations.ts b/packages/cookie-consent/src/CookieConsentProvider/useSegmentIntegrations.ts index e2c96deca..e70cb2058 100644 --- a/packages/cookie-consent/src/CookieConsentProvider/useSegmentIntegrations.ts +++ b/packages/cookie-consent/src/CookieConsentProvider/useSegmentIntegrations.ts @@ -38,6 +38,7 @@ const transformSegmentIntegrationsToIntegrations = ( ): Integrations => [defaultSegmentIoIntegration, ...segmentIntegrations].map( ({ category, creationName, name }) => ({ + // Must keep this condition for Google Ads. name: name === 'Google Ads (Gtag)' ? creationName : name, category: CATEGORY_MATCH[category] ?? 'marketing', }), From 340e3c6fe5a91b6ac2f0f30feacc67660cbfee15 Mon Sep 17 00:00:00 2001 From: Vincent Germain Date: Mon, 9 Oct 2023 14:32:50 +0200 Subject: [PATCH 3/4] docs: improve comment --- .../src/CookieConsentProvider/useSegmentIntegrations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cookie-consent/src/CookieConsentProvider/useSegmentIntegrations.ts b/packages/cookie-consent/src/CookieConsentProvider/useSegmentIntegrations.ts index e70cb2058..64ceafc33 100644 --- a/packages/cookie-consent/src/CookieConsentProvider/useSegmentIntegrations.ts +++ b/packages/cookie-consent/src/CookieConsentProvider/useSegmentIntegrations.ts @@ -38,7 +38,7 @@ const transformSegmentIntegrationsToIntegrations = ( ): Integrations => [defaultSegmentIoIntegration, ...segmentIntegrations].map( ({ category, creationName, name }) => ({ - // Must keep this condition for Google Ads. + // Segment requires the `creationName` for this destination. name: name === 'Google Ads (Gtag)' ? creationName : name, category: CATEGORY_MATCH[category] ?? 'marketing', }), From 698927bb24a059d40706c0f57c0a38dea3d60246 Mon Sep 17 00:00:00 2001 From: Vincent Germain Date: Mon, 9 Oct 2023 14:35:17 +0200 Subject: [PATCH 4/4] chore: changeset --- .changeset/eighty-peaches-travel.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/eighty-peaches-travel.md diff --git a/.changeset/eighty-peaches-travel.md b/.changeset/eighty-peaches-travel.md new file mode 100644 index 000000000..326375dcc --- /dev/null +++ b/.changeset/eighty-peaches-travel.md @@ -0,0 +1,5 @@ +--- +'@scaleway/cookie-consent': patch +--- + +keep special condition for google ads