Skip to content

Commit edc82ed

Browse files
authored
Merge pull request #13391 from guardian/ei/add-comscorekw-comment
Add comscorekw as comment to html source
2 parents bce9042 + d160318 commit edc82ed

File tree

5 files changed

+11
-15
lines changed

5 files changed

+11
-15
lines changed

dotcom-rendering/src/server/htmlPageTemplate.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ type BaseProps = {
3030

3131
interface WebProps extends BaseProps {
3232
renderingTarget: 'Web';
33-
keywords: string;
33+
section: string;
3434
config: Config & { renderingTarget: 'Web' };
3535
}
3636

@@ -363,14 +363,15 @@ https://workforus.theguardian.com/careers/product-engineering/
363363
renderingTarget === 'Web'
364364
? `
365365
<noscript>
366+
<!-- Comscore Identifier: comscorekw=${props.section} -->
366367
<img src="https://sb.scorecardresearch.com/p?${new URLSearchParams(
367368
{
368369
c1: '2',
369370
c2: '6035250',
370371
cv: '2.0',
371372
cj: '1',
372373
cs_ucfr: '0',
373-
comscorekw: props.keywords,
374+
comscorekw: props.section,
374375
},
375376
).toString()}" />
376377
</noscript>

dotcom-rendering/src/server/render.allEditorialNewslettersPage.web.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export const renderEditorialNewslettersPage = ({
9595
title,
9696
description: newslettersPage.description,
9797
guardian,
98-
keywords: '',
98+
section: '',
9999
renderingTarget: 'Web',
100100
weAreHiring: !!newslettersPage.config.switches.weAreHiring,
101101
config,

dotcom-rendering/src/server/render.article.web.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,7 @@ export const renderHtml = ({
178178
const ampLink = getAmpLink(frontendData.tags);
179179

180180
const { openGraphData, twitterData } = frontendData;
181-
const keywords =
182-
typeof frontendData.config.keywords === 'undefined' ||
183-
frontendData.config.keywords === 'Network Front'
184-
? ''
185-
: frontendData.config.keywords;
186-
181+
const section = frontendData.config.section;
187182
const initTwitter = `
188183
<script>
189184
// https://developer.twitter.com/en/docs/twitter-for-websites/javascript-api/guides/set-up-twitter-for-websites
@@ -218,7 +213,7 @@ window.twttr = (function(d, s, id) {
218213
ampLink,
219214
openGraphData,
220215
twitterData,
221-
keywords,
216+
section,
222217
initTwitter:
223218
pageHasTweetElements || format.design === ArticleDesign.LiveBlog
224219
? initTwitter

dotcom-rendering/src/server/render.footballDataPage.web.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export const renderFootballDataPage = (footballData: DCRFootballDataPage) => {
134134
googleRecaptchaSiteKey: footballData.config.googleRecaptchaSiteKey,
135135
unknownConfig: footballData.config,
136136
}),
137-
keywords: '',
137+
section: '',
138138
renderingTarget,
139139
weAreHiring: !!footballData.config.switches.weAreHiring,
140140
config,

dotcom-rendering/src/server/render.front.web.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export const renderFront = ({
146146
unknownConfig: front.config,
147147
});
148148

149-
const keywords = front.config.keywords;
149+
const section = front.config.section;
150150

151151
const canonicalUrl =
152152
front.isNetworkFront &&
@@ -162,7 +162,7 @@ export const renderFront = ({
162162
title,
163163
description: front.pressedPage.seoData.description,
164164
guardian,
165-
keywords,
165+
section,
166166
renderingTarget: 'Web',
167167
hasPageSkin: front.config.hasPageSkin,
168168
weAreHiring: !!front.config.switches.weAreHiring,
@@ -248,7 +248,7 @@ export const renderTagPage = ({
248248
unknownConfig: tagPage.config,
249249
});
250250

251-
const keywords = tagPage.config.keywords;
251+
const section = tagPage.config.section;
252252

253253
const pageHtml = htmlPageTemplate({
254254
scriptTags,
@@ -257,7 +257,7 @@ export const renderTagPage = ({
257257
title,
258258
description: tagPage.header.description,
259259
guardian,
260-
keywords,
260+
section,
261261
renderingTarget: 'Web',
262262
weAreHiring: !!tagPage.config.switches.weAreHiring,
263263
canonicalUrl: tagPage.canonicalUrl,

0 commit comments

Comments
 (0)