Skip to content

Commit cb4e6ef

Browse files
authored
Merge pull request #13360 from guardian/tf-no-browserId
Stop sending browserId to SDC
2 parents ac317af + 10e48a2 commit cb4e6ef

File tree

3 files changed

+1
-30
lines changed

3 files changed

+1
-30
lines changed

dotcom-rendering/src/components/SlotBodyEnd.importable.tsx

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type {
55
} from '@guardian/braze-components/logic';
66
import { adSizes, type SizeMapping } from '@guardian/commercial';
77
import type { CountryCode } from '@guardian/libs';
8-
import { getCookie, isString, isUndefined } from '@guardian/libs';
8+
import { isUndefined } from '@guardian/libs';
99
import { palette } from '@guardian/source/foundations';
1010
import type { WeeklyArticleHistory } from '@guardian/support-dotcom-components/dist/dotcom/types';
1111
import type { ModuleData } from '@guardian/support-dotcom-components/dist/dotcom/types';
@@ -99,20 +99,6 @@ const buildBrazeEpicConfig = (
9999
};
100100
};
101101

102-
const useBrowserId = () => {
103-
const [browserId, setBrowserId] = useState<string>();
104-
105-
useEffect(() => {
106-
const cookie = getCookie({ name: 'bwid', shouldMemoize: true });
107-
108-
const id = isString(cookie) ? cookie : 'no-browser-id-available';
109-
110-
setBrowserId(id);
111-
}, []);
112-
113-
return browserId;
114-
};
115-
116102
export const SlotBodyEnd = ({
117103
contentType,
118104
sectionId,
@@ -131,7 +117,6 @@ export const SlotBodyEnd = ({
131117
const { brazeMessages } = useBraze(idApiUrl, renderingTarget);
132118
const countryCode = useCountryCode('slot-body-end');
133119
const isSignedIn = useIsSignedIn();
134-
const browserId = useBrowserId();
135120
const ophanPageViewId = usePageViewId(renderingTarget);
136121
const [SelectedEpic, setSelectedEpic] = useState<
137122
React.ElementType | null | undefined
@@ -168,7 +153,6 @@ export const SlotBodyEnd = ({
168153
isUndefined(countryCode) ||
169154
isUndefined(brazeMessages) ||
170155
isUndefined(asyncArticleCount) ||
171-
isUndefined(browserId) ||
172156
isUndefined(ophanPageViewId) ||
173157
isSignedIn === 'Pending'
174158
) {
@@ -187,7 +171,6 @@ export const SlotBodyEnd = ({
187171
contributionsServiceUrl,
188172
idApiUrl,
189173
asyncArticleCount,
190-
browserId,
191174
renderingTarget,
192175
ophanPageViewId,
193176
pageId,
@@ -218,7 +201,6 @@ export const SlotBodyEnd = ({
218201
countryCode,
219202
brazeMessages,
220203
asyncArticleCount,
221-
browserId,
222204
contentType,
223205
contributionsServiceUrl,
224206
idApiUrl,

dotcom-rendering/src/components/SlotBodyEnd/ReaderRevenueEpic.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import type {
2020
import { useEffect, useState } from 'react';
2121
import { submitComponentEvent } from '../../client/ophan/ophan';
2222
import {
23-
hasCmpConsentForBrowserId,
2423
hasCmpConsentForWeeklyArticleCount,
2524
hasOptedOutOfArticleCount,
2625
shouldHideSupportMessaging,
@@ -48,7 +47,6 @@ export type CanShowData = {
4847
contributionsServiceUrl: string;
4948
idApiUrl: string;
5049
asyncArticleCount: Promise<WeeklyArticleHistory | undefined>;
51-
browserId?: string;
5250
renderingTarget: RenderingTarget;
5351
ophanPageViewId: string;
5452
pageId?: string;
@@ -72,9 +70,6 @@ const buildPayload = async (
7270
mvtId: Number(getCookie({ name: 'GU_mvt_id', shouldMemoize: true })),
7371
countryCode: data.countryCode,
7472
url: window.location.origin + window.location.pathname,
75-
browserId: (await hasCmpConsentForBrowserId())
76-
? data.browserId
77-
: undefined,
7873
isSignedIn: data.isSignedIn,
7974
pageId: data.pageId,
8075
},

dotcom-rendering/src/components/StickyBottomBanner/ReaderRevenueBanner.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import { submitComponentEvent } from '../../client/ophan/ophan';
2424
import type { ArticleCounts } from '../../lib/articleCount';
2525
import {
2626
getPurchaseInfo,
27-
hasCmpConsentForBrowserId,
2827
hasOptedOutOfArticleCount,
2928
recentlyClosedBanner,
3029
setLocalNoBannerCachePeriod,
@@ -139,8 +138,6 @@ const buildPayload = async ({
139138
const weeklyArticleHistory = articleCounts?.weeklyArticleHistory;
140139
const articleCountToday = getArticleCountToday(articleCounts);
141140

142-
const browserId = getCookie({ name: 'bwid', shouldMemoize: true });
143-
144141
return {
145142
targeting: {
146143
shouldHideReaderRevenue,
@@ -160,9 +157,6 @@ const buildPayload = async ({
160157
sectionId,
161158
tagIds: tags.map((tag) => tag.id),
162159
contentType,
163-
browserId: (await hasCmpConsentForBrowserId())
164-
? browserId ?? undefined
165-
: undefined,
166160
purchaseInfo: getPurchaseInfo(),
167161
isSignedIn,
168162
hasConsented: userConsent,

0 commit comments

Comments
 (0)