@c15t/scripts 2.1.0 → 2.2.0-canary-20260804162155

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.
Files changed (140) hide show
  1. package/AGENTS.md +62 -0
  2. package/README.md +32 -20
  3. package/dist/e2e-test-utils.cjs +51 -10
  4. package/dist/e2e-test-utils.js +37 -3
  5. package/dist/engine/compile.cjs +9 -5
  6. package/dist/engine/runtime.cjs +103 -17
  7. package/dist/engine/runtime.js +94 -12
  8. package/dist/registry.cjs +97 -12
  9. package/dist/registry.js +80 -0
  10. package/dist/resolve.cjs +9 -5
  11. package/dist/types.cjs +17 -13
  12. package/dist/vendors/_shared/attributes.cjs +13 -9
  13. package/dist/vendors/_shared/google-consent.cjs +14 -9
  14. package/dist/vendors/_shared/install-builders.cjs +12 -8
  15. package/dist/vendors/_shared/script-url.cjs +16 -12
  16. package/dist/vendors/ads-and-pixels/linkedin-insights.cjs +9 -5
  17. package/dist/vendors/ads-and-pixels/meta-pixel.cjs +13 -9
  18. package/dist/vendors/ads-and-pixels/microsoft-uet.cjs +11 -7
  19. package/dist/vendors/ads-and-pixels/reddit-pixel.cjs +9 -5
  20. package/dist/vendors/ads-and-pixels/snapchat-pixel.cjs +11 -7
  21. package/dist/vendors/ads-and-pixels/tiktok-pixel.cjs +9 -5
  22. package/dist/vendors/ads-and-pixels/x-pixel.cjs +9 -5
  23. package/dist/vendors/analytics/adobe-analytics.cjs +90 -0
  24. package/dist/vendors/analytics/adobe-analytics.js +49 -0
  25. package/dist/vendors/analytics/ahrefs-analytics.cjs +11 -7
  26. package/dist/vendors/analytics/amplitude.cjs +193 -0
  27. package/dist/vendors/analytics/amplitude.js +134 -0
  28. package/dist/vendors/analytics/clearbit.cjs +69 -0
  29. package/dist/vendors/analytics/clearbit.js +28 -0
  30. package/dist/vendors/analytics/cloudflare-web-analytics.cjs +11 -7
  31. package/dist/vendors/analytics/databuddy.cjs +11 -7
  32. package/dist/vendors/analytics/fathom-analytics.cjs +11 -7
  33. package/dist/vendors/analytics/google-tag.cjs +11 -7
  34. package/dist/vendors/analytics/heap.cjs +181 -0
  35. package/dist/vendors/analytics/heap.js +134 -0
  36. package/dist/vendors/analytics/hightouch.cjs +153 -0
  37. package/dist/vendors/analytics/hightouch.js +109 -0
  38. package/dist/vendors/analytics/hotjar.cjs +11 -7
  39. package/dist/vendors/analytics/logrocket.cjs +99 -0
  40. package/dist/vendors/analytics/logrocket.js +58 -0
  41. package/dist/vendors/analytics/matomo-analytics.cjs +9 -5
  42. package/dist/vendors/analytics/microsoft-clarity.cjs +75 -47
  43. package/dist/vendors/analytics/microsoft-clarity.js +64 -40
  44. package/dist/vendors/analytics/mixpanel-analytics.cjs +31 -16
  45. package/dist/vendors/analytics/mixpanel-analytics.js +22 -11
  46. package/dist/vendors/analytics/pirsch.cjs +108 -0
  47. package/dist/vendors/analytics/pirsch.js +67 -0
  48. package/dist/vendors/analytics/plausible-analytics.cjs +9 -5
  49. package/dist/vendors/analytics/posthog.cjs +63 -27
  50. package/dist/vendors/analytics/posthog.js +52 -20
  51. package/dist/vendors/analytics/promptwatch.cjs +11 -7
  52. package/dist/vendors/analytics/rudderstack.cjs +227 -0
  53. package/dist/vendors/analytics/rudderstack.js +183 -0
  54. package/dist/vendors/analytics/rybbit-analytics.cjs +9 -5
  55. package/dist/vendors/analytics/segment.cjs +9 -5
  56. package/dist/vendors/analytics/umami-analytics.cjs +9 -5
  57. package/dist/vendors/analytics/vercel-analytics.cjs +11 -7
  58. package/dist/vendors/functional/crisp.cjs +9 -5
  59. package/dist/vendors/functional/intercom.cjs +11 -7
  60. package/dist/vendors/tag-managers/google-tag-manager.cjs +11 -7
  61. package/dist-types/registry.d.ts +313 -241
  62. package/dist-types/types.d.ts +46 -4
  63. package/dist-types/vendors/ads-and-pixels/linkedin-insights.d.ts +18 -18
  64. package/dist-types/vendors/ads-and-pixels/meta-pixel.d.ts +21 -21
  65. package/dist-types/vendors/ads-and-pixels/microsoft-uet.d.ts +32 -32
  66. package/dist-types/vendors/ads-and-pixels/reddit-pixel.d.ts +19 -19
  67. package/dist-types/vendors/ads-and-pixels/snapchat-pixel.d.ts +16 -16
  68. package/dist-types/vendors/ads-and-pixels/tiktok-pixel.d.ts +28 -28
  69. package/dist-types/vendors/ads-and-pixels/x-pixel.d.ts +13 -13
  70. package/dist-types/vendors/analytics/adobe-analytics.d.ts +75 -0
  71. package/dist-types/vendors/analytics/ahrefs-analytics.d.ts +7 -7
  72. package/dist-types/vendors/analytics/amplitude.d.ts +234 -0
  73. package/dist-types/vendors/analytics/clearbit.d.ts +60 -0
  74. package/dist-types/vendors/analytics/cloudflare-web-analytics.d.ts +7 -7
  75. package/dist-types/vendors/analytics/databuddy.d.ts +25 -25
  76. package/dist-types/vendors/analytics/fathom-analytics.d.ts +11 -11
  77. package/dist-types/vendors/analytics/google-tag.d.ts +17 -17
  78. package/dist-types/vendors/analytics/heap.d.ts +316 -0
  79. package/dist-types/vendors/analytics/hightouch.d.ts +285 -0
  80. package/dist-types/vendors/analytics/hotjar.d.ts +14 -14
  81. package/dist-types/vendors/analytics/logrocket.d.ts +101 -0
  82. package/dist-types/vendors/analytics/microsoft-clarity.d.ts +42 -30
  83. package/dist-types/vendors/analytics/mixpanel-analytics.d.ts +40 -28
  84. package/dist-types/vendors/analytics/pirsch.d.ts +96 -0
  85. package/dist-types/vendors/analytics/plausible-analytics.d.ts +13 -13
  86. package/dist-types/vendors/analytics/posthog.d.ts +63 -45
  87. package/dist-types/vendors/analytics/promptwatch.d.ts +7 -7
  88. package/dist-types/vendors/analytics/rudderstack.d.ts +330 -0
  89. package/dist-types/vendors/analytics/rybbit-analytics.d.ts +18 -18
  90. package/dist-types/vendors/analytics/segment.d.ts +13 -13
  91. package/dist-types/vendors/analytics/umami-analytics.d.ts +12 -12
  92. package/dist-types/vendors/analytics/vercel-analytics.d.ts +16 -16
  93. package/dist-types/vendors/functional/crisp.d.ts +11 -11
  94. package/dist-types/vendors/functional/intercom.d.ts +16 -16
  95. package/dist-types/vendors/tag-managers/google-tag-manager.d.ts +18 -18
  96. package/docs/README.md +62 -0
  97. package/docs/frameworks/javascript/script-loader.md +356 -0
  98. package/docs/frameworks/next/script-loader.md +501 -0
  99. package/docs/frameworks/react/script-loader.md +555 -0
  100. package/docs/integrations/adobe-analytics.md +160 -0
  101. package/docs/integrations/ahrefs-analytics.md +157 -0
  102. package/docs/integrations/amplitude.md +230 -0
  103. package/docs/integrations/building-integrations.md +239 -0
  104. package/docs/integrations/clearbit.md +130 -0
  105. package/docs/integrations/cloudflare-web-analytics.md +126 -0
  106. package/docs/integrations/crisp.md +140 -0
  107. package/docs/integrations/databuddy.md +205 -0
  108. package/docs/integrations/fathom-analytics.md +150 -0
  109. package/docs/integrations/google-maps.md +263 -0
  110. package/docs/integrations/google-tag-manager.md +154 -0
  111. package/docs/integrations/google-tag.md +134 -0
  112. package/docs/integrations/heap.md +219 -0
  113. package/docs/integrations/hightouch.md +199 -0
  114. package/docs/integrations/hotjar.md +143 -0
  115. package/docs/integrations/intercom.md +144 -0
  116. package/docs/integrations/linkedin-insights.md +161 -0
  117. package/docs/integrations/logrocket.md +175 -0
  118. package/docs/integrations/matomo-analytics.md +171 -0
  119. package/docs/integrations/meta-pixel.md +412 -0
  120. package/docs/integrations/microsoft-clarity.md +173 -0
  121. package/docs/integrations/microsoft-uet.md +156 -0
  122. package/docs/integrations/mixpanel-analytics.md +130 -0
  123. package/docs/integrations/overview.md +149 -0
  124. package/docs/integrations/pirsch.md +142 -0
  125. package/docs/integrations/plausible-analytics.md +154 -0
  126. package/docs/integrations/posthog.md +258 -0
  127. package/docs/integrations/promptwatch.md +121 -0
  128. package/docs/integrations/reddit-pixel.md +241 -0
  129. package/docs/integrations/rudderstack.md +271 -0
  130. package/docs/integrations/rybbit-analytics.md +143 -0
  131. package/docs/integrations/segment.md +146 -0
  132. package/docs/integrations/snapchat-pixel.md +163 -0
  133. package/docs/integrations/tiktok-pixel.md +123 -0
  134. package/docs/integrations/umami-analytics.md +148 -0
  135. package/docs/integrations/vercel-analytics.md +141 -0
  136. package/docs/integrations/x-pixel.md +157 -0
  137. package/docs/integrations/youtube.md +193 -0
  138. package/docs/shared/react/guides/script-loader.md +311 -0
  139. package/package.json +61 -7
  140. package/readme.json +8 -4
@@ -0,0 +1,143 @@
1
+ ---
2
+ title: Hotjar
3
+ description: Product analytics and behavior insights with a prebuilt helper that
4
+ seeds Hotjar globals before loading the vendor bundle.
5
+ group: integrations
6
+ icon: hotjar
7
+ ---
8
+ Hotjar helps you understand behavior with heatmaps, session recordings, and feedback tools. The `hotjar()` helper sets up Hotjar's `_hjSettings` global and `hj` queue stub, then loads the vendor script once `measurement` consent is granted.
9
+
10
+ ## Integrate with c15t
11
+
12
+ **React**
13
+
14
+ ```tsx
15
+ import { type ReactNode } from 'react';
16
+ import { ConsentManagerProvider } from '@c15t/react';
17
+ import { hotjar } from '@c15t/scripts/hotjar';
18
+
19
+ const scripts = [hotjar({ siteId: 1234567, version: 6 })];
20
+
21
+ export function ConsentProvider({ children }: { children: ReactNode }) {
22
+ return (
23
+ <ConsentManagerProvider
24
+ options={{
25
+ mode: 'hosted',
26
+ backendURL: 'https://your-instance.c15t.dev',
27
+ scripts,
28
+ }}
29
+ >
30
+ {children}
31
+ </ConsentManagerProvider>
32
+ );
33
+ }
34
+ ```
35
+
36
+ **Next.js**
37
+
38
+ ```tsx
39
+ 'use client';
40
+
41
+ import { type ReactNode } from 'react';
42
+ import { ConsentManagerProvider } from '@c15t/nextjs';
43
+ import { hotjar } from '@c15t/scripts/hotjar';
44
+
45
+ const scripts = [hotjar({ siteId: 1234567, version: 6 })];
46
+
47
+ export function ConsentProvider({ children }: { children: ReactNode }) {
48
+ return (
49
+ <ConsentManagerProvider
50
+ options={{
51
+ mode: 'hosted',
52
+ backendURL: '/api/c15t',
53
+ scripts,
54
+ }}
55
+ >
56
+ {children}
57
+ </ConsentManagerProvider>
58
+ );
59
+ }
60
+ ```
61
+
62
+ **JavaScript**
63
+
64
+ ```ts
65
+ import { getOrCreateConsentRuntime } from 'c15t';
66
+ import { hotjar } from '@c15t/scripts/hotjar';
67
+
68
+ getOrCreateConsentRuntime({
69
+ mode: 'hosted',
70
+ backendURL: 'https://your-instance.c15t.dev',
71
+ scripts: [hotjar({ siteId: 1234567, version: 6 })],
72
+ });
73
+ ```
74
+
75
+ ## How c15t loads it
76
+
77
+ * **Category:** `measurement` (Analytics)
78
+ * **Loads when:** measurement consent is granted
79
+ * **On revocation:** unloaded - c15t removes the loader script element from the DOM, which prevents further loader-driven network requests. Existing Hotjar requests, timers, event listeners, and globals may continue until they finish or are cleared by Hotjar-specific APIs.
80
+
81
+ To load Hotjar from a custom URL:
82
+
83
+ ```ts
84
+ hotjar({
85
+ siteId: 1234567,
86
+ scriptUrl: 'https://cdn.example.com/hotjar.js',
87
+ });
88
+ ```
89
+
90
+ ## Tracking events in your app
91
+
92
+ c15t gates loading of the Hotjar script until `measurement` consent is granted. The `hotjar()` helper initializes Hotjar globals by creating a pre-load queue stub at `window.hj`, so calls to Hotjar's runtime API (`window.hj(...)`) can be queued before the real script loads. After the helper runs, `window.hj` exists as that queue stub; once Hotjar's script loads, it is replaced by Hotjar's real implementation.
93
+
94
+ Guard event calls by checking consent state. From React:
95
+
96
+ ```tsx
97
+ import { useCallback } from 'react';
98
+ import { useConsentManager } from '@c15t/react';
99
+
100
+ function SignupExample() {
101
+ const { has } = useConsentManager();
102
+
103
+ const trackSignup = useCallback(() => {
104
+ if (has('measurement')) {
105
+ window.hj?.('event', 'signup');
106
+ }
107
+ }, [has]);
108
+
109
+ // Call trackSignup() from an event handler after signup succeeds.
110
+ }
111
+ ```
112
+
113
+ From plain JavaScript:
114
+
115
+ ```ts
116
+ import { getOrCreateConsentRuntime } from 'c15t';
117
+
118
+ const { consentStore } = getOrCreateConsentRuntime();
119
+
120
+ if (consentStore.getState().has('measurement')) {
121
+ window.hj?.('event', 'signup');
122
+ }
123
+ ```
124
+
125
+ ## Types
126
+
127
+ ### HotjarOptions
128
+
129
+ |Property|Value|
130
+ |:--|:--|
131
+ |Type Name|\`HotjarOptions\`|
132
+ |Source Path|\`./packages/scripts/src/vendors/analytics/hotjar.ts\`|
133
+
134
+ \*ExtractedTypeTable: Could not extract "HotjarOptions" from "./packages/scripts/src/vendors/analytics/hotjar.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
135
+
136
+ ### Script
137
+
138
+ |Property|Value|
139
+ |:--|:--|
140
+ |Type Name|\`Script\`|
141
+ |Source Path|\`./packages/core/src/libs/script-loader/types.ts\`|
142
+
143
+ \*ExtractedTypeTable: Could not extract "Script" from "./packages/core/src/libs/script-loader/types.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
@@ -0,0 +1,144 @@
1
+ ---
2
+ title: Intercom
3
+ description: Bootstrap Intercom settings and load the messenger widget bundle.
4
+ group: integrations
5
+ icon: intercom
6
+ ---
7
+ Intercom adds the Intercom messenger widget and queues early `Intercom(...)`
8
+ calls until the widget bundle loads.
9
+
10
+ ## Official Intercom documentation
11
+
12
+ * [Install Intercom Messenger](https://developers.intercom.com/installing-intercom/web/installation)
13
+ * [Secure your Messenger](https://developers.intercom.com/installing-intercom/web/identity-verification)
14
+ * [JavaScript API](https://developers.intercom.com/installing-intercom/web/methods)
15
+ * [Attributes and objects](https://developers.intercom.com/installing-intercom/web/attributes-objects)
16
+
17
+ ## Integrate with c15t
18
+
19
+ **React**
20
+
21
+ ```tsx
22
+ import { type ReactNode } from 'react';
23
+ import { ConsentManagerProvider } from '@c15t/react';
24
+ import { intercom } from '@c15t/scripts/intercom';
25
+
26
+ const scripts = [intercom({ appId: 'abc123' })];
27
+
28
+ export function ConsentProvider({ children }: { children: ReactNode }) {
29
+ return (
30
+ <ConsentManagerProvider
31
+ options={{
32
+ mode: 'hosted',
33
+ backendURL: 'https://your-instance.c15t.dev',
34
+ scripts,
35
+ }}
36
+ >
37
+ {children}
38
+ </ConsentManagerProvider>
39
+ );
40
+ }
41
+ ```
42
+
43
+ **Next.js**
44
+
45
+ ```tsx
46
+ 'use client';
47
+
48
+ import { type ReactNode } from 'react';
49
+ import { ConsentManagerProvider } from '@c15t/nextjs';
50
+ import { intercom } from '@c15t/scripts/intercom';
51
+
52
+ const scripts = [intercom({ appId: 'abc123' })];
53
+
54
+ export function ConsentProvider({ children }: { children: ReactNode }) {
55
+ return (
56
+ <ConsentManagerProvider
57
+ options={{
58
+ mode: 'hosted',
59
+ backendURL: '/api/c15t',
60
+ scripts,
61
+ }}
62
+ >
63
+ {children}
64
+ </ConsentManagerProvider>
65
+ );
66
+ }
67
+ ```
68
+
69
+ **JavaScript**
70
+
71
+ ```ts
72
+ import { getOrCreateConsentRuntime } from 'c15t';
73
+ import { intercom } from '@c15t/scripts/intercom';
74
+
75
+ getOrCreateConsentRuntime({
76
+ mode: 'hosted',
77
+ backendURL: 'https://your-instance.c15t.dev',
78
+ scripts: [intercom({ appId: 'abc123' })],
79
+ });
80
+ ```
81
+
82
+ ## How c15t loads it
83
+
84
+ * **Category:** `functionality` (Functional)
85
+ * **Loads when:** functionality consent is granted
86
+ * **Before load:** c15t seeds `window.intercomSettings` and a queueing
87
+ `Intercom` stub
88
+ * **On revocation:** c15t follows the default script loader behavior for
89
+ non-persistent scripts
90
+
91
+ ## Configure the integration
92
+
93
+ Intercom's default regional API base is `https://api-iam.intercom.io`. If your
94
+ workspace uses the EU or Australia data host, pass the matching `apiBase`.
95
+
96
+ ```ts
97
+ intercom({
98
+ appId: 'abc123',
99
+ apiBase: 'https://api-iam.eu.intercom.io',
100
+ })
101
+ ```
102
+
103
+ ### Runtime options
104
+
105
+ Pass additional Intercom settings through `settings`. The helper always writes
106
+ the provided `appId` to `app_id` and `apiBase` to `api_base`.
107
+
108
+ ```ts
109
+ intercom({
110
+ appId: 'abc123',
111
+ settings: {
112
+ name: 'Ada Lovelace',
113
+ user_id: 'user-123',
114
+ company: {
115
+ company_id: 'company-123',
116
+ name: 'Example Company Inc.',
117
+ },
118
+ },
119
+ })
120
+ ```
121
+
122
+ For logged-in users, Intercom recommends securing the Messenger with
123
+ server-generated identity data. Generate verification tokens on your backend and
124
+ only pass client-safe values through `settings`.
125
+
126
+ ## Types
127
+
128
+ ### IntercomOptions
129
+
130
+ |Property|Value|
131
+ |:--|:--|
132
+ |Type Name|\`IntercomOptions\`|
133
+ |Source Path|\`./packages/scripts/src/vendors/functional/intercom.ts\`|
134
+
135
+ \*ExtractedTypeTable: Could not extract "IntercomOptions" from "./packages/scripts/src/vendors/functional/intercom.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
136
+
137
+ ### Script
138
+
139
+ |Property|Value|
140
+ |:--|:--|
141
+ |Type Name|\`Script\`|
142
+ |Source Path|\`./packages/core/src/libs/script-loader/types.ts\`|
143
+
144
+ \*ExtractedTypeTable: Could not extract "Script" from "./packages/core/src/libs/script-loader/types.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
@@ -0,0 +1,161 @@
1
+ ---
2
+ title: LinkedIn Insights
3
+ description: Track conversions and build matched audiences for LinkedIn
4
+ advertising campaigns.
5
+ icon: linkedin
6
+ group: integrations
7
+ ---
8
+ LinkedIn Insight Tag is LinkedIn's conversion tracking and audience matching tool for LinkedIn advertising campaigns. It tracks website actions, measures ad performance, builds website retargeting audiences, and provides aggregate audience insights about visitors from LinkedIn member accounts.
9
+
10
+ ## Official LinkedIn documentation
11
+
12
+ * [Add the LinkedIn Insight Tag to your website](https://www.linkedin.com/help/lms/answer/a418880)
13
+ * [LinkedIn Insight Tag overview](https://www.linkedin.com/help/lms/answer/a489169)
14
+ * [LinkedIn Insight Tag FAQs](https://www.linkedin.com/help/lms/answer/a427660)
15
+ * [Insight Tag source status](https://www.linkedin.com/help/lms/answer/a488323)
16
+ * [Compatible tag management systems](https://www.linkedin.com/help/lms/answer/a422760)
17
+ * [LinkedIn Ads Agreement](https://www.linkedin.com/legal/sas-terms)
18
+
19
+ ## Integrate with c15t
20
+
21
+ **React**
22
+
23
+ ```tsx
24
+ import { type ReactNode } from 'react';
25
+ import { ConsentManagerProvider } from '@c15t/react';
26
+ import { linkedinInsights } from '@c15t/scripts/linkedin-insights';
27
+
28
+ const scripts = [
29
+ linkedinInsights({
30
+ id: '123456789012345',
31
+ }),
32
+ ];
33
+
34
+ export function ConsentProvider({ children }: { children: ReactNode }) {
35
+ return (
36
+ <ConsentManagerProvider
37
+ options={{
38
+ mode: 'hosted',
39
+ backendURL: 'https://your-instance.c15t.dev',
40
+ scripts,
41
+ }}
42
+ >
43
+ {children}
44
+ </ConsentManagerProvider>
45
+ );
46
+ }
47
+ ```
48
+
49
+ **Next.js**
50
+
51
+ ```tsx
52
+ 'use client';
53
+
54
+ import { type ReactNode } from 'react';
55
+ import { ConsentManagerProvider } from '@c15t/nextjs';
56
+ import { linkedinInsights } from '@c15t/scripts/linkedin-insights';
57
+
58
+ const scripts = [
59
+ linkedinInsights({
60
+ id: '123456789012345',
61
+ }),
62
+ ];
63
+
64
+ export function ConsentProvider({ children }: { children: ReactNode }) {
65
+ return (
66
+ <ConsentManagerProvider
67
+ options={{
68
+ mode: 'hosted',
69
+ backendURL: '/api/c15t',
70
+ scripts,
71
+ }}
72
+ >
73
+ {children}
74
+ </ConsentManagerProvider>
75
+ );
76
+ }
77
+ ```
78
+
79
+ **JavaScript**
80
+
81
+ ```ts
82
+ import { getOrCreateConsentRuntime } from 'c15t';
83
+ import { linkedinInsights } from '@c15t/scripts/linkedin-insights';
84
+
85
+ getOrCreateConsentRuntime({
86
+ mode: 'hosted',
87
+ backendURL: 'https://your-instance.c15t.dev',
88
+ scripts: [
89
+ linkedinInsights({
90
+ id: '123456789012345',
91
+ }),
92
+ ],
93
+ });
94
+ ```
95
+
96
+ ## How c15t loads it
97
+
98
+ * **Category:** `marketing` (Ads & Pixels)
99
+ * **Loads when:** marketing consent is granted
100
+ * **Default install:** c15t sets the LinkedIn partner ID globals, seeds the `lintrk` queue, and loads LinkedIn's `insight.min.js`
101
+ * **On revocation:** unloaded - c15t removes the script element from the DOM
102
+
103
+ > ⚠️ **Warning:**
104
+ > LinkedIn says the Insight Tag should not be installed on pages that collect or contain Sensitive Data, including certain consumer health or financial pages. If your app has those pages, only include this script on eligible routes and confirm the placement with your legal team.
105
+
106
+ Use the LinkedIn Insight Tag partner ID as `id`. You can find it in Campaign Manager under **Data** -> **Signals manager** -> **Insight Tag**.
107
+
108
+ c15t intentionally does not add LinkedIn's `<noscript>` image pixel fallback. The integration is consent-gated JavaScript, so the script only loads after `marketing` consent is granted.
109
+
110
+ ## Tracking events in your app
111
+
112
+ c15t gates the LinkedIn Insight Tag from loading until `marketing` consent is granted. Page tracking is automatic once the script loads, but if you fire custom conversions through `window.lintrk(...)`, those calls are **not** automatically gated - `window.lintrk` does not exist before consent is granted, and is removed again if consent is revoked.
113
+
114
+ Guard custom conversion calls by checking consent state:
115
+
116
+ ```tsx
117
+ import { useCallback } from 'react';
118
+ import { useConsentManager } from '@c15t/react';
119
+
120
+ function useTrackSignup() {
121
+ const { has } = useConsentManager();
122
+ return useCallback(() => {
123
+ if (has('marketing')) {
124
+ window.lintrk?.('track', { conversion_id: 12345 });
125
+ }
126
+ }, [has]);
127
+ }
128
+
129
+ function SignupButton() {
130
+ const trackSignup = useTrackSignup();
131
+ return <button onClick={trackSignup}>Sign up</button>;
132
+ }
133
+ ```
134
+
135
+ ## Verify setup
136
+
137
+ LinkedIn validates the tag after an associated domain or URL receives traffic. Source status can take a few minutes and up to 24 hours to update after the first page load:
138
+
139
+ * **Active:** signal received in the past seven days
140
+ * **No recent activity:** no signal for more than seven days
141
+ * **Unverified:** no signal received yet
142
+
143
+ ## Types
144
+
145
+ ### LinkedInInsightsOptions
146
+
147
+ |Property|Value|
148
+ |:--|:--|
149
+ |Type Name|\`LinkedInInsightsOptions\`|
150
+ |Source Path|\`./packages/scripts/src/vendors/ads-and-pixels/linkedin-insights.ts\`|
151
+
152
+ \*ExtractedTypeTable: Could not extract "LinkedInInsightsOptions" from "./packages/scripts/src/vendors/ads-and-pixels/linkedin-insights.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
153
+
154
+ ### Script
155
+
156
+ |Property|Value|
157
+ |:--|:--|
158
+ |Type Name|\`Script\`|
159
+ |Source Path|\`./packages/core/src/libs/script-loader/types.ts\`|
160
+
161
+ \*ExtractedTypeTable: Could not extract "Script" from "./packages/core/src/libs/script-loader/types.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
@@ -0,0 +1,175 @@
1
+ ---
2
+ title: LogRocket
3
+ description: Session replay and monitoring loaded after measurement consent with
4
+ LogRocket's browser SDK.
5
+ group: integrations
6
+ icon: logrocket
7
+ ---
8
+ [LogRocket](https://logrocket.com) records session replay, frontend errors, network activity, console logs, and user behavior so product and engineering teams can debug production sessions. c15t loads `LogRocket.min.js` with `crossorigin="anonymous"` and then calls `window.LogRocket.init('org-slug/app-slug')`.
9
+
10
+ ## Integrate with c15t
11
+
12
+ **React**
13
+
14
+ ```tsx
15
+ import { type ReactNode } from 'react';
16
+ import { ConsentManagerProvider } from '@c15t/react';
17
+ import { logRocket } from '@c15t/scripts/logrocket';
18
+
19
+ const scripts = [
20
+ logRocket({
21
+ appId: 'YOUR_ORG_SLUG/YOUR_APP_SLUG',
22
+ initOptions: {
23
+ dom: {
24
+ inputSanitizer: true,
25
+ },
26
+ },
27
+ }),
28
+ ];
29
+
30
+ export function ConsentProvider({ children }: { children: ReactNode }) {
31
+ return (
32
+ <ConsentManagerProvider
33
+ options={{
34
+ mode: 'hosted',
35
+ backendURL: 'https://your-instance.c15t.dev',
36
+ scripts,
37
+ }}
38
+ >
39
+ {children}
40
+ </ConsentManagerProvider>
41
+ );
42
+ }
43
+ ```
44
+
45
+ **Next.js**
46
+
47
+ ```tsx
48
+ 'use client';
49
+
50
+ import { type ReactNode } from 'react';
51
+ import { ConsentManagerProvider } from '@c15t/nextjs';
52
+ import { logRocket } from '@c15t/scripts/logrocket';
53
+
54
+ const scripts = [
55
+ logRocket({
56
+ appId: 'YOUR_ORG_SLUG/YOUR_APP_SLUG',
57
+ initOptions: {
58
+ dom: {
59
+ inputSanitizer: true,
60
+ },
61
+ },
62
+ }),
63
+ ];
64
+
65
+ export function ConsentProvider({ children }: { children: ReactNode }) {
66
+ return (
67
+ <ConsentManagerProvider
68
+ options={{
69
+ mode: 'hosted',
70
+ backendURL: '/api/c15t',
71
+ scripts,
72
+ }}
73
+ >
74
+ {children}
75
+ </ConsentManagerProvider>
76
+ );
77
+ }
78
+ ```
79
+
80
+ **JavaScript**
81
+
82
+ ```ts
83
+ import { getOrCreateConsentRuntime } from 'c15t';
84
+ import { logRocket } from '@c15t/scripts/logrocket';
85
+
86
+ getOrCreateConsentRuntime({
87
+ mode: 'hosted',
88
+ backendURL: 'https://your-instance.c15t.dev',
89
+ scripts: [
90
+ logRocket({
91
+ appId: 'YOUR_ORG_SLUG/YOUR_APP_SLUG',
92
+ initOptions: {
93
+ dom: {
94
+ inputSanitizer: true,
95
+ },
96
+ },
97
+ }),
98
+ ],
99
+ });
100
+ ```
101
+
102
+ ## How c15t loads it
103
+
104
+ * **Category:** `measurement` (Analytics)
105
+ * **Loads when:** measurement consent is granted
106
+ * **On revocation:** unloaded - c15t removes the script element from the DOM. LogRocket does not document a web SDK consent opt-out or stop-recording API equivalent to Clarity or Mixpanel consent methods, and removing the loader does not stop an already-initialized recorder in the current page view. Revocation fully takes effect on the next page load.
107
+
108
+ The helper maps the script-tag snippet into the manifest engine:
109
+
110
+ ```ts
111
+ logRocket({
112
+ appId: 'YOUR_ORG_SLUG/YOUR_APP_SLUG',
113
+ })
114
+ ```
115
+
116
+ It loads `https://cdn.logrocket.io/LogRocket.min.js` with `crossorigin="anonymous"` and calls:
117
+
118
+ ```ts
119
+ window.LogRocket?.init('YOUR_ORG_SLUG/YOUR_APP_SLUG', initOptions)
120
+ ```
121
+
122
+ after the script load event. `appId` is required and must be in `org/app` format.
123
+
124
+ ## Privacy and sanitization
125
+
126
+ LogRocket captures user behavior for replay, so configure sanitization before deploying it. LogRocket documents DOM redaction with `data-private`, automatic text/input/image sanitization, and network request/response sanitizers. Password fields are never recorded, but other sensitive inputs, DOM nodes, network payloads, Redux state, and Redux actions should be explicitly excluded.
127
+
128
+ Pass JSON-serializable LogRocket init options as `initOptions`:
129
+
130
+ ```ts
131
+ logRocket({
132
+ appId: 'YOUR_ORG_SLUG/YOUR_APP_SLUG',
133
+ initOptions: {
134
+ dom: {
135
+ inputSanitizer: true,
136
+ textSanitizer: true,
137
+ imageSanitizer: true,
138
+ privateClassNameBlocklist: ['private-profile'],
139
+ privateAttributeBlocklist: ['data-hide-from-replay'],
140
+ },
141
+ },
142
+ })
143
+ ```
144
+
145
+ Only pass values that can safely cross the manifest boundary. Avoid functions, class instances, prototypes, `Map`, `Set`, or other non-JSON types unless you are constructing a manual `Script` outside the manifest helper. LogRocket also supports function-based network sanitizers; use a manual `Script` if you need those callbacks.
146
+
147
+ To proxy or self-host the loader, pass a custom URL. LogRocket's proxy setup also chain-loads a logger bundle, so set `asyncScriptUrl` as well — otherwise the async bundle is still fetched from LogRocket's CDN:
148
+
149
+ ```ts
150
+ logRocket({
151
+ appId: 'YOUR_ORG_SLUG/YOUR_APP_SLUG',
152
+ scriptUrl: 'https://analytics.example.com/LogRocket.min.js',
153
+ asyncScriptUrl: 'https://analytics.example.com/logger.min.js',
154
+ })
155
+ ```
156
+
157
+ ## Types
158
+
159
+ ### LogRocketOptions
160
+
161
+ |Property|Value|
162
+ |:--|:--|
163
+ |Type Name|\`LogRocketOptions\`|
164
+ |Source Path|\`./packages/scripts/src/vendors/analytics/logrocket.ts\`|
165
+
166
+ \*ExtractedTypeTable: Could not extract "LogRocketOptions" from "./packages/scripts/src/vendors/analytics/logrocket.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
167
+
168
+ ### Script
169
+
170
+ |Property|Value|
171
+ |:--|:--|
172
+ |Type Name|\`Script\`|
173
+ |Source Path|\`./packages/core/src/libs/script-loader/types.ts\`|
174
+
175
+ \*ExtractedTypeTable: Could not extract "Script" from "./packages/core/src/libs/script-loader/types.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*