@guardian/ophan-tracker-js 2.6.2 → 2.6.3

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.
@@ -33,7 +33,6 @@ export const record = exports.record;
33
33
  export const viewId = exports.viewId;
34
34
  // Type exports
35
35
  export * from './types/abtest.js';
36
- export * from './types/acquisition.js';
37
36
  export * from './types/subscription.js';
38
37
  export * from './types/interaction.js';
39
38
  export * from './types/inpageclick.js';
package/NPM-dist/ng.js CHANGED
@@ -8,7 +8,6 @@ import './click-path-capture.js';
8
8
  import './perf.js';
9
9
  import './iframe-tracking.js';
10
10
  export * from './types/abtest.js';
11
- export * from './types/acquisition.js';
12
11
  export * from './types/subscription.js';
13
12
  export * from './types/interaction.js';
14
13
  export * from './types/inpageclick.js';
@@ -32,7 +32,6 @@ export const record = supportExports.record;
32
32
  export const viewId = supportExports.viewId;
33
33
  // Type exports
34
34
  export * from './types/abtest.js';
35
- export * from './types/acquisition.js';
36
35
  export * from './types/subscription.js';
37
36
  export * from './types/interaction.js';
38
37
  export * from './types/inpageclick.js';
@@ -15,7 +15,6 @@ export default exports;
15
15
  export declare const record: (event: EventPayload, callback?: () => void) => void;
16
16
  export declare const viewId: string;
17
17
  export * from './types/abtest.js';
18
- export * from './types/acquisition.js';
19
18
  export * from './types/subscription.js';
20
19
  export * from './types/interaction.js';
21
20
  export * from './types/inpageclick.js';
@@ -2,7 +2,6 @@ import './click-path-capture.js';
2
2
  import './perf.js';
3
3
  import './iframe-tracking.js';
4
4
  export * from './types/abtest.js';
5
- export * from './types/acquisition.js';
6
5
  export * from './types/subscription.js';
7
6
  export * from './types/interaction.js';
8
7
  export * from './types/inpageclick.js';
@@ -15,7 +15,6 @@ export default supportExports;
15
15
  export declare const record: (event: EventPayload, callback?: () => void) => void;
16
16
  export declare const viewId: string;
17
17
  export * from './types/abtest.js';
18
- export * from './types/acquisition.js';
19
18
  export * from './types/subscription.js';
20
19
  export * from './types/interaction.js';
21
20
  export * from './types/inpageclick.js';
@@ -19,10 +19,19 @@ export interface AbTest {
19
19
  */
20
20
  campaignCodes?: Array<string>;
21
21
  }
22
- export interface AbTestInfo {
22
+ export interface AbTestRegisterEntry {
23
23
  /**
24
- * On the left-hand side of the map, .
25
- * On the right-hand side of the map, the variant that they are seeing.
24
+ * Variant assigned to the user for this test
26
25
  */
27
- tests: Array<AbTest>;
26
+ variantName: string;
27
+ /**
28
+ * Whether this test has completed for the user
29
+ */
30
+ complete: boolean;
31
+ /**
32
+ * Campaign codes associated with this variant
33
+ */
34
+ campaignCodes?: Array<string>;
28
35
  }
36
+ export type AbTestRegisterValue = AbTestRegisterEntry | string;
37
+ export type AbTestRegister = Record<string, AbTestRegisterValue>;
@@ -1,5 +1,4 @@
1
- import type { AbTestInfo } from './abtest.js';
2
- import type { Acquisition } from './acquisition.js';
1
+ import type { AbTestRegister } from './abtest.js';
3
2
  import type { ComponentEvent } from './component-event.js';
4
3
  import type { Consent } from './consent.js';
5
4
  import type { InPageClick } from './inpageclick.js';
@@ -91,12 +90,11 @@ export interface EventPayload extends Partial<Consent>, Partial<InPageClick> {
91
90
  performance?: WebPerformanceData;
92
91
  audio?: AudioEvent;
93
92
  video?: VideoEvent;
94
- ab?: AbTestInfo;
93
+ abTestRegister?: AbTestRegister;
95
94
  lazyComponents?: LazyComponents;
96
95
  interaction?: Interaction;
97
96
  inPrivateBrowsingMode?: boolean;
98
97
  adUnitWasHidden?: boolean;
99
- acquisition?: Acquisition;
100
98
  componentEvent?: ComponentEvent;
101
99
  /** Experience contains information about the rendering of the page, e.g.: dotcom-rendering */
102
100
  experiences?: Array<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guardian/ophan-tracker-js",
3
- "version": "2.6.2",
3
+ "version": "2.6.3",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=16"
@@ -1 +0,0 @@
1
- export {};
@@ -1,116 +0,0 @@
1
- import type { AbTestInfo } from './abtest.js';
2
- import type { PrintOptions } from './printproduct.js';
3
- import type { TComponentType } from './component-type.js';
4
- import type { TPlatform } from './platform.js';
5
- import type { Product } from './product.js';
6
- /**
7
- * A query string parameter
8
- */
9
- export type QueryParameter = {
10
- /**
11
- * The name of the query string parameter
12
- */
13
- name: string;
14
- /**
15
- * The value of the query string parameter
16
- */
17
- value: string;
18
- };
19
- export type TPaymentFrequency = 'ONE_OFF' | 'MONTHLY' | 'ANNUALLY' | 'QUARTERLY' | 'SIX_MONTHLY';
20
- export type TPaymentProvider = 'STRIPE' | 'PAYPAL' | 'GOCARDLESS' | 'IN_APP_PURCHASE' | 'STRIPE_APPLE_PAY' | 'STRIPE_PAYMENT_REQUEST_BUTTON' | 'SUBSCRIBE_WITH_GOOGLE' | 'AMAZON_PAY' | 'STRIPE_SEPA';
21
- export type TAcquisitionSource = 'GUARDIAN_WEB'
22
- /**
23
- * @deprecated DO NOT USE
24
- */
25
- | 'GUARDIAN_APPS' | 'EMAIL' | 'SOCIAL' | 'SEARCH' | 'PPC' | 'DIRECT' | 'GUARDIAN_APP_IOS' | 'GUARDIAN_APP_ANDROID' | 'APPLE_NEWS' | 'GOOGLE_AMP' | 'YOUTUBE';
26
- /**
27
- * Represents monetary contribution made by a reader via this page.
28
- */
29
- export interface Acquisition {
30
- /**
31
- * Product type
32
- */
33
- product: Product;
34
- /**
35
- * If the payment is a one off or reccuring
36
- */
37
- paymentFrequency: TPaymentFrequency;
38
- /**
39
- * Currency code (ISO 4217 3-character, upper-case, eg USD, GBP)
40
- */
41
- currency: string;
42
- /**
43
- * Contributed amount in units of the currency received
44
- */
45
- amount: number;
46
- /**
47
- * The payment provider the user paid with
48
- */
49
- paymentProvider?: TPaymentProvider;
50
- /**
51
- * The campaign code of the campaign that the user came from
52
- */
53
- campaignCode?: Array<string>;
54
- /**
55
- * The ab tests the user was in on dotcom
56
- */
57
- abTests?: AbTestInfo;
58
- /**
59
- * ISO-3166-aplha-2 country code representing where the user is from. It is either the country of the card used, or the country of the contributor's address
60
- */
61
- countryCode?: string;
62
- /**
63
- * Page view id of the page the reader was on that lead them through to the contribution page e.g. by clicking on the Contribute Now button in the Epic component
64
- */
65
- referrerPageViewId?: string;
66
- /**
67
- * Url of the page the reader was on that lead them through to the contribution page e.g. by clicking on the Contribute Now button in the Epic component
68
- */
69
- referrerUrl?: string;
70
- /**
71
- * An ID that can be used to distinguish different instances of a given component type
72
- */
73
- componentId?: string;
74
- /**
75
- * The type of component that the acquisition came from
76
- */
77
- componentTypeV2?: TComponentType;
78
- /**
79
- * The source of the acquisition
80
- */
81
- source?: TAcquisitionSource;
82
- /**
83
- * Extra parameters only applicable to print products
84
- */
85
- printOptions?: PrintOptions;
86
- /**
87
- * Platform on which the acquisition occurred e.g. Contributions, S&C
88
- */
89
- platform?: TPlatform;
90
- /**
91
- * Length of the discount in months
92
- */
93
- discountLengthInMonths?: number;
94
- /**
95
- * Amount of discount, as a percentage
96
- */
97
- discountPercentage?: number;
98
- /**
99
- * Promo code for the acquisition. Only applicable to subscriptions.
100
- */
101
- promoCode?: string;
102
- /**
103
- * Any additional labels.
104
- * In particular, extra information that is needed to calculate Annualised Value
105
- * for this Acquisition (e.g. promotions like Guardian Weekly Six For Six) can go here.
106
- */
107
- labels?: Array<string>;
108
- /**
109
- * The identity id of a user
110
- */
111
- identityId?: string;
112
- /**
113
- * Query string parameters associated with an acquisition
114
- */
115
- queryParameters?: Array<QueryParameter>;
116
- }