@guardian/commercial-core 0.37.0 → 0.39.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/cjs/EventTimer.d.ts +1 -1
  2. package/dist/cjs/EventTimer.js +12 -10
  3. package/dist/cjs/ad-sizes.d.ts +1 -1
  4. package/dist/cjs/ad-sizes.js +10 -10
  5. package/dist/cjs/targeting/pick-targeting-values.d.ts +2 -2
  6. package/dist/cjs/targeting/viewport.js +1 -1
  7. package/dist/cjs/third-party-tags/facebook-pixel.d.ts +5 -0
  8. package/dist/cjs/third-party-tags/facebook-pixel.js +5 -0
  9. package/dist/cjs/third-party-tags/ias.d.ts +5 -0
  10. package/dist/cjs/third-party-tags/ias.js +5 -0
  11. package/dist/cjs/third-party-tags/inizio.d.ts +5 -0
  12. package/dist/cjs/third-party-tags/inizio.js +5 -0
  13. package/dist/cjs/third-party-tags/permutive.d.ts +4 -0
  14. package/dist/cjs/third-party-tags/permutive.js +4 -0
  15. package/dist/cjs/third-party-tags/remarketing.d.ts +5 -0
  16. package/dist/cjs/third-party-tags/remarketing.js +5 -0
  17. package/dist/cjs/third-party-tags/twitter-uwt.d.ts +5 -0
  18. package/dist/cjs/third-party-tags/twitter-uwt.js +5 -0
  19. package/dist/cjs/types.d.ts +2 -1
  20. package/dist/esm/EventTimer.d.ts +1 -1
  21. package/dist/esm/EventTimer.js +12 -10
  22. package/dist/esm/ad-sizes.d.ts +1 -1
  23. package/dist/esm/ad-sizes.js +10 -10
  24. package/dist/esm/targeting/pick-targeting-values.d.ts +2 -2
  25. package/dist/esm/targeting/viewport.js +1 -1
  26. package/dist/esm/third-party-tags/facebook-pixel.d.ts +5 -0
  27. package/dist/esm/third-party-tags/facebook-pixel.js +5 -0
  28. package/dist/esm/third-party-tags/ias.d.ts +5 -0
  29. package/dist/esm/third-party-tags/ias.js +5 -0
  30. package/dist/esm/third-party-tags/inizio.d.ts +5 -0
  31. package/dist/esm/third-party-tags/inizio.js +5 -0
  32. package/dist/esm/third-party-tags/permutive.d.ts +4 -0
  33. package/dist/esm/third-party-tags/permutive.js +4 -0
  34. package/dist/esm/third-party-tags/remarketing.d.ts +5 -0
  35. package/dist/esm/third-party-tags/remarketing.js +5 -0
  36. package/dist/esm/third-party-tags/twitter-uwt.d.ts +5 -0
  37. package/dist/esm/third-party-tags/twitter-uwt.js +5 -0
  38. package/dist/esm/types.d.ts +2 -1
  39. package/package.json +6 -5
@@ -57,7 +57,7 @@ export declare class EventTimer {
57
57
  * by EventTimer so they need to be concatenated to EventTimer's private events array.
58
58
  */
59
59
  get events(): Event[];
60
- constructor();
60
+ private constructor();
61
61
  /**
62
62
  * Creates a new performance mark
63
63
  * For slot events also ensures each TYPE of event event is marked only once for 'first'
@@ -96,9 +96,13 @@ class EventTimer {
96
96
  ? [
97
97
  ...this._events,
98
98
  ...EventTimer._externallyDefinedEventNames
99
- .filter((eventName) => window.performance.getEntriesByName(eventName)
100
- .length)
101
- .map((eventName) => new Event(eventName, window.performance.getEntriesByName(eventName)[0])),
99
+ .map((eventName) => {
100
+ const entry = window.performance.getEntriesByName(eventName)[0];
101
+ return entry
102
+ ? new Event(eventName, entry)
103
+ : undefined;
104
+ })
105
+ .filter((entry) => entry instanceof Event),
102
106
  ]
103
107
  : this._events;
104
108
  }
@@ -137,13 +141,11 @@ class EventTimer {
137
141
  mark(name) {
138
142
  const longName = `gu.commercial.${name}`;
139
143
  if (typeof window.performance !== 'undefined' &&
140
- 'mark' in window.performance) {
141
- window.performance.mark(longName);
142
- // Most recent mark with this name is the event we just created.
143
- const mark = window.performance
144
- .getEntriesByName(longName, 'mark')
145
- .slice(-1)[0];
146
- if (typeof mark !== 'undefined') {
144
+ 'mark' in window.performance &&
145
+ typeof window.performance.mark === 'function') {
146
+ const mark = window.performance.mark(longName);
147
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- browser support is patchy
148
+ if (typeof mark?.startTime === 'number') {
147
149
  this._events.push(new Event(name, mark));
148
150
  }
149
151
  }
@@ -4,7 +4,7 @@ export declare type AdSize = Readonly<{
4
4
  height: number;
5
5
  toString: () => AdSizeString;
6
6
  }>;
7
- export declare type SizeKeys = 'billboard' | 'leaderboard' | 'mpu' | 'halfPage' | 'portrait' | 'skyscraper' | 'mobilesticky' | 'fluid' | 'outOfPage' | 'googleCard' | 'video' | 'outstreamDesktop' | 'outstreamGoogleDesktop' | 'outstreamMobile' | 'merchandisingHighAdFeature' | 'merchandisingHigh' | 'merchandising' | 'inlineMerchandising' | 'fabric' | 'empty' | '970x250' | '728x90' | '300x250' | '300x600' | '300x1050' | '160x600';
7
+ export declare type SizeKeys = '160x600' | '300x1050' | '300x250' | '300x600' | '728x90' | '970x250' | 'billboard' | 'empty' | 'fabric' | 'fluid' | 'googleCard' | 'halfPage' | 'inlineMerchandising' | 'leaderboard' | 'merchandising' | 'merchandisingHigh' | 'merchandisingHighAdFeature' | 'mobilesticky' | 'mpu' | 'outOfPage' | 'outstreamDesktop' | 'outstreamGoogleDesktop' | 'outstreamMobile' | 'portrait' | 'skyscraper' | 'video';
8
8
  export declare const adSizes: Record<SizeKeys, AdSize>;
9
9
  export declare const getAdSize: (size: SizeKeys) => AdSize;
10
10
  export declare const _: {
@@ -12,27 +12,27 @@ const createAdSize = (width, height) => {
12
12
  const adSizesPartial = {
13
13
  // standard ad sizes
14
14
  billboard: createAdSize(970, 250),
15
+ halfPage: createAdSize(300, 600),
15
16
  leaderboard: createAdSize(728, 90),
17
+ mobilesticky: createAdSize(320, 50),
16
18
  mpu: createAdSize(300, 250),
17
- halfPage: createAdSize(300, 600),
18
19
  portrait: createAdSize(300, 1050),
19
20
  skyscraper: createAdSize(160, 600),
20
- mobilesticky: createAdSize(320, 50),
21
21
  // dfp proprietary ad sizes
22
22
  fluid: createAdSize(0, 0),
23
- outOfPage: createAdSize(1, 1),
24
23
  googleCard: createAdSize(300, 274),
24
+ outOfPage: createAdSize(1, 1),
25
25
  // guardian proprietary ad sizes
26
- video: createAdSize(620, 1),
26
+ empty: createAdSize(2, 2),
27
+ fabric: createAdSize(88, 71),
28
+ inlineMerchandising: createAdSize(88, 85),
29
+ merchandising: createAdSize(88, 88),
30
+ merchandisingHigh: createAdSize(88, 87),
31
+ merchandisingHighAdFeature: createAdSize(88, 89),
27
32
  outstreamDesktop: createAdSize(620, 350),
28
33
  outstreamGoogleDesktop: createAdSize(550, 310),
29
34
  outstreamMobile: createAdSize(300, 197),
30
- merchandisingHighAdFeature: createAdSize(88, 89),
31
- merchandisingHigh: createAdSize(88, 87),
32
- merchandising: createAdSize(88, 88),
33
- inlineMerchandising: createAdSize(88, 85),
34
- fabric: createAdSize(88, 71),
35
- empty: createAdSize(2, 2),
35
+ video: createAdSize(620, 1),
36
36
  };
37
37
  exports.adSizes = {
38
38
  ...adSizesPartial,
@@ -1,5 +1,5 @@
1
1
  import type { ConditionalExcept } from 'type-fest';
2
- declare type ValidTargetingObject<Base> = ConditionalExcept<Base, null | undefined | '' | readonly [] | readonly [''] | boolean | number>;
2
+ declare type ValidTargetingObject<Base> = ConditionalExcept<Base, null | undefined | '' | readonly [] | readonly [''] | never[] | boolean | number>;
3
3
  /**
4
4
  * Picks only keys with targeting values from an object.
5
5
  * A targeting values is defined as either:
@@ -21,5 +21,5 @@ declare type ValidTargetingObject<Base> = ConditionalExcept<Base, null | undefin
21
21
  * clean.invalid
22
22
  * ```
23
23
  */
24
- export declare const pickTargetingValues: <T extends Record<string, string | readonly string[] | undefined>>(obj: T) => import("type-fest").Except<T, NonNullable<{ [Key in keyof T]: T[Key] extends number | boolean | "" | readonly [] | readonly [""] | null | undefined ? Key : never; }[keyof T]>>;
24
+ export declare const pickTargetingValues: <T extends Record<string, string | readonly string[] | undefined>>(obj: T) => import("type-fest").Except<T, NonNullable<{ [Key in keyof T]: T[Key] extends number | boolean | "" | never[] | readonly [] | readonly [""] | null | undefined ? Key : never; }[keyof T]>>;
25
25
  export {};
@@ -5,7 +5,7 @@ exports.getViewportTargeting = void 0;
5
5
  const findBreakpoint = (width) => {
6
6
  if (width >= 980)
7
7
  return 'desktop';
8
- if (width >= 740)
8
+ if (width >= 660)
9
9
  return 'tablet';
10
10
  return 'mobile';
11
11
  };
@@ -1,2 +1,7 @@
1
1
  import type { GetThirdPartyTag } from '../types';
2
+ /**
3
+ * tracking pixel
4
+ * https://en-gb.facebook.com/business/learn/facebook-ads-pixel
5
+ * @param {} {shouldRun}
6
+ */
2
7
  export declare const fbPixel: GetThirdPartyTag;
@@ -1,6 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.fbPixel = void 0;
4
+ /**
5
+ * tracking pixel
6
+ * https://en-gb.facebook.com/business/learn/facebook-ads-pixel
7
+ * @param {} {shouldRun}
8
+ */
4
9
  const fbPixel = ({ shouldRun }) => ({
5
10
  shouldRun,
6
11
  url: `https://www.facebook.com/tr?id=279880532344561&ev=PageView&noscript=1`,
@@ -1,2 +1,7 @@
1
1
  import type { GetThirdPartyTag } from '../types';
2
+ /**
3
+ * IAS script filters bad ads
4
+ * https://integralads.com/uk/
5
+ * @param {} {shouldRun}
6
+ */
2
7
  export declare const ias: GetThirdPartyTag;
@@ -1,6 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ias = void 0;
4
+ /**
5
+ * IAS script filters bad ads
6
+ * https://integralads.com/uk/
7
+ * @param {} {shouldRun}
8
+ */
4
9
  const ias = ({ shouldRun }) => ({
5
10
  shouldRun,
6
11
  url: '//cdn.adsafeprotected.com/iasPET.1.js',
@@ -1,4 +1,9 @@
1
1
  import type { GetThirdPartyTag } from '../types';
2
+ /**
3
+ * Allows creatives to show survey
4
+ * https://trello.com/c/wHffHVF1/171-integrate-and-test-inizio
5
+ * @param {} {shouldRun}
6
+ */
2
7
  export declare const inizio: GetThirdPartyTag;
3
8
  export declare const _: {
4
9
  onLoad: () => void;
@@ -21,6 +21,11 @@ const onLoad = () => {
21
21
  },
22
22
  });
23
23
  };
24
+ /**
25
+ * Allows creatives to show survey
26
+ * https://trello.com/c/wHffHVF1/171-integrate-and-test-inizio
27
+ * @param {} {shouldRun}
28
+ */
24
29
  const inizio = ({ shouldRun }) => ({
25
30
  shouldRun,
26
31
  url: '//cdn.brandmetrics.com/survey/script/e96d04c832084488a841a06b49b8fb2d.js',
@@ -1,2 +1,6 @@
1
1
  import type { GetThirdPartyTag } from '../types';
2
+ /**
3
+ * Permutive script updates local user segmentation data
4
+ * @param {} {shouldRun}
5
+ */
2
6
  export declare const permutive: GetThirdPartyTag;
@@ -1,6 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.permutive = void 0;
4
+ /**
5
+ * Permutive script updates local user segmentation data
6
+ * @param {} {shouldRun}
7
+ */
4
8
  const permutive = ({ shouldRun }) => ({
5
9
  shouldRun,
6
10
  url: '//cdn.permutive.com/d6691a17-6fdb-4d26-85d6-b3dd27f55f08-web.js',
@@ -1,2 +1,7 @@
1
1
  import type { GetThirdPartyTag } from '../types';
2
+ /**
3
+ * Google conversion tracking
4
+ * https://support.google.com/google-ads/answer/6095821
5
+ * @param {} {shouldRun}
6
+ */
2
7
  export declare const remarketing: GetThirdPartyTag;
@@ -8,6 +8,11 @@ const onLoad = () => {
8
8
  google_remarketing_only: true,
9
9
  });
10
10
  };
11
+ /**
12
+ * Google conversion tracking
13
+ * https://support.google.com/google-ads/answer/6095821
14
+ * @param {} {shouldRun}
15
+ */
11
16
  const remarketing = ({ shouldRun }) => ({
12
17
  shouldRun,
13
18
  url: '//www.googleadservices.com/pagead/conversion_async.js',
@@ -1,2 +1,7 @@
1
1
  import type { GetThirdPartyTag } from '../types';
2
+ /**
3
+ * tracking pixel
4
+ * https://business.twitter.com/en/help/campaign-measurement-and-analytics/conversion-tracking-for-websites.html
5
+ * @param {} {shouldRun}
6
+ */
2
7
  export declare const twitter: GetThirdPartyTag;
@@ -2,6 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.twitter = void 0;
4
4
  const twitter_script_1 = require("../__vendor/twitter-script");
5
+ /**
6
+ * tracking pixel
7
+ * https://business.twitter.com/en/help/campaign-measurement-and-analytics/conversion-tracking-for-websites.html
8
+ * @param {} {shouldRun}
9
+ */
5
10
  const twitter = ({ shouldRun }) => ({
6
11
  shouldRun,
7
12
  name: 'twitter',
@@ -1,3 +1,4 @@
1
+ import type { VendorName } from '@guardian/consent-management-platform/dist/types';
1
2
  export declare type TagAttribute = {
2
3
  name: string;
3
4
  value: string;
@@ -10,7 +11,7 @@ export declare type ThirdPartyTag = {
10
11
  loaded?: boolean;
11
12
  onLoad?: () => void;
12
13
  shouldRun: boolean;
13
- name?: string;
14
+ name?: VendorName;
14
15
  url?: string;
15
16
  useImage?: boolean;
16
17
  };
@@ -57,7 +57,7 @@ export declare class EventTimer {
57
57
  * by EventTimer so they need to be concatenated to EventTimer's private events array.
58
58
  */
59
59
  get events(): Event[];
60
- constructor();
60
+ private constructor();
61
61
  /**
62
62
  * Creates a new performance mark
63
63
  * For slot events also ensures each TYPE of event event is marked only once for 'first'
@@ -93,9 +93,13 @@ export class EventTimer {
93
93
  ? [
94
94
  ...this._events,
95
95
  ...EventTimer._externallyDefinedEventNames
96
- .filter((eventName) => window.performance.getEntriesByName(eventName)
97
- .length)
98
- .map((eventName) => new Event(eventName, window.performance.getEntriesByName(eventName)[0])),
96
+ .map((eventName) => {
97
+ const entry = window.performance.getEntriesByName(eventName)[0];
98
+ return entry
99
+ ? new Event(eventName, entry)
100
+ : undefined;
101
+ })
102
+ .filter((entry) => entry instanceof Event),
99
103
  ]
100
104
  : this._events;
101
105
  }
@@ -134,13 +138,11 @@ export class EventTimer {
134
138
  mark(name) {
135
139
  const longName = `gu.commercial.${name}`;
136
140
  if (typeof window.performance !== 'undefined' &&
137
- 'mark' in window.performance) {
138
- window.performance.mark(longName);
139
- // Most recent mark with this name is the event we just created.
140
- const mark = window.performance
141
- .getEntriesByName(longName, 'mark')
142
- .slice(-1)[0];
143
- if (typeof mark !== 'undefined') {
141
+ 'mark' in window.performance &&
142
+ typeof window.performance.mark === 'function') {
143
+ const mark = window.performance.mark(longName);
144
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- browser support is patchy
145
+ if (typeof mark?.startTime === 'number') {
144
146
  this._events.push(new Event(name, mark));
145
147
  }
146
148
  }
@@ -4,7 +4,7 @@ export declare type AdSize = Readonly<{
4
4
  height: number;
5
5
  toString: () => AdSizeString;
6
6
  }>;
7
- export declare type SizeKeys = 'billboard' | 'leaderboard' | 'mpu' | 'halfPage' | 'portrait' | 'skyscraper' | 'mobilesticky' | 'fluid' | 'outOfPage' | 'googleCard' | 'video' | 'outstreamDesktop' | 'outstreamGoogleDesktop' | 'outstreamMobile' | 'merchandisingHighAdFeature' | 'merchandisingHigh' | 'merchandising' | 'inlineMerchandising' | 'fabric' | 'empty' | '970x250' | '728x90' | '300x250' | '300x600' | '300x1050' | '160x600';
7
+ export declare type SizeKeys = '160x600' | '300x1050' | '300x250' | '300x600' | '728x90' | '970x250' | 'billboard' | 'empty' | 'fabric' | 'fluid' | 'googleCard' | 'halfPage' | 'inlineMerchandising' | 'leaderboard' | 'merchandising' | 'merchandisingHigh' | 'merchandisingHighAdFeature' | 'mobilesticky' | 'mpu' | 'outOfPage' | 'outstreamDesktop' | 'outstreamGoogleDesktop' | 'outstreamMobile' | 'portrait' | 'skyscraper' | 'video';
8
8
  export declare const adSizes: Record<SizeKeys, AdSize>;
9
9
  export declare const getAdSize: (size: SizeKeys) => AdSize;
10
10
  export declare const _: {
@@ -9,27 +9,27 @@ const createAdSize = (width, height) => {
9
9
  const adSizesPartial = {
10
10
  // standard ad sizes
11
11
  billboard: createAdSize(970, 250),
12
+ halfPage: createAdSize(300, 600),
12
13
  leaderboard: createAdSize(728, 90),
14
+ mobilesticky: createAdSize(320, 50),
13
15
  mpu: createAdSize(300, 250),
14
- halfPage: createAdSize(300, 600),
15
16
  portrait: createAdSize(300, 1050),
16
17
  skyscraper: createAdSize(160, 600),
17
- mobilesticky: createAdSize(320, 50),
18
18
  // dfp proprietary ad sizes
19
19
  fluid: createAdSize(0, 0),
20
- outOfPage: createAdSize(1, 1),
21
20
  googleCard: createAdSize(300, 274),
21
+ outOfPage: createAdSize(1, 1),
22
22
  // guardian proprietary ad sizes
23
- video: createAdSize(620, 1),
23
+ empty: createAdSize(2, 2),
24
+ fabric: createAdSize(88, 71),
25
+ inlineMerchandising: createAdSize(88, 85),
26
+ merchandising: createAdSize(88, 88),
27
+ merchandisingHigh: createAdSize(88, 87),
28
+ merchandisingHighAdFeature: createAdSize(88, 89),
24
29
  outstreamDesktop: createAdSize(620, 350),
25
30
  outstreamGoogleDesktop: createAdSize(550, 310),
26
31
  outstreamMobile: createAdSize(300, 197),
27
- merchandisingHighAdFeature: createAdSize(88, 89),
28
- merchandisingHigh: createAdSize(88, 87),
29
- merchandising: createAdSize(88, 88),
30
- inlineMerchandising: createAdSize(88, 85),
31
- fabric: createAdSize(88, 71),
32
- empty: createAdSize(2, 2),
32
+ video: createAdSize(620, 1),
33
33
  };
34
34
  export const adSizes = {
35
35
  ...adSizesPartial,
@@ -1,5 +1,5 @@
1
1
  import type { ConditionalExcept } from 'type-fest';
2
- declare type ValidTargetingObject<Base> = ConditionalExcept<Base, null | undefined | '' | readonly [] | readonly [''] | boolean | number>;
2
+ declare type ValidTargetingObject<Base> = ConditionalExcept<Base, null | undefined | '' | readonly [] | readonly [''] | never[] | boolean | number>;
3
3
  /**
4
4
  * Picks only keys with targeting values from an object.
5
5
  * A targeting values is defined as either:
@@ -21,5 +21,5 @@ declare type ValidTargetingObject<Base> = ConditionalExcept<Base, null | undefin
21
21
  * clean.invalid
22
22
  * ```
23
23
  */
24
- export declare const pickTargetingValues: <T extends Record<string, string | readonly string[] | undefined>>(obj: T) => import("type-fest").Except<T, NonNullable<{ [Key in keyof T]: T[Key] extends number | boolean | "" | readonly [] | readonly [""] | null | undefined ? Key : never; }[keyof T]>>;
24
+ export declare const pickTargetingValues: <T extends Record<string, string | readonly string[] | undefined>>(obj: T) => import("type-fest").Except<T, NonNullable<{ [Key in keyof T]: T[Key] extends number | boolean | "" | never[] | readonly [] | readonly [""] | null | undefined ? Key : never; }[keyof T]>>;
25
25
  export {};
@@ -2,7 +2,7 @@
2
2
  const findBreakpoint = (width) => {
3
3
  if (width >= 980)
4
4
  return 'desktop';
5
- if (width >= 740)
5
+ if (width >= 660)
6
6
  return 'tablet';
7
7
  return 'mobile';
8
8
  };
@@ -1,2 +1,7 @@
1
1
  import type { GetThirdPartyTag } from '../types';
2
+ /**
3
+ * tracking pixel
4
+ * https://en-gb.facebook.com/business/learn/facebook-ads-pixel
5
+ * @param {} {shouldRun}
6
+ */
2
7
  export declare const fbPixel: GetThirdPartyTag;
@@ -1,3 +1,8 @@
1
+ /**
2
+ * tracking pixel
3
+ * https://en-gb.facebook.com/business/learn/facebook-ads-pixel
4
+ * @param {} {shouldRun}
5
+ */
1
6
  export const fbPixel = ({ shouldRun }) => ({
2
7
  shouldRun,
3
8
  url: `https://www.facebook.com/tr?id=279880532344561&ev=PageView&noscript=1`,
@@ -1,2 +1,7 @@
1
1
  import type { GetThirdPartyTag } from '../types';
2
+ /**
3
+ * IAS script filters bad ads
4
+ * https://integralads.com/uk/
5
+ * @param {} {shouldRun}
6
+ */
2
7
  export declare const ias: GetThirdPartyTag;
@@ -1,3 +1,8 @@
1
+ /**
2
+ * IAS script filters bad ads
3
+ * https://integralads.com/uk/
4
+ * @param {} {shouldRun}
5
+ */
1
6
  export const ias = ({ shouldRun }) => ({
2
7
  shouldRun,
3
8
  url: '//cdn.adsafeprotected.com/iasPET.1.js',
@@ -1,4 +1,9 @@
1
1
  import type { GetThirdPartyTag } from '../types';
2
+ /**
3
+ * Allows creatives to show survey
4
+ * https://trello.com/c/wHffHVF1/171-integrate-and-test-inizio
5
+ * @param {} {shouldRun}
6
+ */
2
7
  export declare const inizio: GetThirdPartyTag;
3
8
  export declare const _: {
4
9
  onLoad: () => void;
@@ -18,6 +18,11 @@ const onLoad = () => {
18
18
  },
19
19
  });
20
20
  };
21
+ /**
22
+ * Allows creatives to show survey
23
+ * https://trello.com/c/wHffHVF1/171-integrate-and-test-inizio
24
+ * @param {} {shouldRun}
25
+ */
21
26
  export const inizio = ({ shouldRun }) => ({
22
27
  shouldRun,
23
28
  url: '//cdn.brandmetrics.com/survey/script/e96d04c832084488a841a06b49b8fb2d.js',
@@ -1,2 +1,6 @@
1
1
  import type { GetThirdPartyTag } from '../types';
2
+ /**
3
+ * Permutive script updates local user segmentation data
4
+ * @param {} {shouldRun}
5
+ */
2
6
  export declare const permutive: GetThirdPartyTag;
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Permutive script updates local user segmentation data
3
+ * @param {} {shouldRun}
4
+ */
1
5
  export const permutive = ({ shouldRun }) => ({
2
6
  shouldRun,
3
7
  url: '//cdn.permutive.com/d6691a17-6fdb-4d26-85d6-b3dd27f55f08-web.js',
@@ -1,2 +1,7 @@
1
1
  import type { GetThirdPartyTag } from '../types';
2
+ /**
3
+ * Google conversion tracking
4
+ * https://support.google.com/google-ads/answer/6095821
5
+ * @param {} {shouldRun}
6
+ */
2
7
  export declare const remarketing: GetThirdPartyTag;
@@ -5,6 +5,11 @@ const onLoad = () => {
5
5
  google_remarketing_only: true,
6
6
  });
7
7
  };
8
+ /**
9
+ * Google conversion tracking
10
+ * https://support.google.com/google-ads/answer/6095821
11
+ * @param {} {shouldRun}
12
+ */
8
13
  export const remarketing = ({ shouldRun }) => ({
9
14
  shouldRun,
10
15
  url: '//www.googleadservices.com/pagead/conversion_async.js',
@@ -1,2 +1,7 @@
1
1
  import type { GetThirdPartyTag } from '../types';
2
+ /**
3
+ * tracking pixel
4
+ * https://business.twitter.com/en/help/campaign-measurement-and-analytics/conversion-tracking-for-websites.html
5
+ * @param {} {shouldRun}
6
+ */
2
7
  export declare const twitter: GetThirdPartyTag;
@@ -1,4 +1,9 @@
1
1
  import { twitterScript as insertSnippet } from '../__vendor/twitter-script';
2
+ /**
3
+ * tracking pixel
4
+ * https://business.twitter.com/en/help/campaign-measurement-and-analytics/conversion-tracking-for-websites.html
5
+ * @param {} {shouldRun}
6
+ */
2
7
  export const twitter = ({ shouldRun }) => ({
3
8
  shouldRun,
4
9
  name: 'twitter',
@@ -1,3 +1,4 @@
1
+ import type { VendorName } from '@guardian/consent-management-platform/dist/types';
1
2
  export declare type TagAttribute = {
2
3
  name: string;
3
4
  value: string;
@@ -10,7 +11,7 @@ export declare type ThirdPartyTag = {
10
11
  loaded?: boolean;
11
12
  onLoad?: () => void;
12
13
  shouldRun: boolean;
13
- name?: string;
14
+ name?: VendorName;
14
15
  url?: string;
15
16
  useImage?: boolean;
16
17
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guardian/commercial-core",
3
- "version": "0.37.0",
3
+ "version": "0.39.1",
4
4
  "description": "Guardian advertising business logic",
5
5
  "homepage": "https://github.com/guardian/commercial-core#readme",
6
6
  "bugs": {
@@ -41,12 +41,12 @@
41
41
  },
42
42
  "prettier": "@guardian/prettier",
43
43
  "devDependencies": {
44
- "@commitlint/cli": "^15.0.0",
45
- "@commitlint/config-conventional": "^15.0.0",
44
+ "@commitlint/cli": "^16.1.0",
45
+ "@commitlint/config-conventional": "^16.0.0",
46
46
  "@guardian/ab-core": "^2.0.0",
47
- "@guardian/consent-management-platform": "^8.0.1",
47
+ "@guardian/consent-management-platform": "^10.1.0",
48
48
  "@guardian/eslint-config-typescript": "^0.7.0",
49
- "@guardian/libs": "3.5.1",
49
+ "@guardian/libs": "3.6.1",
50
50
  "@guardian/prettier": "^0.7.0",
51
51
  "@octokit/core": "^3.5.1",
52
52
  "@semantic-release/github": "^8.0.2",
@@ -56,6 +56,7 @@
56
56
  "@typescript-eslint/eslint-plugin": "^5.5.0",
57
57
  "@typescript-eslint/parser": "^5.5.0",
58
58
  "commitizen": "^4.2.4",
59
+ "conventional-changelog-conventionalcommits": "^4.6.3",
59
60
  "cz-conventional-changelog": "^3.3.0",
60
61
  "eslint": "^8.4.1",
61
62
  "eslint-config-prettier": "^8.3.0",