@metrone-io/react 1.2.0 → 1.2.2
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/README.md +10 -1
- package/dist/index.d.ts +2 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -44,7 +44,7 @@ function MyComponent() {
|
|
|
44
44
|
- **`useMetrone()`** — Hook returning all tracking methods
|
|
45
45
|
- **`withMetrone(Component)`** — HOC injecting Metrone props
|
|
46
46
|
- **Automatic route tracking** — SPA pageviews handled by the SDK (`autoTrackSPA: true`)
|
|
47
|
-
- **Automatic click tracking** — Outbound links, tel:, mailto:, downloads, and `data-track` elements
|
|
47
|
+
- **Automatic click tracking** — Outbound links, tel:, mailto:, downloads, and `data-track` elements. Requires `@metrone-io/sdk` ≥ 1.4.4 so query strings and `mailto:` local-parts are stripped, and Global Privacy Control is honored.
|
|
48
48
|
|
|
49
49
|
### Available tracking methods from `useMetrone()`
|
|
50
50
|
|
|
@@ -59,6 +59,15 @@ function MyComponent() {
|
|
|
59
59
|
| `trackAISession(data)` | Track AI session lifecycle |
|
|
60
60
|
| `flush()` | Flush pending events |
|
|
61
61
|
|
|
62
|
+
## Human vs AI traffic
|
|
63
|
+
|
|
64
|
+
Events are classified at ingest as human or AI automatically. Visitors
|
|
65
|
+
arriving from ChatGPT, Gemini, Perplexity, Claude, and other AI platforms
|
|
66
|
+
are grouped under canonical AI sources on the Metrone **AI Traffic**
|
|
67
|
+
dashboard — no extra code in your React app. To also capture AI agents
|
|
68
|
+
that fetch your pages without running JavaScript (GPTBot, ChatGPT-User,
|
|
69
|
+
PerplexityBot, …), add [server-side or edge capture](https://metrone.io/docs#agent-capture).
|
|
70
|
+
|
|
62
71
|
## Documentation
|
|
63
72
|
|
|
64
73
|
[metrone.io/docs](https://metrone.io/docs)
|
package/dist/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export interface MetroneProviderProps {
|
|
|
15
15
|
trackRouteChanges?: boolean;
|
|
16
16
|
eventPrefix?: string;
|
|
17
17
|
}
|
|
18
|
-
export declare function MetroneProvider({ config, children, }: MetroneProviderProps):
|
|
18
|
+
export declare function MetroneProvider({ config, children, }: MetroneProviderProps): React.JSX.Element;
|
|
19
19
|
export interface UseMetroneReturn {
|
|
20
20
|
analytics: Metrone | null;
|
|
21
21
|
isInitialized: boolean;
|
|
@@ -66,5 +66,5 @@ export declare function useMetrone(): UseMetroneReturn;
|
|
|
66
66
|
export declare function withMetrone<P extends object>(Component: React.ComponentType<P>, options?: {
|
|
67
67
|
trackPageViews?: boolean;
|
|
68
68
|
trackInteractions?: boolean;
|
|
69
|
-
}): (props: P) =>
|
|
69
|
+
}): (props: P) => React.JSX.Element;
|
|
70
70
|
export type { MetroneProviderProps, UseMetroneReturn, EventData, CampaignData, AnalyticsConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metrone-io/react",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "Metrone React integration - Privacy-first analytics for React",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"build": "rollup -c",
|
|
14
14
|
"build:watch": "rollup -c -w",
|
|
15
15
|
"dev": "rollup -c -w",
|
|
16
|
-
"test": "jest",
|
|
16
|
+
"test": "jest --passWithNoTests",
|
|
17
17
|
"test:watch": "jest --watch",
|
|
18
18
|
"lint": "eslint src --ext .ts,.tsx",
|
|
19
19
|
"lint:fix": "eslint src --ext .ts,.tsx --fix",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"node": ">=16.0.0"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@metrone-io/sdk": "^1.4.
|
|
47
|
+
"@metrone-io/sdk": "^1.4.4",
|
|
48
48
|
"react": ">=16.8.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|