@guardian/ophan-tracker-js 2.1.2-next.2 → 2.1.2-next.4
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/NPM-dist/attention.js +1 -1
- package/NPM-dist/campaign.js +1 -1
- package/NPM-dist/click-path-capture.js +1 -1
- package/NPM-dist/contribution.js +1 -1
- package/NPM-dist/core.js +1 -1
- package/NPM-dist/embed.js +1 -1
- package/NPM-dist/fb-instant.js +1 -1
- package/NPM-dist/holidays.js +1 -1
- package/NPM-dist/interactive.js +1 -1
- package/NPM-dist/jobs-courses.js +1 -1
- package/NPM-dist/jobs.js +1 -1
- package/NPM-dist/manage-my-account.js +1 -1
- package/NPM-dist/membership.js +1 -1
- package/NPM-dist/ng.js +22 -22
- package/NPM-dist/privatebrowsing.js +1 -1
- package/NPM-dist/r2.js +1 -1
- package/NPM-dist/smart-news.js +1 -1
- package/NPM-dist/support.js +1 -1
- package/NPM-dist/transmit.js +6 -1
- package/NPM-dist/types/ng.d.ts +17 -17
- package/NPM-dist/types/transmit.d.ts +1 -1
- package/NPM-dist/types/types/acquisition.d.ts +9 -9
- package/NPM-dist/types/types/component-event.d.ts +18 -18
- package/NPM-dist/types/types/event.d.ts +11 -11
- package/NPM-dist/types/types/inpageclick.d.ts +1 -1
- package/NPM-dist/witness.js +1 -1
- package/package.json +1 -1
package/NPM-dist/attention.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Generated by CoffeeScript 2.7.0
|
|
2
|
-
import transmit from './transmit';
|
|
2
|
+
import transmit from './transmit.js';
|
|
3
3
|
import components from './components.js';
|
|
4
4
|
// The upworthy definition of attention minutes, from
|
|
5
5
|
// http://upworthy.github.io/2014/06/implementing-attention-minutes-part-1/ :
|
package/NPM-dist/campaign.js
CHANGED
package/NPM-dist/contribution.js
CHANGED
package/NPM-dist/core.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
let init, sendInitialEvent, storeDataToSendOnNextEvent, hasProp = {}.hasOwnProperty;
|
|
2
|
-
import transmit from './transmit';
|
|
2
|
+
import transmit from './transmit.js';
|
|
3
3
|
import visibility from './visibility.js';
|
|
4
4
|
import adblockDetection from './adblock-detection.js';
|
|
5
5
|
const VERSION = 17;
|
package/NPM-dist/embed.js
CHANGED
package/NPM-dist/fb-instant.js
CHANGED
package/NPM-dist/holidays.js
CHANGED
package/NPM-dist/interactive.js
CHANGED
package/NPM-dist/jobs-courses.js
CHANGED
package/NPM-dist/jobs.js
CHANGED
package/NPM-dist/membership.js
CHANGED
package/NPM-dist/ng.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import core from './core';
|
|
2
|
-
import transmit from './transmit';
|
|
3
|
-
import attention from './attention';
|
|
4
|
-
import visibility from './visibility';
|
|
5
|
-
import privatebrowsing from './privatebrowsing';
|
|
6
|
-
import heatmap from './heatmap';
|
|
7
|
-
import './click-path-capture';
|
|
8
|
-
import './perf';
|
|
9
|
-
import './iframe-tracking';
|
|
10
|
-
export * from './types/abtest';
|
|
11
|
-
export * from './types/acquisition';
|
|
12
|
-
export * from './types/subscription';
|
|
13
|
-
export * from './types/interaction';
|
|
14
|
-
export * from './types/inpageclick';
|
|
15
|
-
export * from './types/printproduct';
|
|
16
|
-
export * from './types/product';
|
|
17
|
-
export * from './types/platform';
|
|
18
|
-
export * from './types/media';
|
|
19
|
-
export * from './types/consent';
|
|
20
|
-
export * from './types/component-type';
|
|
21
|
-
export * from './types/component-event';
|
|
22
|
-
export * from './types/event';
|
|
2
|
+
import transmit from './transmit.js';
|
|
3
|
+
import attention from './attention.js';
|
|
4
|
+
import visibility from './visibility.js';
|
|
5
|
+
import privatebrowsing from './privatebrowsing.js';
|
|
6
|
+
import heatmap from './heatmap.js';
|
|
7
|
+
import './click-path-capture.js';
|
|
8
|
+
import './perf.js';
|
|
9
|
+
import './iframe-tracking.js';
|
|
10
|
+
export * from './types/abtest.js';
|
|
11
|
+
export * from './types/acquisition.js';
|
|
12
|
+
export * from './types/subscription.js';
|
|
13
|
+
export * from './types/interaction.js';
|
|
14
|
+
export * from './types/inpageclick.js';
|
|
15
|
+
export * from './types/printproduct.js';
|
|
16
|
+
export * from './types/product.js';
|
|
17
|
+
export * from './types/platform.js';
|
|
18
|
+
export * from './types/media.js';
|
|
19
|
+
export * from './types/consent.js';
|
|
20
|
+
export * from './types/component-type.js';
|
|
21
|
+
export * from './types/component-event.js';
|
|
22
|
+
export * from './types/event.js';
|
|
23
23
|
let ng;
|
|
24
24
|
if (window.guardian && window.guardian.ophan) {
|
|
25
25
|
ng = window.guardian.ophan;
|
|
@@ -39,7 +39,7 @@ else {
|
|
|
39
39
|
trackComponentAttention: attention.initComponent,
|
|
40
40
|
record: transmit.sendMore,
|
|
41
41
|
viewId: transmit.viewId,
|
|
42
|
-
pageViewId: transmit.viewId
|
|
42
|
+
pageViewId: transmit.viewId,
|
|
43
43
|
};
|
|
44
44
|
ng = window.guardian.ophan;
|
|
45
45
|
}
|
package/NPM-dist/r2.js
CHANGED
package/NPM-dist/smart-news.js
CHANGED
package/NPM-dist/support.js
CHANGED
package/NPM-dist/transmit.js
CHANGED
|
@@ -94,7 +94,12 @@ const buildQueryString = (obj) => {
|
|
|
94
94
|
*/
|
|
95
95
|
const send = (url, f) => {
|
|
96
96
|
if (typeof fetch === 'function') {
|
|
97
|
-
fetch(url, {
|
|
97
|
+
fetch(url, {
|
|
98
|
+
method: 'GET',
|
|
99
|
+
mode: 'no-cors',
|
|
100
|
+
keepalive: true,
|
|
101
|
+
credentials: 'include',
|
|
102
|
+
}).then(() => f?.());
|
|
98
103
|
}
|
|
99
104
|
else {
|
|
100
105
|
const image = new Image();
|
package/NPM-dist/types/ng.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import './click-path-capture';
|
|
2
|
-
import './perf';
|
|
3
|
-
import './iframe-tracking';
|
|
4
|
-
export * from './types/abtest';
|
|
5
|
-
export * from './types/acquisition';
|
|
6
|
-
export * from './types/subscription';
|
|
7
|
-
export * from './types/interaction';
|
|
8
|
-
export * from './types/inpageclick';
|
|
9
|
-
export * from './types/printproduct';
|
|
10
|
-
export * from './types/product';
|
|
11
|
-
export * from './types/platform';
|
|
12
|
-
export * from './types/media';
|
|
13
|
-
export * from './types/consent';
|
|
14
|
-
export * from './types/component-type';
|
|
15
|
-
export * from './types/component-event';
|
|
16
|
-
export * from './types/event';
|
|
17
|
-
import { EventPayload } from
|
|
1
|
+
import './click-path-capture.js';
|
|
2
|
+
import './perf.js';
|
|
3
|
+
import './iframe-tracking.js';
|
|
4
|
+
export * from './types/abtest.js';
|
|
5
|
+
export * from './types/acquisition.js';
|
|
6
|
+
export * from './types/subscription.js';
|
|
7
|
+
export * from './types/interaction.js';
|
|
8
|
+
export * from './types/inpageclick.js';
|
|
9
|
+
export * from './types/printproduct.js';
|
|
10
|
+
export * from './types/product.js';
|
|
11
|
+
export * from './types/platform.js';
|
|
12
|
+
export * from './types/media.js';
|
|
13
|
+
export * from './types/consent.js';
|
|
14
|
+
export * from './types/component-type.js';
|
|
15
|
+
export * from './types/component-event.js';
|
|
16
|
+
export * from './types/event.js';
|
|
17
|
+
import { EventPayload } from './types/event.js';
|
|
18
18
|
interface NG {
|
|
19
19
|
record: (event: EventPayload, callback?: Function) => void;
|
|
20
20
|
pageViewId: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { AbTestInfo } from
|
|
2
|
-
import type { PrintOptions } from
|
|
3
|
-
import type { TComponentType } from
|
|
4
|
-
import type { TPlatform } from
|
|
5
|
-
import type { Product } from
|
|
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
6
|
/**
|
|
7
7
|
* A query string parameter
|
|
8
8
|
*/
|
|
@@ -16,13 +16,13 @@ export type QueryParameter = {
|
|
|
16
16
|
*/
|
|
17
17
|
value: string;
|
|
18
18
|
};
|
|
19
|
-
export type TPaymentFrequency =
|
|
20
|
-
export type TPaymentProvider =
|
|
21
|
-
export type TAcquisitionSource =
|
|
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
22
|
/**
|
|
23
23
|
* @deprecated DO NOT USE
|
|
24
24
|
*/
|
|
25
|
-
|
|
25
|
+
| 'GUARDIAN_APPS' | 'EMAIL' | 'SOCIAL' | 'SEARCH' | 'PPC' | 'DIRECT' | 'GUARDIAN_APP_IOS' | 'GUARDIAN_APP_ANDROID' | 'APPLE_NEWS' | 'GOOGLE_AMP' | 'YOUTUBE';
|
|
26
26
|
/**
|
|
27
27
|
* Represents monetary contribution made by a reader via this page.
|
|
28
28
|
*/
|
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
import type { AbTest } from
|
|
2
|
-
import type { Product } from
|
|
3
|
-
import { TComponentType } from
|
|
1
|
+
import type { AbTest } from './abtest.js';
|
|
2
|
+
import type { Product } from './product.js';
|
|
3
|
+
import { TComponentType } from './component-type.js';
|
|
4
4
|
export type TAction =
|
|
5
5
|
/**
|
|
6
6
|
* The component was inserted into its container (e.g. a web page or view in an app)
|
|
7
7
|
**/
|
|
8
|
-
|
|
8
|
+
'INSERT'
|
|
9
9
|
/**
|
|
10
10
|
* The component was in view on screen
|
|
11
11
|
**/
|
|
12
|
-
|
|
|
12
|
+
| 'VIEW'
|
|
13
13
|
/**
|
|
14
14
|
* The component was expanded (e.g. "see more").
|
|
15
15
|
* Not a navigation away to another page
|
|
16
16
|
**/
|
|
17
|
-
|
|
|
17
|
+
| 'EXPAND'
|
|
18
18
|
/**
|
|
19
19
|
* A "like", thumbs up, etc.
|
|
20
20
|
**/
|
|
21
|
-
|
|
|
21
|
+
| 'LIKE'
|
|
22
22
|
/**
|
|
23
23
|
* A "dislike", thumbs down, etc.
|
|
24
24
|
**/
|
|
25
|
-
|
|
|
25
|
+
| 'DISLIKE'
|
|
26
26
|
/**
|
|
27
27
|
* A subscription to a service, newsletter, etc.
|
|
28
28
|
**/
|
|
29
|
-
|
|
|
29
|
+
| 'SUBSCRIBE'
|
|
30
30
|
/**
|
|
31
31
|
* Selection of an answer in a quiz
|
|
32
32
|
**/
|
|
33
|
-
|
|
|
33
|
+
| 'ANSWER'
|
|
34
34
|
/**
|
|
35
35
|
* A vote in a poll
|
|
36
36
|
**/
|
|
37
|
-
|
|
|
37
|
+
| 'VOTE'
|
|
38
38
|
/**
|
|
39
39
|
* A single click on the component which is not covered by
|
|
40
40
|
* any of the existing Actions.
|
|
41
41
|
**/
|
|
42
|
-
|
|
|
42
|
+
| 'CLICK'
|
|
43
43
|
/**
|
|
44
44
|
* User sign in to Guardian Identity account
|
|
45
45
|
**/
|
|
46
|
-
|
|
|
46
|
+
| 'SIGN_IN'
|
|
47
47
|
/**
|
|
48
48
|
* User creates a Guardian Identity account
|
|
49
49
|
**/
|
|
50
|
-
|
|
|
50
|
+
| 'CREATE_ACCOUNT'
|
|
51
51
|
/**
|
|
52
52
|
* User Consent
|
|
53
53
|
**/
|
|
54
|
-
|
|
|
54
|
+
| 'ACCEPT_DEFAULT_CONSENT' | 'MANAGE_CONSENT' | 'CONSENT_ACCEPT_ALL' | 'CONSENT_REJECT_ALL'
|
|
55
55
|
/**
|
|
56
56
|
* The component sticks in the screen
|
|
57
57
|
**/
|
|
58
|
-
|
|
|
58
|
+
| 'STICK'
|
|
59
59
|
/**
|
|
60
60
|
* The component is closed
|
|
61
61
|
**/
|
|
62
|
-
|
|
|
62
|
+
| 'CLOSE'
|
|
63
63
|
/**
|
|
64
64
|
* The component is returned to its original location
|
|
65
65
|
**/
|
|
66
|
-
|
|
|
66
|
+
| 'RETURN';
|
|
67
67
|
export interface Component {
|
|
68
68
|
name: string;
|
|
69
69
|
loadTimeMs?: number;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { Consent } from
|
|
2
|
-
import type { ComponentEvent } from
|
|
3
|
-
import type { InPageClick } from
|
|
4
|
-
import type { AbTestInfo } from
|
|
5
|
-
import type { AudioEvent, VideoEvent } from
|
|
6
|
-
import type { TMembershipTier, TSubscriptionType } from
|
|
7
|
-
import type { TPlatform } from
|
|
8
|
-
import type { Acquisition } from
|
|
9
|
-
import { Interaction } from
|
|
1
|
+
import type { Consent } from './consent.js';
|
|
2
|
+
import type { ComponentEvent } from './component-event.js';
|
|
3
|
+
import type { InPageClick } from './inpageclick.js';
|
|
4
|
+
import type { AbTestInfo } from './abtest.js';
|
|
5
|
+
import type { AudioEvent, VideoEvent } from './media.js';
|
|
6
|
+
import type { TMembershipTier, TSubscriptionType } from './subscription.js';
|
|
7
|
+
import type { TPlatform } from './platform.js';
|
|
8
|
+
import type { Acquisition } from './acquisition.js';
|
|
9
|
+
import { Interaction } from './interaction.js';
|
|
10
10
|
/**
|
|
11
11
|
* Details about a page view - only populated for _PAGE_VIEW
|
|
12
12
|
* event types
|
|
@@ -30,7 +30,7 @@ interface PageView {
|
|
|
30
30
|
regular?: boolean;
|
|
31
31
|
subscriptionType?: TSubscriptionType;
|
|
32
32
|
membershipTier?: TMembershipTier;
|
|
33
|
-
navigationType?: PerformanceNavigationTiming[
|
|
33
|
+
navigationType?: PerformanceNavigationTiming['type'];
|
|
34
34
|
from?: string;
|
|
35
35
|
to?: string;
|
|
36
36
|
tz?: string;
|
|
@@ -80,7 +80,7 @@ interface LazyComponents {
|
|
|
80
80
|
/** The set of components that were loaded lazily on this page */
|
|
81
81
|
components: Component[];
|
|
82
82
|
}
|
|
83
|
-
export type TEdition =
|
|
83
|
+
export type TEdition = 'UK' | 'US' | 'AU' | 'International' | 'Europe';
|
|
84
84
|
export interface EventPayload extends Partial<Consent> {
|
|
85
85
|
/** If the user is logged in, the identity user id */
|
|
86
86
|
userId?: string;
|
package/NPM-dist/witness.js
CHANGED