@serwist/google-analytics 8.0.3 → 8.0.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.
@@ -0,0 +1,4 @@
1
+ import type { GoogleAnalyticsInitializeOptions } from "./initialize.js";
2
+ import { initialize } from "./initialize.js";
3
+ export { initialize };
4
+ export type { GoogleAnalyticsInitializeOptions };
@@ -0,0 +1,26 @@
1
+ export interface GoogleAnalyticsInitializeOptions {
2
+ /**
3
+ * The cache name to store and retrieve analytics.js. Defaults to the cache names provided by `@serwist/core`.
4
+ */
5
+ cacheName?: string;
6
+ /**
7
+ * [Measurement Protocol parameters](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters),
8
+ * expressed as key/value pairs, to be added to replayed Google Analytics
9
+ * requests. This can be used to, e.g., set a custom dimension indicating
10
+ * that the request was replayed.
11
+ */
12
+ parameterOverrides?: {
13
+ [paramName: string]: string;
14
+ };
15
+ /**
16
+ * A function that allows you to modify the hit parameters prior to replaying
17
+ * the hit. The function is invoked with the original hit's URLSearchParams
18
+ * object as its only argument.
19
+ */
20
+ hitFilter?: (params: URLSearchParams) => void;
21
+ }
22
+ /**
23
+ * @param options
24
+ */
25
+ declare const initialize: (options?: GoogleAnalyticsInitializeOptions) => void;
26
+ export { initialize };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serwist/google-analytics",
3
- "version": "8.0.3",
3
+ "version": "8.0.4",
4
4
  "type": "module",
5
5
  "description": "Queues failed requests and uses the Background Sync API to replay them when the network is available",
6
6
  "files": [
@@ -26,26 +26,36 @@
26
26
  "types": "./dist/index.d.ts",
27
27
  "exports": {
28
28
  ".": {
29
- "import": "./dist/index.js",
30
- "require": "./dist/index.old.cjs",
31
- "types": "./dist/index.d.ts"
29
+ "import": {
30
+ "types": "./dist/index.d.ts",
31
+ "default": "./dist/index.js"
32
+ },
33
+ "require": {
34
+ "types": "./dist/index.old.d.cts",
35
+ "default": "./dist/index.old.cjs"
36
+ }
32
37
  },
33
38
  "./initialize": {
34
- "import": "./dist/initialize.js",
35
- "require": "./dist/initialize.old.cjs",
36
- "types": "./dist/initialize.d.ts"
39
+ "import": {
40
+ "types": "./dist/initialize.d.ts",
41
+ "default": "./dist/initialize.js"
42
+ },
43
+ "require": {
44
+ "types": "./dist/initialize.old.d.cts",
45
+ "default": "./dist/initialize.old.cjs"
46
+ }
37
47
  },
38
48
  "./package.json": "./package.json"
39
49
  },
40
50
  "dependencies": {
41
- "@serwist/background-sync": "8.0.3",
42
- "@serwist/core": "8.0.3",
43
- "@serwist/routing": "8.0.3",
44
- "@serwist/strategies": "8.0.3"
51
+ "@serwist/background-sync": "8.0.4",
52
+ "@serwist/core": "8.0.4",
53
+ "@serwist/routing": "8.0.4",
54
+ "@serwist/strategies": "8.0.4"
45
55
  },
46
56
  "devDependencies": {
47
57
  "rollup": "3.28.1",
48
- "@serwist/constants": "8.0.3"
58
+ "@serwist/constants": "8.0.4"
49
59
  },
50
60
  "scripts": {
51
61
  "build": "rimraf dist && cross-env NODE_ENV=production rollup --config rollup.config.js",