@aranova/tracking-browser 0.17.3 → 0.18.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/README.md
CHANGED
|
@@ -11,10 +11,16 @@ Place the script in the document `<head>` before the rest of the page can run.
|
|
|
11
11
|
```html
|
|
12
12
|
<script src="https://cdn.jsdelivr.net/npm/@aranova/tracking-browser@0/dist/browser/aranova-tracking.global.js"></script>
|
|
13
13
|
<script>
|
|
14
|
+
const ARANOVA_TRACKING_CONFIG = {
|
|
15
|
+
cdnUrl: "https://demos.aranova.io/tracking-config/v1/<business_id>-production.json",
|
|
16
|
+
businessId: "<business_id>",
|
|
17
|
+
environment: "production",
|
|
18
|
+
};
|
|
19
|
+
|
|
14
20
|
window.AranovaTracking.init({
|
|
15
21
|
apiKey: "aranv_pk_...",
|
|
16
22
|
endpoint: "https://aranovainternal-production.up.railway.app/tracking",
|
|
17
|
-
|
|
23
|
+
trackingConfig: ARANOVA_TRACKING_CONFIG,
|
|
18
24
|
triggers: {
|
|
19
25
|
automatic: {
|
|
20
26
|
page_view: {},
|
|
@@ -40,11 +46,11 @@ and the old `renderConsentBanner` option is a deprecated no-op. Wire a footer
|
|
|
40
46
|
"cookie preferences" control to the consent API (see **Consent** below) and disclose the
|
|
41
47
|
tracking + opt-out in the site's privacy policy.
|
|
42
48
|
|
|
43
|
-
##
|
|
49
|
+
## Legacy static gtag IDs
|
|
44
50
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
51
|
+
`gtagId` and `gtagIds` remain compatibility APIs. Do not use them for new installs:
|
|
52
|
+
static IDs cannot consume dashboard tag changes or tombstones without a site edit. If
|
|
53
|
+
maintaining a legacy install, `gtagIds` loads every entry and takes precedence over `gtagId`.
|
|
48
54
|
|
|
49
55
|
```html
|
|
50
56
|
<script>
|
|
@@ -105,7 +111,7 @@ The browser package validates manual events at runtime. If an event is not regis
|
|
|
105
111
|
</script>
|
|
106
112
|
```
|
|
107
113
|
|
|
108
|
-
`fields[].value` can be any JSON value: string, number, boolean, null, array, or object
|
|
114
|
+
`fields[].value` can be any JSON value: string, number, boolean, null, array, or object and is stored as first-party JSONB. Intentionally submitted lead fields may include raw names, emails, phone numbers, addresses, selections, free-text messages, and submitted file data for first-party analytics and lead operations. Build the array explicitly from the submitted form; the SDK never scrapes arbitrary DOM fields. `File`/`Blob` objects must be converted to a JSON representation, and the complete event metadata must fit the 4 KB limit; upload larger files separately and send their storage reference. Never send passwords, authentication tokens, payment-card/bank credentials, or private keys. Apply the client's privacy notice, consent, retention, and regulated-data requirements. Google offline matching uses normalized, server-side SHA-256-hashed identifiers — not raw free-text/file metadata.
|
|
109
115
|
|
|
110
116
|
### Phone clicks (`tel:` taps) — manual or auto-capture
|
|
111
117
|
|
|
@@ -128,7 +134,7 @@ Then use ordinary phone links — a single delegated listener does the rest:
|
|
|
128
134
|
The number is read from the `href` (normalized to E.164); `section` comes from an optional
|
|
129
135
|
`data-aranova-section`. **Unlike `cta_click`, a `phone_click` also fires the Google Ads
|
|
130
136
|
conversion** for a linked phone-call goal (a `CLICK_TO_CALL` action) — auto-fired the moment the
|
|
131
|
-
tap is captured, so you never call `trackConversion`. (Firing needs `
|
|
137
|
+
tap is captured, so you never call `trackConversion`. (Firing needs `trackingConfig` wired; see
|
|
132
138
|
below.)
|
|
133
139
|
|
|
134
140
|
Prefer to instrument links yourself? Fire it per element instead — this fires the conversion the
|
|
@@ -217,13 +223,20 @@ packages. See the
|
|
|
217
223
|
|
|
218
224
|
## On-site conversion firing
|
|
219
225
|
|
|
220
|
-
Pass
|
|
221
|
-
|
|
222
|
-
`
|
|
223
|
-
|
|
226
|
+
Pass the generated `ARANOVA_TRACKING_CONFIG` reference to `init()`. The browser SDK shares one
|
|
227
|
+
R2 runtime for Google tag loading, page views, automatic goals, and
|
|
228
|
+
`AranovaTracking.sales()` firing. It confirms the current object before any Google command;
|
|
229
|
+
dashboard tag changes, goal remaps, and higher-version disabled tombstones propagate under
|
|
230
|
+
`public, max-age=60, must-revalidate` with no CLI run or site redeploy.
|
|
224
231
|
|
|
225
232
|
```html
|
|
226
233
|
<script>
|
|
234
|
+
const ARANOVA_TRACKING_CONFIG = {
|
|
235
|
+
cdnUrl: "https://demos.aranova.io/tracking-config/v1/<business_id>-production.json",
|
|
236
|
+
businessId: "<business_id>",
|
|
237
|
+
environment: "production",
|
|
238
|
+
};
|
|
239
|
+
|
|
227
240
|
window.AranovaTracking.init({
|
|
228
241
|
apiKey: "aranv_pk_...",
|
|
229
242
|
endpoint: "https://api.example.com/tracking",
|
|
@@ -231,9 +244,7 @@ stale-while-revalidate, so **changing the mapping needs no site change**.
|
|
|
231
244
|
automatic: { page_view: {}, scroll_depth: { thresholds: [50] } },
|
|
232
245
|
manual: { phone_click: {} },
|
|
233
246
|
},
|
|
234
|
-
|
|
235
|
-
cdnUrl: "https://demos.aranova.io/tracking-config/v1/<business_id>-production.json",
|
|
236
|
-
},
|
|
247
|
+
trackingConfig: ARANOVA_TRACKING_CONFIG,
|
|
237
248
|
});
|
|
238
249
|
|
|
239
250
|
// Automatic event-goals (scroll/time/page-view/…) fire THEMSELVES — no code.
|
|
@@ -247,8 +258,12 @@ stale-while-revalidate, so **changing the mapping needs no site change**.
|
|
|
247
258
|
</script>
|
|
248
259
|
```
|
|
249
260
|
|
|
250
|
-
Firing is consent-gated and de-duped by `transaction_id`.
|
|
251
|
-
|
|
261
|
+
Firing is consent-gated and de-duped by `transaction_id`. Remapping an existing key needs no
|
|
262
|
+
codegen. A **new manual goal key** still requires `tracking-cli gen` to refresh the generated
|
|
263
|
+
key list and site code that calls `trackConversion(key)`. `conversionConfig: { cdnUrl }` and
|
|
264
|
+
generated `ARANOVA_CONFIG_URL` remain legacy compatibility APIs; do not use them for new
|
|
265
|
+
installs. See
|
|
266
|
+
[conversion-config-schema.md](https://github.com/AranovaIO/aranova_internal/blob/master/docs/tracking-package/conversion-config-schema.md).
|
|
252
267
|
|
|
253
268
|
## Automatic Events
|
|
254
269
|
|