@aranova/tracking-next 0.19.1 → 0.20.0

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/dist/index.mjs CHANGED
@@ -1059,7 +1059,6 @@ function ensureScript(gtagId) {
1059
1059
  var TrackingConfigRuntime = class {
1060
1060
  constructor(ref, fetchImpl = globalThis.fetch) {
1061
1061
  this.ref = ref;
1062
- this.fetchImpl = fetchImpl;
1063
1062
  this.current = null;
1064
1063
  this.etag = null;
1065
1064
  this.stateValue = "unconfirmed";
@@ -1074,6 +1073,7 @@ var TrackingConfigRuntime = class {
1074
1073
  this.automaticQueue = [];
1075
1074
  this.pageQueue = [];
1076
1075
  this.listeners = /* @__PURE__ */ new Set();
1076
+ this.fetchImpl = fetchImpl.bind(globalThis);
1077
1077
  const cached = readCache2(ref.cdnUrl);
1078
1078
  this.current = cached?.config ?? null;
1079
1079
  this.etag = cached?.etag ?? null;
@@ -1999,17 +1999,12 @@ var scrollDepthConfigSchema = z9.object({
1999
1999
 
2000
2000
  // ../tracking-core/src/events/specific-page-visit.ts
2001
2001
  import { z as z10 } from "zod";
2002
- var SPECIFIC_PAGE_NAMES = [
2003
- "contact_page",
2004
- "about_page",
2005
- "services_page",
2006
- "booking_page",
2007
- "location_page",
2008
- "pricing_page",
2009
- "faq_page",
2010
- "testimonials_page"
2011
- ];
2012
- var specificPageNameSchema = z10.enum(SPECIFIC_PAGE_NAMES);
2002
+ var PAGE_IDENTITY_MAX_LENGTH = 64;
2003
+ var PAGE_IDENTITY_PATTERN = /^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$/;
2004
+ var pageIdentitySchema = z10.string().max(PAGE_IDENTITY_MAX_LENGTH).regex(PAGE_IDENTITY_PATTERN, {
2005
+ message: "page identity must be lowercase snake_case, start with a letter, and contain at most 64 characters"
2006
+ });
2007
+ var specificPageNameSchema = pageIdentitySchema;
2013
2008
  var specificPageVisitMetadataSchema = z10.object({
2014
2009
  page_name: specificPageNameSchema,
2015
2010
  page: z10.object({
@@ -3383,7 +3378,7 @@ function GoogleAdsTracking(props) {
3383
3378
  import { usePathname, useSearchParams } from "next/navigation";
3384
3379
 
3385
3380
  // package.json
3386
- var version = "0.19.1";
3381
+ var version = "0.20.0";
3387
3382
 
3388
3383
  // src/factory.tsx
3389
3384
  import {