Skip to content

Commit 87f8c72

Browse files
Remove references to previous path as it is no longer required (#12402)
* Remove previousPath * Remove previousPath * getReferrer only requires platform as a param * Reinstate getAtUserId as it was accidentially deleted * Fix tests * Fix tests * Reinstate accidentally deleted variable * Reinstate accidentally deleted variable * Only set virtual referrer on AMP now that previous path has been removed * Resinstate check for document.referrer
1 parent cc4ce85 commit 87f8c72

File tree

17 files changed

+251
-337
lines changed

17 files changed

+251
-337
lines changed

src/app/components/ATIAnalytics/atiUrl/index.test.ts

-2
Original file line numberDiff line numberDiff line change
@@ -320,9 +320,7 @@ describe('Reverb', () => {
320320
pageIdentifier: 'pageIdentifier',
321321
pageTitle: 'pageTitle',
322322
platform: 'canonical' as Platforms,
323-
previousPath: '',
324323
producerName: 'producerName',
325-
origin: 'http://localhost',
326324
nationsProducer: '',
327325
statsDestination: 'statsDestination',
328326
timePublished: 'timePublished',

src/app/components/ATIAnalytics/atiUrl/index.ts

+3-7
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,14 @@ export const buildATIPageTrackPath = ({
4040
statsDestination,
4141
timePublished,
4242
timeUpdated,
43-
origin,
44-
previousPath,
4543
categoryName,
4644
campaigns,
4745
nationsProducer,
4846
ampExperimentName,
4947
experimentVariant,
5048
}: ATIPageTrackingProps) => {
5149
const href = getHref(platform);
52-
const referrer = getReferrer(platform, origin, previousPath);
50+
const referrer = getReferrer(platform);
5351
const campaignType = getCampaignType();
5452

5553
// on AMP, variable substitutions are used in the value and they cannot be
@@ -269,7 +267,7 @@ export const buildATIPageTrackPath = ({
269267
// the ref param should always be the last param because ATI will interpret it as part of the referrer URL
270268
key: 'ref',
271269
description: 'referrer url',
272-
value: getReferrer(platform, origin, previousPath),
270+
value: getReferrer(platform),
273271
wrap: false,
274272
// disable encoding for this parameter as ati does not appear to support
275273
// decoding of the ref parameter
@@ -431,16 +429,14 @@ export const buildReverbAnalyticsModel = ({
431429
pageIdentifier,
432430
pageTitle,
433431
platform,
434-
previousPath,
435432
producerName,
436-
origin,
437433
nationsProducer,
438434
statsDestination,
439435
timePublished,
440436
timeUpdated,
441437
}: ATIPageTrackingProps) => {
442438
const href = getHref(platform);
443-
const referrer = getReferrer(platform, origin, previousPath);
439+
const referrer = getReferrer(platform);
444440

445441
const aggregatedCampaigns = (Array.isArray(campaigns) ? campaigns : [])
446442
.map(({ campaignName }) => campaignName)

0 commit comments

Comments
 (0)