@aranova/tracking-next 0.22.4 → 0.23.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 +24 -0
- package/dist/blog-server.js +8 -1
- package/dist/blog-server.js.map +1 -1
- package/dist/blog-server.mjs +8 -1
- package/dist/blog-server.mjs.map +1 -1
- package/dist/blog.d.mts +8 -1
- package/dist/blog.d.ts +8 -1
- package/dist/blog.js +8 -1
- package/dist/blog.js.map +1 -1
- package/dist/blog.mjs +8 -1
- package/dist/blog.mjs.map +1 -1
- package/dist/index.d.mts +9 -2
- package/dist/index.d.ts +9 -2
- package/dist/index.js +24 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23 -7
- package/dist/index.mjs.map +1 -1
- package/dist/middleware.js.map +1 -1
- package/dist/middleware.mjs.map +1 -1
- package/dist/phone.js.map +1 -1
- package/dist/phone.mjs.map +1 -1
- package/dist/{sales-B4_KmZP1.d.mts → sales-CmlzRq3u.d.mts} +39 -2
- package/dist/{sales-C5E4JcPP.d.ts → sales-D_BTsRuM.d.ts} +39 -2
- package/dist/sales.d.mts +1 -1
- package/dist/sales.d.ts +1 -1
- package/dist/server.js.map +1 -1
- package/dist/server.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -471,6 +471,30 @@ sales.trackConversion("phone_click"); // fires a manual event-goal only (no sale
|
|
|
471
471
|
APIs; do not use them for new installs. See
|
|
472
472
|
[conversion-config-schema.md](https://github.com/AranovaIO/aranova_internal/blob/master/docs/tracking-package/conversion-config-schema.md).
|
|
473
473
|
|
|
474
|
+
### Where the config is read from
|
|
475
|
+
|
|
476
|
+
`ARANOVA_TRACKING_CONFIG` carries the business identity, and the SDK composes the
|
|
477
|
+
object URL against the production CDN. Two origins are in play and they are easy to
|
|
478
|
+
conflate:
|
|
479
|
+
|
|
480
|
+
- `endpoint` — where **events** are POSTed (the Aranova API).
|
|
481
|
+
- `cdnBaseUrl` — where the **config object** is GET (object storage / CDN).
|
|
482
|
+
|
|
483
|
+
Switching `NEXT_PUBLIC_ARANOVA_TRACKING_ENDPOINT` to a local backend therefore does
|
|
484
|
+
_not_ move the config fetch. The generated module reads
|
|
485
|
+
`NEXT_PUBLIC_ARANOVA_CDN_BASE_URL` for that, falling back to production:
|
|
486
|
+
|
|
487
|
+
```
|
|
488
|
+
# .env.local — local object storage only. Leave UNSET in production.
|
|
489
|
+
NEXT_PUBLIC_ARANOVA_CDN_BASE_URL=http://localhost:9100/aranova-demos
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
No code change is needed; pass `ARANOVA_TRACKING_CONFIG` as-is. Setting this in
|
|
493
|
+
production points every visitor's browser at the wrong origin — events keep
|
|
494
|
+
flowing, so the dashboard looks healthy while on-page conversion firing never
|
|
495
|
+
engages. If you need to override it programmatically,
|
|
496
|
+
`resolveTrackingConfigUrl(ref)` returns the URL a reference resolves to.
|
|
497
|
+
|
|
474
498
|
## Consent (v2 — opt-out model)
|
|
475
499
|
|
|
476
500
|
Tracking is **on by default**: the consent-default `<Script>` injected by `GoogleAdsTracking` / `AdPlatformTracking` resolves the visitor's effective consent synchronously from `localStorage` before gtag.js loads — granted unless an explicit, unexpired decline is stored. A decline is honored for **90 days**; a grant never expires. There is no `pending` state and the package ships **no consent UI** — each site provides its own footer "cookie preferences" control and discloses tracking in its privacy policy (that notice is what makes the opt-out model defensible).
|
package/dist/blog-server.js
CHANGED
|
@@ -91,6 +91,13 @@ function registerCapability(capability) {
|
|
|
91
91
|
registered.add(capability);
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
// ../tracking-core/src/phone.ts
|
|
95
|
+
var import_libphonenumber_js = require("libphonenumber-js");
|
|
96
|
+
|
|
97
|
+
// ../tracking-core/src/resources/tracking-config-runtime.ts
|
|
98
|
+
var DEFAULT_CDN_BASE_URL = "https://demos.aranova.io";
|
|
99
|
+
var RETRY_MAX_MS = 5 * 6e4;
|
|
100
|
+
|
|
94
101
|
// ../tracking-core/src/resources/blog/schema.ts
|
|
95
102
|
var import_zod2 = require("zod");
|
|
96
103
|
|
|
@@ -430,7 +437,7 @@ function parseBlogPostContent(raw) {
|
|
|
430
437
|
// ../tracking-core/src/resources/blog/client.ts
|
|
431
438
|
function createBlogClient(config) {
|
|
432
439
|
registerCapability("blog_rendering");
|
|
433
|
-
const base = config.cdnBaseUrl.replace(/\/+$/, "");
|
|
440
|
+
const base = (config.cdnBaseUrl.trim() || DEFAULT_CDN_BASE_URL).replace(/\/+$/, "");
|
|
434
441
|
const doFetch = (...args) => (config.fetchImpl ?? fetch)(...args);
|
|
435
442
|
async function fetchJson(url, init) {
|
|
436
443
|
try {
|