@guardian/ophan-tracker-js 2.1.0 → 2.1.1-next.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.
- package/dist/assets/adblock-detection.d.ts +5 -0
- package/dist/assets/adblock-detection.js +20 -0
- package/dist/assets/attention.d.ts +10 -0
- package/dist/assets/attention.js +126 -0
- package/dist/assets/campaign.d.ts +2 -0
- package/dist/assets/campaign.js +23 -0
- package/dist/assets/click-path-capture.d.ts +15 -0
- package/dist/assets/click-path-capture.js +68 -0
- package/dist/assets/components.d.ts +61 -0
- package/dist/assets/components.js +168 -0
- package/dist/assets/contribution.d.ts +6 -0
- package/{assets → dist/assets}/contribution.js +3 -12
- package/dist/assets/core.d.ts +65 -0
- package/dist/assets/core.js +230 -0
- package/dist/assets/embed.d.ts +6 -0
- package/{assets → dist/assets}/embed.js +2 -5
- package/dist/assets/fb-instant.d.ts +5 -0
- package/{assets → dist/assets}/fb-instant.js +1 -4
- package/dist/assets/heatmap.d.ts +6 -0
- package/dist/assets/heatmap.js +34 -0
- package/dist/assets/holidays.d.ts +6 -0
- package/{assets → dist/assets}/holidays.js +2 -5
- package/dist/assets/http-status.d.ts +6 -0
- package/{assets → dist/assets}/http-status.js +3 -5
- package/dist/assets/iframe-tracking.d.ts +2 -0
- package/dist/assets/iframe-tracking.js +80 -0
- package/dist/assets/interactive.d.ts +2 -0
- package/dist/assets/interactive.js +17 -0
- package/dist/assets/jobs-courses.d.ts +6 -0
- package/{assets → dist/assets}/jobs-courses.js +2 -5
- package/dist/assets/jobs.d.ts +6 -0
- package/{assets → dist/assets}/jobs.js +2 -5
- package/dist/assets/manage-my-account.d.ts +8 -0
- package/{assets → dist/assets}/manage-my-account.js +13 -22
- package/dist/assets/membership.d.ts +6 -0
- package/{assets → dist/assets}/membership.js +3 -12
- package/dist/assets/ng.d.ts +25 -0
- package/dist/assets/ng.js +53 -0
- package/dist/assets/perf.d.ts +3 -0
- package/dist/assets/perf.js +36 -0
- package/dist/assets/privatebrowsing.d.ts +7 -0
- package/dist/assets/privatebrowsing.js +66 -0
- package/dist/assets/r2.d.ts +5 -0
- package/{assets → dist/assets}/r2.js +2 -11
- package/dist/assets/smart-news.d.ts +6 -0
- package/{assets → dist/assets}/smart-news.js +3 -9
- package/dist/assets/support.d.ts +10 -0
- package/dist/assets/support.js +28 -0
- package/dist/assets/tests/click-path-capture.test.d.ts +2 -0
- package/dist/assets/tests/click-path-capture.test.js +44 -0
- package/dist/assets/tests/components.test.d.ts +2 -0
- package/dist/assets/tests/components.test.js +47 -0
- package/dist/assets/tests/core.test.d.ts +2 -0
- package/dist/assets/tests/core.test.js +161 -0
- package/dist/assets/tests/heatmap.test.d.ts +2 -0
- package/dist/assets/tests/heatmap.test.js +45 -0
- package/dist/assets/tests/transmit.test.d.ts +2 -0
- package/dist/assets/tests/transmit.test.js +118 -0
- package/dist/assets/transmit.d.ts +54 -0
- package/dist/assets/transmit.js +130 -0
- package/dist/assets/vendor/adBlockDetectionLib.d.ts +5 -0
- package/dist/assets/vendor/adBlockDetectionLib.js +312 -0
- package/dist/assets/visibility.d.ts +6 -0
- package/dist/assets/visibility.js +22 -0
- package/dist/assets/witness.d.ts +6 -0
- package/{assets → dist/assets}/witness.js +2 -5
- package/dist/types/abtest.d.ts +29 -0
- package/dist/types/abtest.js +0 -0
- package/dist/types/acquisition.d.ts +148 -0
- package/dist/types/acquisition.js +35 -0
- package/dist/types/component-event.d.ts +92 -0
- package/dist/types/component-event.js +67 -0
- package/dist/types/component-type.d.ts +58 -0
- package/dist/types/component-type.js +56 -0
- package/dist/types/consent.d.ts +47 -0
- package/dist/types/consent.js +15 -0
- package/dist/types/event.d.ts +115 -0
- package/dist/types/event.js +7 -0
- package/dist/types/inpageclick.d.ts +12 -0
- package/dist/types/inpageclick.js +0 -0
- package/dist/types/interaction.d.ts +18 -0
- package/dist/types/interaction.js +0 -0
- package/dist/types/link.d.ts +15 -0
- package/dist/types/link.js +0 -0
- package/dist/types/media.d.ts +103 -0
- package/dist/types/media.js +70 -0
- package/dist/types/platform.d.ts +33 -0
- package/dist/types/platform.js +33 -0
- package/dist/types/printproduct.d.ts +54 -0
- package/dist/types/printproduct.js +39 -0
- package/dist/types/product.d.ts +56 -0
- package/dist/types/product.js +54 -0
- package/dist/types/subscription.d.ts +65 -0
- package/dist/types/subscription.js +63 -0
- package/package.json +8 -5
- package/readme.md +98 -11
- package/assets/adblock-detection.js +0 -19
- package/assets/attention.js +0 -160
- package/assets/campaign.js +0 -25
- package/assets/click-path-capture.js +0 -80
- package/assets/components.js +0 -199
- package/assets/core.js +0 -282
- package/assets/heatmap.js +0 -53
- package/assets/iframe-tracking.js +0 -88
- package/assets/interactive.js +0 -17
- package/assets/ng.js +0 -41
- package/assets/perf.js +0 -40
- package/assets/privatebrowsing.js +0 -71
- package/assets/support.js +0 -34
- package/assets/transmit.js +0 -143
- package/assets/vendor/adBlockDetectionLib.js +0 -366
- package/assets/visibility.js +0 -23
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents the AbTest on the web and apps
|
|
3
|
+
*/
|
|
4
|
+
export interface AbTest {
|
|
5
|
+
/**
|
|
6
|
+
* the test that the user is participating in
|
|
7
|
+
*/
|
|
8
|
+
name: string;
|
|
9
|
+
/**
|
|
10
|
+
* the variant that they are seeing
|
|
11
|
+
*/
|
|
12
|
+
variant: string;
|
|
13
|
+
/**
|
|
14
|
+
* whether the test has been completed or not
|
|
15
|
+
*/
|
|
16
|
+
complete?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* the campaign codes associated with the variant
|
|
19
|
+
*/
|
|
20
|
+
campaignCodes?: Array<string>;
|
|
21
|
+
}
|
|
22
|
+
export interface AbTestInfo {
|
|
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.
|
|
26
|
+
*/
|
|
27
|
+
tests: Set<AbTest>;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=abtest.d.ts.map
|
|
File without changes
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import type { AbTestInfo } from "./abtest";
|
|
2
|
+
import type { PrintOptions } from "./printproduct";
|
|
3
|
+
import type { TComponentType } from "./component-type";
|
|
4
|
+
import type { TPlatform } from "./platform";
|
|
5
|
+
import type { TProduct } from "./product";
|
|
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 declare const PaymentFrequency: {
|
|
20
|
+
readonly ONE_OFF: "ONE_OFF";
|
|
21
|
+
readonly MONTHLY: "MONTHLY";
|
|
22
|
+
readonly ANNUALLY: "ANNUALLY";
|
|
23
|
+
readonly QUARTERLY: "QUARTERLY";
|
|
24
|
+
readonly SIX_MONTHLY: "SIX_MONTHLY";
|
|
25
|
+
};
|
|
26
|
+
export type TPaymentFrequency = typeof PaymentFrequency[keyof typeof PaymentFrequency];
|
|
27
|
+
export declare const PaymentProvider: {
|
|
28
|
+
readonly STRIPE: "STRIPE";
|
|
29
|
+
readonly PAYPAL: "PAYPAL";
|
|
30
|
+
readonly GOCARDLESS: "GOCARDLESS";
|
|
31
|
+
readonly IN_APP_PURCHASE: "IN_APP_PURCHASE";
|
|
32
|
+
readonly STRIPE_APPLE_PAY: "STRIPE_APPLE_PAY";
|
|
33
|
+
readonly STRIPE_PAYMENT_REQUEST_BUTTON: "STRIPE_PAYMENT_REQUEST_BUTTON";
|
|
34
|
+
readonly SUBSCRIBE_WITH_GOOGLE: "SUBSCRIBE_WITH_GOOGLE";
|
|
35
|
+
readonly AMAZON_PAY: "AMAZON_PAY";
|
|
36
|
+
readonly STRIPE_SEPA: "STRIPE_SEPA";
|
|
37
|
+
};
|
|
38
|
+
export type TPaymentProvider = typeof PaymentProvider[keyof typeof PaymentProvider];
|
|
39
|
+
export declare const AcquisitionSource: {
|
|
40
|
+
readonly GUARDIAN_WEB: "GUARDIAN_WEB";
|
|
41
|
+
/**
|
|
42
|
+
* @deprecated DO NOT USE
|
|
43
|
+
*/
|
|
44
|
+
readonly GUARDIAN_APPS: "GUARDIAN_APPS";
|
|
45
|
+
readonly EMAIL: "EMAIL";
|
|
46
|
+
readonly SOCIAL: "SOCIAL";
|
|
47
|
+
readonly SEARCH: "SEARCH";
|
|
48
|
+
readonly PPC: "PPC";
|
|
49
|
+
readonly DIRECT: "DIRECT";
|
|
50
|
+
readonly GUARDIAN_APP_IOS: "GUARDIAN_APP_IOS";
|
|
51
|
+
readonly GUARDIAN_APP_ANDROID: "GUARDIAN_APP_ANDROID";
|
|
52
|
+
readonly APPLE_NEWS: "APPLE_NEWS";
|
|
53
|
+
readonly GOOGLE_AMP: "GOOGLE_AMP";
|
|
54
|
+
readonly YOUTUBE: "YOUTUBE";
|
|
55
|
+
};
|
|
56
|
+
export type TAcquisitionSource = typeof AcquisitionSource[keyof typeof AcquisitionSource];
|
|
57
|
+
/**
|
|
58
|
+
* Represents monetary contribution made by a reader via this page.
|
|
59
|
+
*/
|
|
60
|
+
export interface Acquisition {
|
|
61
|
+
/**
|
|
62
|
+
* Product type
|
|
63
|
+
*/
|
|
64
|
+
product: TProduct;
|
|
65
|
+
/**
|
|
66
|
+
* If the payment is a one off or reccuring
|
|
67
|
+
*/
|
|
68
|
+
paymentFrequency: TPaymentFrequency;
|
|
69
|
+
/**
|
|
70
|
+
* Currency code (ISO 4217 3-character, upper-case, eg USD, GBP)
|
|
71
|
+
*/
|
|
72
|
+
currency: string;
|
|
73
|
+
/**
|
|
74
|
+
* Contributed amount in units of the currency received
|
|
75
|
+
*/
|
|
76
|
+
amount: number;
|
|
77
|
+
/**
|
|
78
|
+
* The payment provider the user paid with
|
|
79
|
+
*/
|
|
80
|
+
paymentProvider?: TPaymentProvider;
|
|
81
|
+
/**
|
|
82
|
+
* The campaign code of the campaign that the user came from
|
|
83
|
+
*/
|
|
84
|
+
campaignCode?: Set<string>;
|
|
85
|
+
/**
|
|
86
|
+
* The ab tests the user was in on dotcom
|
|
87
|
+
*/
|
|
88
|
+
abTests?: AbTestInfo;
|
|
89
|
+
/**
|
|
90
|
+
* 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
|
|
91
|
+
*/
|
|
92
|
+
countryCode?: string;
|
|
93
|
+
/**
|
|
94
|
+
* 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
|
|
95
|
+
*/
|
|
96
|
+
referrerPageViewId?: string;
|
|
97
|
+
/**
|
|
98
|
+
* 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
|
|
99
|
+
*/
|
|
100
|
+
referrerUrl?: string;
|
|
101
|
+
/**
|
|
102
|
+
* An ID that can be used to distinguish different instances of a given component type
|
|
103
|
+
*/
|
|
104
|
+
componentId?: string;
|
|
105
|
+
/**
|
|
106
|
+
* The type of component that the acquisition came from
|
|
107
|
+
*/
|
|
108
|
+
componentTypeV2?: TComponentType;
|
|
109
|
+
/**
|
|
110
|
+
* The source of the acquisition
|
|
111
|
+
*/
|
|
112
|
+
source?: TAcquisitionSource;
|
|
113
|
+
/**
|
|
114
|
+
* Extra parameters only applicable to print products
|
|
115
|
+
*/
|
|
116
|
+
printOptions?: PrintOptions;
|
|
117
|
+
/**
|
|
118
|
+
* Platform on which the acquisition occurred e.g. Contributions, S&C
|
|
119
|
+
*/
|
|
120
|
+
platform?: TPlatform;
|
|
121
|
+
/**
|
|
122
|
+
* Length of the discount in months
|
|
123
|
+
*/
|
|
124
|
+
discountLengthInMonths?: number;
|
|
125
|
+
/**
|
|
126
|
+
* Amount of discount, as a percentage
|
|
127
|
+
*/
|
|
128
|
+
discountPercentage?: number;
|
|
129
|
+
/**
|
|
130
|
+
* Promo code for the acquisition. Only applicable to subscriptions.
|
|
131
|
+
*/
|
|
132
|
+
promoCode?: string;
|
|
133
|
+
/**
|
|
134
|
+
* Any additional labels.
|
|
135
|
+
* In particular, extra information that is needed to calculate Annualised Value
|
|
136
|
+
* for this Acquisition (e.g. promotions like Guardian Weekly Six For Six) can go here.
|
|
137
|
+
*/
|
|
138
|
+
labels?: Set<string>;
|
|
139
|
+
/**
|
|
140
|
+
* The identity id of a user
|
|
141
|
+
*/
|
|
142
|
+
identityId?: string;
|
|
143
|
+
/**
|
|
144
|
+
* Query string parameters associated with an acquisition
|
|
145
|
+
*/
|
|
146
|
+
queryParameters?: Set<QueryParameter>;
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=acquisition.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export const PaymentFrequency = {
|
|
2
|
+
ONE_OFF: "ONE_OFF",
|
|
3
|
+
MONTHLY: "MONTHLY",
|
|
4
|
+
ANNUALLY: "ANNUALLY",
|
|
5
|
+
QUARTERLY: "QUARTERLY",
|
|
6
|
+
SIX_MONTHLY: "SIX_MONTHLY",
|
|
7
|
+
};
|
|
8
|
+
export const PaymentProvider = {
|
|
9
|
+
STRIPE: "STRIPE",
|
|
10
|
+
PAYPAL: "PAYPAL",
|
|
11
|
+
GOCARDLESS: "GOCARDLESS",
|
|
12
|
+
IN_APP_PURCHASE: "IN_APP_PURCHASE",
|
|
13
|
+
STRIPE_APPLE_PAY: "STRIPE_APPLE_PAY",
|
|
14
|
+
STRIPE_PAYMENT_REQUEST_BUTTON: "STRIPE_PAYMENT_REQUEST_BUTTON",
|
|
15
|
+
SUBSCRIBE_WITH_GOOGLE: "SUBSCRIBE_WITH_GOOGLE",
|
|
16
|
+
AMAZON_PAY: "AMAZON_PAY",
|
|
17
|
+
STRIPE_SEPA: "STRIPE_SEPA",
|
|
18
|
+
};
|
|
19
|
+
export const AcquisitionSource = {
|
|
20
|
+
GUARDIAN_WEB: "GUARDIAN_WEB",
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated DO NOT USE
|
|
23
|
+
*/
|
|
24
|
+
GUARDIAN_APPS: "GUARDIAN_APPS",
|
|
25
|
+
EMAIL: "EMAIL",
|
|
26
|
+
SOCIAL: "SOCIAL",
|
|
27
|
+
SEARCH: "SEARCH",
|
|
28
|
+
PPC: "PPC",
|
|
29
|
+
DIRECT: "DIRECT",
|
|
30
|
+
GUARDIAN_APP_IOS: "GUARDIAN_APP_IOS",
|
|
31
|
+
GUARDIAN_APP_ANDROID: "GUARDIAN_APP_ANDROID",
|
|
32
|
+
APPLE_NEWS: "APPLE_NEWS",
|
|
33
|
+
GOOGLE_AMP: "GOOGLE_AMP",
|
|
34
|
+
YOUTUBE: "YOUTUBE",
|
|
35
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { AbTest } from "./abtest";
|
|
2
|
+
import type { TProduct } from "./product";
|
|
3
|
+
import { TComponentType } from "./component-type";
|
|
4
|
+
export declare const Action: {
|
|
5
|
+
/**
|
|
6
|
+
* The component was inserted into its container (e.g. a web page or view in an app)
|
|
7
|
+
**/
|
|
8
|
+
readonly INSERT: "INSERT";
|
|
9
|
+
/**
|
|
10
|
+
* The component was in view on screen
|
|
11
|
+
**/
|
|
12
|
+
readonly VIEW: "VIEW";
|
|
13
|
+
/**
|
|
14
|
+
* The component was expanded (e.g. "see more").
|
|
15
|
+
* Not a navigation away to another page
|
|
16
|
+
**/
|
|
17
|
+
readonly EXPAND: "EXPAND";
|
|
18
|
+
/**
|
|
19
|
+
* A "like", thumbs up, etc.
|
|
20
|
+
**/
|
|
21
|
+
readonly LIKE: "LIKE";
|
|
22
|
+
/**
|
|
23
|
+
* A "dislike", thumbs down, etc.
|
|
24
|
+
**/
|
|
25
|
+
readonly DISLIKE: "DISLIKE";
|
|
26
|
+
/**
|
|
27
|
+
* A subscription to a service, newsletter, etc.
|
|
28
|
+
**/
|
|
29
|
+
readonly SUBSCRIBE: "SUBSCRIBE";
|
|
30
|
+
/**
|
|
31
|
+
* Selection of an answer in a quiz
|
|
32
|
+
**/
|
|
33
|
+
readonly ANSWER: "ANSWER";
|
|
34
|
+
/**
|
|
35
|
+
* A vote in a poll
|
|
36
|
+
**/
|
|
37
|
+
readonly VOTE: "VOTE";
|
|
38
|
+
/**
|
|
39
|
+
* A single click on the component which is not covered by
|
|
40
|
+
* any of the existing Actions.
|
|
41
|
+
**/
|
|
42
|
+
readonly CLICK: "CLICK";
|
|
43
|
+
/**
|
|
44
|
+
* User sign in to Guardian Identity account
|
|
45
|
+
**/
|
|
46
|
+
readonly SIGN_IN: "SIGN_IN";
|
|
47
|
+
/**
|
|
48
|
+
* User creates a Guardian Identity account
|
|
49
|
+
**/
|
|
50
|
+
readonly CREATE_ACCOUNT: "CREATE_ACCOUNT";
|
|
51
|
+
/**
|
|
52
|
+
* User Consent
|
|
53
|
+
**/
|
|
54
|
+
readonly ACCEPT_DEFAULT_CONSENT: "ACCEPT_DEFAULT_CONSENT";
|
|
55
|
+
readonly MANAGE_CONSENT: "MANAGE_CONSENT";
|
|
56
|
+
readonly CONSENT_ACCEPT_ALL: "CONSENT_ACCEPT_ALL";
|
|
57
|
+
readonly CONSENT_REJECT_ALL: "CONSENT_REJECT_ALL";
|
|
58
|
+
/**
|
|
59
|
+
* the component sticks in the screen
|
|
60
|
+
**/
|
|
61
|
+
readonly STICK: "STICK";
|
|
62
|
+
/**
|
|
63
|
+
* the component is closed
|
|
64
|
+
**/
|
|
65
|
+
readonly CLOSE: "CLOSE";
|
|
66
|
+
/**
|
|
67
|
+
* the component is returned to its original location
|
|
68
|
+
**/
|
|
69
|
+
readonly RETURN: "RETURN";
|
|
70
|
+
};
|
|
71
|
+
type TAction = typeof Action[keyof typeof Action];
|
|
72
|
+
export interface Component {
|
|
73
|
+
name: string;
|
|
74
|
+
loadTimeMs?: number;
|
|
75
|
+
}
|
|
76
|
+
interface ComponentV2 {
|
|
77
|
+
componentType: TComponentType;
|
|
78
|
+
id?: string;
|
|
79
|
+
products: Set<TProduct>;
|
|
80
|
+
campaignCode?: string;
|
|
81
|
+
labels: Set<string>;
|
|
82
|
+
}
|
|
83
|
+
export interface ComponentEvent {
|
|
84
|
+
component: ComponentV2;
|
|
85
|
+
action: TAction;
|
|
86
|
+
value?: string;
|
|
87
|
+
id?: string;
|
|
88
|
+
abTest?: AbTest;
|
|
89
|
+
targetingAbTest?: AbTest;
|
|
90
|
+
}
|
|
91
|
+
export {};
|
|
92
|
+
//# sourceMappingURL=component-event.d.ts.map
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export const Action = {
|
|
2
|
+
/**
|
|
3
|
+
* The component was inserted into its container (e.g. a web page or view in an app)
|
|
4
|
+
**/
|
|
5
|
+
INSERT: "INSERT",
|
|
6
|
+
/**
|
|
7
|
+
* The component was in view on screen
|
|
8
|
+
**/
|
|
9
|
+
VIEW: "VIEW",
|
|
10
|
+
/**
|
|
11
|
+
* The component was expanded (e.g. "see more").
|
|
12
|
+
* Not a navigation away to another page
|
|
13
|
+
**/
|
|
14
|
+
EXPAND: "EXPAND",
|
|
15
|
+
/**
|
|
16
|
+
* A "like", thumbs up, etc.
|
|
17
|
+
**/
|
|
18
|
+
LIKE: "LIKE",
|
|
19
|
+
/**
|
|
20
|
+
* A "dislike", thumbs down, etc.
|
|
21
|
+
**/
|
|
22
|
+
DISLIKE: "DISLIKE",
|
|
23
|
+
/**
|
|
24
|
+
* A subscription to a service, newsletter, etc.
|
|
25
|
+
**/
|
|
26
|
+
SUBSCRIBE: "SUBSCRIBE",
|
|
27
|
+
/**
|
|
28
|
+
* Selection of an answer in a quiz
|
|
29
|
+
**/
|
|
30
|
+
ANSWER: "ANSWER",
|
|
31
|
+
/**
|
|
32
|
+
* A vote in a poll
|
|
33
|
+
**/
|
|
34
|
+
VOTE: "VOTE",
|
|
35
|
+
/**
|
|
36
|
+
* A single click on the component which is not covered by
|
|
37
|
+
* any of the existing Actions.
|
|
38
|
+
**/
|
|
39
|
+
CLICK: "CLICK",
|
|
40
|
+
/**
|
|
41
|
+
* User sign in to Guardian Identity account
|
|
42
|
+
**/
|
|
43
|
+
SIGN_IN: "SIGN_IN",
|
|
44
|
+
/**
|
|
45
|
+
* User creates a Guardian Identity account
|
|
46
|
+
**/
|
|
47
|
+
CREATE_ACCOUNT: "CREATE_ACCOUNT",
|
|
48
|
+
/**
|
|
49
|
+
* User Consent
|
|
50
|
+
**/
|
|
51
|
+
ACCEPT_DEFAULT_CONSENT: "ACCEPT_DEFAULT_CONSENT",
|
|
52
|
+
MANAGE_CONSENT: "MANAGE_CONSENT",
|
|
53
|
+
CONSENT_ACCEPT_ALL: "CONSENT_ACCEPT_ALL",
|
|
54
|
+
CONSENT_REJECT_ALL: "CONSENT_REJECT_ALL",
|
|
55
|
+
/**
|
|
56
|
+
* the component sticks in the screen
|
|
57
|
+
**/
|
|
58
|
+
STICK: "STICK",
|
|
59
|
+
/**
|
|
60
|
+
* the component is closed
|
|
61
|
+
**/
|
|
62
|
+
CLOSE: "CLOSE",
|
|
63
|
+
/**
|
|
64
|
+
* the component is returned to its original location
|
|
65
|
+
**/
|
|
66
|
+
RETURN: "RETURN",
|
|
67
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export declare const ComponentType: {
|
|
2
|
+
readonly READERS_QUESTIONS_ATOM: "READERS_QUESTIONS_ATOM";
|
|
3
|
+
readonly QANDA_ATOM: "QANDA_ATOM";
|
|
4
|
+
readonly PROFILE_ATOM: "PROFILE_ATOM";
|
|
5
|
+
readonly GUIDE_ATOM: "GUIDE_ATOM";
|
|
6
|
+
readonly TIMELINE_ATOM: "TIMELINE_ATOM";
|
|
7
|
+
readonly NEWSLETTER_SUBSCRIPTION: "NEWSLETTER_SUBSCRIPTION";
|
|
8
|
+
readonly SURVEYS_QUESTIONS: "SURVEYS_QUESTIONS";
|
|
9
|
+
readonly ACQUISITIONS_EPIC: "ACQUISITIONS_EPIC";
|
|
10
|
+
readonly ACQUISITIONS_ENGAGEMENT_BANNER: "ACQUISITIONS_ENGAGEMENT_BANNER";
|
|
11
|
+
readonly ACQUISITIONS_THANK_YOU_EPIC: "ACQUISITIONS_THANK_YOU_EPIC";
|
|
12
|
+
readonly ACQUISITIONS_HEADER: "ACQUISITIONS_HEADER";
|
|
13
|
+
readonly ACQUISITIONS_FOOTER: "ACQUISITIONS_FOOTER";
|
|
14
|
+
readonly ACQUISITIONS_INTERACTIVE_SLICE: "ACQUISITIONS_INTERACTIVE_SLICE";
|
|
15
|
+
readonly ACQUISITIONS_NUGGET: "ACQUISITIONS_NUGGET";
|
|
16
|
+
readonly ACQUISITIONS_STANDFIRST: "ACQUISITIONS_STANDFIRST";
|
|
17
|
+
readonly ACQUISITIONS_THRASHER: "ACQUISITIONS_THRASHER";
|
|
18
|
+
readonly ACQUISITIONS_EDITORIAL_LINK: "ACQUISITIONS_EDITORIAL_LINK";
|
|
19
|
+
readonly ACQUISITIONS_MANAGE_MY_ACCOUNT: "ACQUISITIONS_MANAGE_MY_ACCOUNT";
|
|
20
|
+
readonly ACQUISITIONS_BUTTON: "ACQUISITIONS_BUTTON";
|
|
21
|
+
readonly ACQUISITIONS_OTHER: "ACQUISITIONS_OTHER";
|
|
22
|
+
readonly APP_ADVERT: "APP_ADVERT";
|
|
23
|
+
readonly APP_AUDIO: "APP_AUDIO";
|
|
24
|
+
readonly APP_BUTTON: "APP_BUTTON";
|
|
25
|
+
readonly APP_CARD: "APP_CARD";
|
|
26
|
+
readonly APP_CROSSWORDS: "APP_CROSSWORDS";
|
|
27
|
+
readonly APP_ENGAGEMENT_BANNER: "APP_ENGAGEMENT_BANNER";
|
|
28
|
+
readonly APP_EPIC: "APP_EPIC";
|
|
29
|
+
readonly APP_GALLERY: "APP_GALLERY";
|
|
30
|
+
readonly APP_LINK: "APP_LINK";
|
|
31
|
+
readonly APP_NAVIGATION_ITEM: "APP_NAVIGATION_ITEM";
|
|
32
|
+
readonly APP_SCREEN: "APP_SCREEN";
|
|
33
|
+
readonly APP_THRASHER: "APP_THRASHER";
|
|
34
|
+
readonly APP_VIDEO: "APP_VIDEO";
|
|
35
|
+
readonly AUDIO_ATOM: "AUDIO_ATOM";
|
|
36
|
+
readonly CHART_ATOM: "CHART_ATOM";
|
|
37
|
+
readonly ACQUISITIONS_MERCHANDISING: "ACQUISITIONS_MERCHANDISING";
|
|
38
|
+
readonly ACQUISITIONS_HOUSE_ADS: "ACQUISITIONS_HOUSE_ADS";
|
|
39
|
+
readonly SIGN_IN_GATE: "SIGN_IN_GATE";
|
|
40
|
+
readonly ACQUISITIONS_SUBSCRIPTIONS_BANNER: "ACQUISITIONS_SUBSCRIPTIONS_BANNER";
|
|
41
|
+
readonly MOBILE_STICKY_AD: "MOBILE_STICKY_AD";
|
|
42
|
+
readonly IDENTITY_AUTHENTICATION: "IDENTITY_AUTHENTICATION";
|
|
43
|
+
readonly RETENTION_ENGAGEMENT_BANNER: "RETENTION_ENGAGEMENT_BANNER";
|
|
44
|
+
readonly ACQUISITION_SUPPORT_SITE: "ACQUISITION_SUPPORT_SITE";
|
|
45
|
+
readonly RETENTION_EPIC: "RETENTION_EPIC";
|
|
46
|
+
readonly CONSENT: "CONSENT";
|
|
47
|
+
readonly LIVE_BLOG_PINNED_POST: "LIVE_BLOG_PINNED_POST";
|
|
48
|
+
readonly STICKY_VIDEO: "STICKY_VIDEO";
|
|
49
|
+
readonly KEY_EVENT_CARD: "KEY_EVENT_CARD";
|
|
50
|
+
readonly RETENTION_HEADER: "RETENTION_HEADER";
|
|
51
|
+
readonly SLIDESHOW: "SLIDESHOW";
|
|
52
|
+
readonly APP_FEATURE: "APP_FEATURE";
|
|
53
|
+
readonly CARD: "CARD";
|
|
54
|
+
readonly CAROUSEL: "CAROUSEL";
|
|
55
|
+
readonly CONTAINER: "CONTAINER";
|
|
56
|
+
};
|
|
57
|
+
export type TComponentType = typeof ComponentType[keyof typeof ComponentType];
|
|
58
|
+
//# sourceMappingURL=component-type.d.ts.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export const ComponentType = {
|
|
2
|
+
READERS_QUESTIONS_ATOM: "READERS_QUESTIONS_ATOM",
|
|
3
|
+
QANDA_ATOM: "QANDA_ATOM",
|
|
4
|
+
PROFILE_ATOM: "PROFILE_ATOM",
|
|
5
|
+
GUIDE_ATOM: "GUIDE_ATOM",
|
|
6
|
+
TIMELINE_ATOM: "TIMELINE_ATOM",
|
|
7
|
+
NEWSLETTER_SUBSCRIPTION: "NEWSLETTER_SUBSCRIPTION",
|
|
8
|
+
SURVEYS_QUESTIONS: "SURVEYS_QUESTIONS",
|
|
9
|
+
ACQUISITIONS_EPIC: "ACQUISITIONS_EPIC",
|
|
10
|
+
ACQUISITIONS_ENGAGEMENT_BANNER: "ACQUISITIONS_ENGAGEMENT_BANNER",
|
|
11
|
+
ACQUISITIONS_THANK_YOU_EPIC: "ACQUISITIONS_THANK_YOU_EPIC",
|
|
12
|
+
ACQUISITIONS_HEADER: "ACQUISITIONS_HEADER",
|
|
13
|
+
ACQUISITIONS_FOOTER: "ACQUISITIONS_FOOTER",
|
|
14
|
+
ACQUISITIONS_INTERACTIVE_SLICE: "ACQUISITIONS_INTERACTIVE_SLICE",
|
|
15
|
+
ACQUISITIONS_NUGGET: "ACQUISITIONS_NUGGET",
|
|
16
|
+
ACQUISITIONS_STANDFIRST: "ACQUISITIONS_STANDFIRST",
|
|
17
|
+
ACQUISITIONS_THRASHER: "ACQUISITIONS_THRASHER",
|
|
18
|
+
ACQUISITIONS_EDITORIAL_LINK: "ACQUISITIONS_EDITORIAL_LINK",
|
|
19
|
+
ACQUISITIONS_MANAGE_MY_ACCOUNT: "ACQUISITIONS_MANAGE_MY_ACCOUNT",
|
|
20
|
+
ACQUISITIONS_BUTTON: "ACQUISITIONS_BUTTON",
|
|
21
|
+
ACQUISITIONS_OTHER: "ACQUISITIONS_OTHER",
|
|
22
|
+
APP_ADVERT: "APP_ADVERT",
|
|
23
|
+
APP_AUDIO: "APP_AUDIO",
|
|
24
|
+
APP_BUTTON: "APP_BUTTON",
|
|
25
|
+
APP_CARD: "APP_CARD",
|
|
26
|
+
APP_CROSSWORDS: "APP_CROSSWORDS",
|
|
27
|
+
APP_ENGAGEMENT_BANNER: "APP_ENGAGEMENT_BANNER",
|
|
28
|
+
APP_EPIC: "APP_EPIC",
|
|
29
|
+
APP_GALLERY: "APP_GALLERY",
|
|
30
|
+
APP_LINK: "APP_LINK",
|
|
31
|
+
APP_NAVIGATION_ITEM: "APP_NAVIGATION_ITEM",
|
|
32
|
+
APP_SCREEN: "APP_SCREEN",
|
|
33
|
+
APP_THRASHER: "APP_THRASHER",
|
|
34
|
+
APP_VIDEO: "APP_VIDEO",
|
|
35
|
+
AUDIO_ATOM: "AUDIO_ATOM",
|
|
36
|
+
CHART_ATOM: "CHART_ATOM",
|
|
37
|
+
ACQUISITIONS_MERCHANDISING: "ACQUISITIONS_MERCHANDISING",
|
|
38
|
+
ACQUISITIONS_HOUSE_ADS: "ACQUISITIONS_HOUSE_ADS",
|
|
39
|
+
SIGN_IN_GATE: "SIGN_IN_GATE",
|
|
40
|
+
ACQUISITIONS_SUBSCRIPTIONS_BANNER: "ACQUISITIONS_SUBSCRIPTIONS_BANNER",
|
|
41
|
+
MOBILE_STICKY_AD: "MOBILE_STICKY_AD",
|
|
42
|
+
IDENTITY_AUTHENTICATION: "IDENTITY_AUTHENTICATION",
|
|
43
|
+
RETENTION_ENGAGEMENT_BANNER: "RETENTION_ENGAGEMENT_BANNER",
|
|
44
|
+
ACQUISITION_SUPPORT_SITE: "ACQUISITION_SUPPORT_SITE",
|
|
45
|
+
RETENTION_EPIC: "RETENTION_EPIC",
|
|
46
|
+
CONSENT: "CONSENT",
|
|
47
|
+
LIVE_BLOG_PINNED_POST: "LIVE_BLOG_PINNED_POST",
|
|
48
|
+
STICKY_VIDEO: "STICKY_VIDEO",
|
|
49
|
+
KEY_EVENT_CARD: "KEY_EVENT_CARD",
|
|
50
|
+
RETENTION_HEADER: "RETENTION_HEADER",
|
|
51
|
+
SLIDESHOW: "SLIDESHOW",
|
|
52
|
+
APP_FEATURE: "APP_FEATURE",
|
|
53
|
+
CARD: "CARD",
|
|
54
|
+
CAROUSEL: "CAROUSEL",
|
|
55
|
+
CONTAINER: "CONTAINER",
|
|
56
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/** A user’s recorded tracking consent. Because the consent data can come in
|
|
2
|
+
* different formats from different sources, the jurisdiction field determines
|
|
3
|
+
* the format of consentData.
|
|
4
|
+
**/
|
|
5
|
+
export interface Consent {
|
|
6
|
+
/**
|
|
7
|
+
* The jurisdiction is a tag for the consent data: TCF, CCPA, or AUS if the
|
|
8
|
+
* consent has been successfully parsed in one of those formats; or
|
|
9
|
+
* OTHER otherwise.
|
|
10
|
+
**/
|
|
11
|
+
consentJurisdiction: TJurisdiction;
|
|
12
|
+
/**
|
|
13
|
+
* If the jurisdiction is TCF, CCPA, or AUS, consentData contains a
|
|
14
|
+
* successfully interpreted consent value the corresponding type (for TCF
|
|
15
|
+
* this is a base-64-encoded consent string, and for CCPA and AUS it’s
|
|
16
|
+
* either the string "true" or "false" – where "true" means the user has
|
|
17
|
+
* given their consent). If the jurisdiction is OTHER, then consentData
|
|
18
|
+
* contains the unparsed consent data, in the format
|
|
19
|
+
* key1:value1,key2:value2,….
|
|
20
|
+
**/
|
|
21
|
+
consentData: string;
|
|
22
|
+
/**
|
|
23
|
+
* consentUUID is an identifier for the consent, for debugging.
|
|
24
|
+
**/
|
|
25
|
+
consentUUID?: string;
|
|
26
|
+
/**
|
|
27
|
+
* cmp version for debugging
|
|
28
|
+
**/
|
|
29
|
+
cmpVersion?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* For a recognised/successfully parsed consent, a value of TCF, CCPA, or AUS
|
|
33
|
+
* indicates which jurisdiction the consent is for. OTHER marks a consent
|
|
34
|
+
* that was not successfully parsed into one of these formats.
|
|
35
|
+
*
|
|
36
|
+
* - TCF is Europe’s [Transparency & Consent Framework](https://iabeurope.eu/transparency-consent-framework/).
|
|
37
|
+
* - CCPA is the [California Consumer Privacy Act](https://oag.ca.gov/privacy/ccpa).
|
|
38
|
+
* - AUS is for Australian consents, using a version of the CCPA.
|
|
39
|
+
**/
|
|
40
|
+
export declare const Jurisdiction: {
|
|
41
|
+
TCF: string;
|
|
42
|
+
CCPA: string;
|
|
43
|
+
AUS: string;
|
|
44
|
+
OTHER: string;
|
|
45
|
+
};
|
|
46
|
+
export type TJurisdiction = typeof Jurisdiction[keyof typeof Jurisdiction];
|
|
47
|
+
//# sourceMappingURL=consent.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* For a recognised/successfully parsed consent, a value of TCF, CCPA, or AUS
|
|
3
|
+
* indicates which jurisdiction the consent is for. OTHER marks a consent
|
|
4
|
+
* that was not successfully parsed into one of these formats.
|
|
5
|
+
*
|
|
6
|
+
* - TCF is Europe’s [Transparency & Consent Framework](https://iabeurope.eu/transparency-consent-framework/).
|
|
7
|
+
* - CCPA is the [California Consumer Privacy Act](https://oag.ca.gov/privacy/ccpa).
|
|
8
|
+
* - AUS is for Australian consents, using a version of the CCPA.
|
|
9
|
+
**/
|
|
10
|
+
export const Jurisdiction = {
|
|
11
|
+
TCF: "TCF",
|
|
12
|
+
CCPA: "CCPA",
|
|
13
|
+
AUS: "AUS",
|
|
14
|
+
OTHER: "OTHER",
|
|
15
|
+
};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { Consent } from "./consent";
|
|
2
|
+
import type { ComponentEvent } from "./component-event";
|
|
3
|
+
import type { InPageClick } from "./inpageclick";
|
|
4
|
+
import type { AbTestInfo } from "./abtest";
|
|
5
|
+
import type { AudioEvent, VideoEvent } from "./media";
|
|
6
|
+
import type { TMembershipTier, TSubscriptionType } from "./subscription";
|
|
7
|
+
import type { TPlatform } from "./platform";
|
|
8
|
+
import type { Acquisition } from "./acquisition";
|
|
9
|
+
import { Interaction } from "./interaction";
|
|
10
|
+
/**
|
|
11
|
+
* Details about a page view - only populated for _PAGE_VIEW
|
|
12
|
+
* event types
|
|
13
|
+
**/
|
|
14
|
+
interface PageView {
|
|
15
|
+
/** Url of the page served */
|
|
16
|
+
url: string;
|
|
17
|
+
/** The platform that served this page */
|
|
18
|
+
platform?: TPlatform;
|
|
19
|
+
/** Some approximation of the content type */
|
|
20
|
+
contentType?: string;
|
|
21
|
+
/** URL of the referrer to this page view */
|
|
22
|
+
ref?: string;
|
|
23
|
+
/** The number of days in the previous week that the device has had a page view */
|
|
24
|
+
daysVisitedInLastWeek?: number;
|
|
25
|
+
/** Total number of days on which this browser has visited the guardian */
|
|
26
|
+
totalDaysVisited?: number;
|
|
27
|
+
/** Calculated average days between recent visits */
|
|
28
|
+
averageDaysBetweenRecentVisits?: number;
|
|
29
|
+
/** Is this browser a regular visitor to the Guardian */
|
|
30
|
+
regular?: boolean;
|
|
31
|
+
subscriptionType?: TSubscriptionType;
|
|
32
|
+
membershipTier?: TMembershipTier;
|
|
33
|
+
navigationType?: PerformanceNavigationTiming["type"];
|
|
34
|
+
from?: string;
|
|
35
|
+
to?: string;
|
|
36
|
+
tz?: string;
|
|
37
|
+
visibilityState?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface AttentionTime {
|
|
40
|
+
/** Attention time spent on this page view in milliseconds */
|
|
41
|
+
attentionMs: number;
|
|
42
|
+
/** Map of component name to time in ms */
|
|
43
|
+
componentAttention?: {
|
|
44
|
+
[key: string]: number;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
interface AssetPerformanceData {
|
|
48
|
+
/** The name of the metric being captured */
|
|
49
|
+
name: string;
|
|
50
|
+
/** Value of window.performance.now at which metric was captured */
|
|
51
|
+
timing: number;
|
|
52
|
+
}
|
|
53
|
+
interface WebPerformanceData {
|
|
54
|
+
/** Time in ms that dns lookup took */
|
|
55
|
+
dns: number;
|
|
56
|
+
/** Time in ms that connection to the server took */
|
|
57
|
+
connection: number;
|
|
58
|
+
/** Time to first byte */
|
|
59
|
+
firstByte: number;
|
|
60
|
+
/** First byte to last byte */
|
|
61
|
+
lastByte: number;
|
|
62
|
+
/** From last byte of doc to start of domContentLoaded */
|
|
63
|
+
domContentLoadedEvent: number;
|
|
64
|
+
/** domContentLoaded to start of load event */
|
|
65
|
+
loadEvent: number;
|
|
66
|
+
/** The navigation type */
|
|
67
|
+
navType: number;
|
|
68
|
+
/** Number of redirects on current domain */
|
|
69
|
+
redirectCount: number;
|
|
70
|
+
/** List of custom Asset performance data */
|
|
71
|
+
assetsPerformance?: AssetPerformanceData[];
|
|
72
|
+
}
|
|
73
|
+
interface Component {
|
|
74
|
+
/** The name of this component */
|
|
75
|
+
name: string;
|
|
76
|
+
/** How long, in milliseconds, that the component took to load */
|
|
77
|
+
loadTimeMs?: number;
|
|
78
|
+
}
|
|
79
|
+
interface LazyComponents {
|
|
80
|
+
/** The set of components that were loaded lazily on this page */
|
|
81
|
+
components: Component[];
|
|
82
|
+
}
|
|
83
|
+
export declare const Edition: {
|
|
84
|
+
readonly UK: "UK";
|
|
85
|
+
readonly US: "US";
|
|
86
|
+
readonly AU: "AU";
|
|
87
|
+
readonly International: "International";
|
|
88
|
+
readonly Europe: "Europe";
|
|
89
|
+
};
|
|
90
|
+
export type TEdition = typeof Edition[keyof typeof Edition];
|
|
91
|
+
export interface EventPayload {
|
|
92
|
+
/** If the user is logged in, the identity user id */
|
|
93
|
+
userId?: string;
|
|
94
|
+
pageView?: PageView;
|
|
95
|
+
attention?: AttentionTime;
|
|
96
|
+
performance?: WebPerformanceData;
|
|
97
|
+
audio?: AudioEvent;
|
|
98
|
+
video?: VideoEvent;
|
|
99
|
+
ab?: AbTestInfo;
|
|
100
|
+
lazyComponents?: LazyComponents;
|
|
101
|
+
inPageClick?: InPageClick;
|
|
102
|
+
interaction?: Interaction;
|
|
103
|
+
inPrivateBrowsingMode?: boolean;
|
|
104
|
+
adUnitWasHidden?: boolean;
|
|
105
|
+
acquisition?: Acquisition;
|
|
106
|
+
componentEvent?: ComponentEvent;
|
|
107
|
+
/** Experience contains information about the rendering of the page, e.g.: dotcom-rendering */
|
|
108
|
+
experiences?: Set<string>;
|
|
109
|
+
edition?: TEdition;
|
|
110
|
+
/** The set of component names that were rendered on this page, e.g.: ["nav3","nav2","sub-nav","footer"] */
|
|
111
|
+
renderedComponents?: Set<string>;
|
|
112
|
+
consent?: Consent;
|
|
113
|
+
}
|
|
114
|
+
export {};
|
|
115
|
+
//# sourceMappingURL=event.d.ts.map
|