@shware/analytics 3.2.4 → 3.2.5
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/third-parties/linkedin-insight-tag.cjs +2 -0
- package/dist/third-parties/linkedin-insight-tag.cjs.map +1 -1
- package/dist/third-parties/linkedin-insight-tag.mjs +2 -0
- package/dist/third-parties/linkedin-insight-tag.mjs.map +1 -1
- package/dist/third-parties/meta-pixel.cjs +2 -0
- package/dist/third-parties/meta-pixel.cjs.map +1 -1
- package/dist/third-parties/meta-pixel.mjs +2 -0
- package/dist/third-parties/meta-pixel.mjs.map +1 -1
- package/dist/third-parties/reddit-pixel.cjs +2 -0
- package/dist/third-parties/reddit-pixel.cjs.map +1 -1
- package/dist/third-parties/reddit-pixel.mjs +2 -0
- package/dist/third-parties/reddit-pixel.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -31,6 +31,8 @@ function sendLinkedinEvent(config) {
|
|
|
31
31
|
console.warn("lintrk has not been initialized");
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
|
+
if (window.location.host.includes("127.0.0.1")) return;
|
|
35
|
+
if (window.location.host.includes("localhost")) return;
|
|
34
36
|
const conversion_id = config[name];
|
|
35
37
|
if (!conversion_id) return;
|
|
36
38
|
window.lintrk("track", { conversion_id, event_id });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/third-parties/linkedin-insight-tag.ts"],"sourcesContent":["import type { Lintrk } from '../track/lintrk';\nimport type { EventName, TrackName, TrackProperties } from '../track/types';\nimport { getFirst } from '../utils/field';\nimport type { UpdateVisitorDTO } from '../visitor/types';\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n interface Window extends Lintrk {}\n}\n\n/**\n * LinkedIn Conversion Config:\n * example:\n * {\n * purchase: 123,\n * add_to_cart: 456,\n * add_to_wishlist: 789,\n * }\n */\nexport type LinkedinConversionConfig = Record<Lowercase<string>, number>;\n\nexport function sendLinkedinEvent(config: LinkedinConversionConfig) {\n return <T extends EventName>(\n name: TrackName<T>,\n _properties?: TrackProperties<T>,\n event_id?: string\n ) => {\n if (typeof window === 'undefined' || !window.lintrk) {\n console.warn('lintrk has not been initialized');\n return;\n }\n\n const conversion_id = config[name as Lowercase<string>];\n if (!conversion_id) return;\n window.lintrk('track', { conversion_id, event_id });\n };\n}\n\nexport function setLinkedinUser({ data }: UpdateVisitorDTO) {\n if (typeof window === 'undefined' || !window.lintrk) {\n console.warn('lintrk has not been initialized');\n return;\n }\n\n const email = getFirst(data?.email);\n if (!email) return;\n window.lintrk('setUserData', { email });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAAyB;AAmBlB,SAAS,kBAAkB,QAAkC;AAClE,SAAO,CACL,MACA,aACA,aACG;AACH,QAAI,OAAO,WAAW,eAAe,CAAC,OAAO,QAAQ;AACnD,cAAQ,KAAK,iCAAiC;AAC9C;AAAA,IACF;
|
|
1
|
+
{"version":3,"sources":["../../src/third-parties/linkedin-insight-tag.ts"],"sourcesContent":["import type { Lintrk } from '../track/lintrk';\nimport type { EventName, TrackName, TrackProperties } from '../track/types';\nimport { getFirst } from '../utils/field';\nimport type { UpdateVisitorDTO } from '../visitor/types';\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n interface Window extends Lintrk {}\n}\n\n/**\n * LinkedIn Conversion Config:\n * example:\n * {\n * purchase: 123,\n * add_to_cart: 456,\n * add_to_wishlist: 789,\n * }\n */\nexport type LinkedinConversionConfig = Record<Lowercase<string>, number>;\n\nexport function sendLinkedinEvent(config: LinkedinConversionConfig) {\n return <T extends EventName>(\n name: TrackName<T>,\n _properties?: TrackProperties<T>,\n event_id?: string\n ) => {\n if (typeof window === 'undefined' || !window.lintrk) {\n console.warn('lintrk has not been initialized');\n return;\n }\n if (window.location.host.includes('127.0.0.1')) return;\n if (window.location.host.includes('localhost')) return;\n\n const conversion_id = config[name as Lowercase<string>];\n if (!conversion_id) return;\n window.lintrk('track', { conversion_id, event_id });\n };\n}\n\nexport function setLinkedinUser({ data }: UpdateVisitorDTO) {\n if (typeof window === 'undefined' || !window.lintrk) {\n console.warn('lintrk has not been initialized');\n return;\n }\n\n const email = getFirst(data?.email);\n if (!email) return;\n window.lintrk('setUserData', { email });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAAyB;AAmBlB,SAAS,kBAAkB,QAAkC;AAClE,SAAO,CACL,MACA,aACA,aACG;AACH,QAAI,OAAO,WAAW,eAAe,CAAC,OAAO,QAAQ;AACnD,cAAQ,KAAK,iCAAiC;AAC9C;AAAA,IACF;AACA,QAAI,OAAO,SAAS,KAAK,SAAS,WAAW,EAAG;AAChD,QAAI,OAAO,SAAS,KAAK,SAAS,WAAW,EAAG;AAEhD,UAAM,gBAAgB,OAAO,IAAyB;AACtD,QAAI,CAAC,cAAe;AACpB,WAAO,OAAO,SAAS,EAAE,eAAe,SAAS,CAAC;AAAA,EACpD;AACF;AAEO,SAAS,gBAAgB,EAAE,KAAK,GAAqB;AAC1D,MAAI,OAAO,WAAW,eAAe,CAAC,OAAO,QAAQ;AACnD,YAAQ,KAAK,iCAAiC;AAC9C;AAAA,EACF;AAEA,QAAM,YAAQ,uBAAS,6BAAM,KAAK;AAClC,MAAI,CAAC,MAAO;AACZ,SAAO,OAAO,eAAe,EAAE,MAAM,CAAC;AACxC;","names":[]}
|
|
@@ -6,6 +6,8 @@ function sendLinkedinEvent(config) {
|
|
|
6
6
|
console.warn("lintrk has not been initialized");
|
|
7
7
|
return;
|
|
8
8
|
}
|
|
9
|
+
if (window.location.host.includes("127.0.0.1")) return;
|
|
10
|
+
if (window.location.host.includes("localhost")) return;
|
|
9
11
|
const conversion_id = config[name];
|
|
10
12
|
if (!conversion_id) return;
|
|
11
13
|
window.lintrk("track", { conversion_id, event_id });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/third-parties/linkedin-insight-tag.ts"],"sourcesContent":["import type { Lintrk } from '../track/lintrk';\nimport type { EventName, TrackName, TrackProperties } from '../track/types';\nimport { getFirst } from '../utils/field';\nimport type { UpdateVisitorDTO } from '../visitor/types';\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n interface Window extends Lintrk {}\n}\n\n/**\n * LinkedIn Conversion Config:\n * example:\n * {\n * purchase: 123,\n * add_to_cart: 456,\n * add_to_wishlist: 789,\n * }\n */\nexport type LinkedinConversionConfig = Record<Lowercase<string>, number>;\n\nexport function sendLinkedinEvent(config: LinkedinConversionConfig) {\n return <T extends EventName>(\n name: TrackName<T>,\n _properties?: TrackProperties<T>,\n event_id?: string\n ) => {\n if (typeof window === 'undefined' || !window.lintrk) {\n console.warn('lintrk has not been initialized');\n return;\n }\n\n const conversion_id = config[name as Lowercase<string>];\n if (!conversion_id) return;\n window.lintrk('track', { conversion_id, event_id });\n };\n}\n\nexport function setLinkedinUser({ data }: UpdateVisitorDTO) {\n if (typeof window === 'undefined' || !window.lintrk) {\n console.warn('lintrk has not been initialized');\n return;\n }\n\n const email = getFirst(data?.email);\n if (!email) return;\n window.lintrk('setUserData', { email });\n}\n"],"mappings":";AAEA,SAAS,gBAAgB;AAmBlB,SAAS,kBAAkB,QAAkC;AAClE,SAAO,CACL,MACA,aACA,aACG;AACH,QAAI,OAAO,WAAW,eAAe,CAAC,OAAO,QAAQ;AACnD,cAAQ,KAAK,iCAAiC;AAC9C;AAAA,IACF;
|
|
1
|
+
{"version":3,"sources":["../../src/third-parties/linkedin-insight-tag.ts"],"sourcesContent":["import type { Lintrk } from '../track/lintrk';\nimport type { EventName, TrackName, TrackProperties } from '../track/types';\nimport { getFirst } from '../utils/field';\nimport type { UpdateVisitorDTO } from '../visitor/types';\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n interface Window extends Lintrk {}\n}\n\n/**\n * LinkedIn Conversion Config:\n * example:\n * {\n * purchase: 123,\n * add_to_cart: 456,\n * add_to_wishlist: 789,\n * }\n */\nexport type LinkedinConversionConfig = Record<Lowercase<string>, number>;\n\nexport function sendLinkedinEvent(config: LinkedinConversionConfig) {\n return <T extends EventName>(\n name: TrackName<T>,\n _properties?: TrackProperties<T>,\n event_id?: string\n ) => {\n if (typeof window === 'undefined' || !window.lintrk) {\n console.warn('lintrk has not been initialized');\n return;\n }\n if (window.location.host.includes('127.0.0.1')) return;\n if (window.location.host.includes('localhost')) return;\n\n const conversion_id = config[name as Lowercase<string>];\n if (!conversion_id) return;\n window.lintrk('track', { conversion_id, event_id });\n };\n}\n\nexport function setLinkedinUser({ data }: UpdateVisitorDTO) {\n if (typeof window === 'undefined' || !window.lintrk) {\n console.warn('lintrk has not been initialized');\n return;\n }\n\n const email = getFirst(data?.email);\n if (!email) return;\n window.lintrk('setUserData', { email });\n}\n"],"mappings":";AAEA,SAAS,gBAAgB;AAmBlB,SAAS,kBAAkB,QAAkC;AAClE,SAAO,CACL,MACA,aACA,aACG;AACH,QAAI,OAAO,WAAW,eAAe,CAAC,OAAO,QAAQ;AACnD,cAAQ,KAAK,iCAAiC;AAC9C;AAAA,IACF;AACA,QAAI,OAAO,SAAS,KAAK,SAAS,WAAW,EAAG;AAChD,QAAI,OAAO,SAAS,KAAK,SAAS,WAAW,EAAG;AAEhD,UAAM,gBAAgB,OAAO,IAAyB;AACtD,QAAI,CAAC,cAAe;AACpB,WAAO,OAAO,SAAS,EAAE,eAAe,SAAS,CAAC;AAAA,EACpD;AACF;AAEO,SAAS,gBAAgB,EAAE,KAAK,GAAqB;AAC1D,MAAI,OAAO,WAAW,eAAe,CAAC,OAAO,QAAQ;AACnD,YAAQ,KAAK,iCAAiC;AAC9C;AAAA,EACF;AAEA,QAAM,QAAQ,SAAS,6BAAM,KAAK;AAClC,MAAI,CAAC,MAAO;AACZ,SAAO,OAAO,eAAe,EAAE,MAAM,CAAC;AACxC;","names":[]}
|
|
@@ -33,6 +33,8 @@ function sendFBEvent(name, properties, event_id) {
|
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
35
|
if (metrics.includes(name)) return;
|
|
36
|
+
if (window.location.host.includes("127.0.0.1")) return;
|
|
37
|
+
if (window.location.host.includes("localhost")) return;
|
|
36
38
|
const options = { eventID: event_id };
|
|
37
39
|
const [type, fbEventName, fbEventProperties] = (0, import_fbq.mapFBEvent)(name, properties);
|
|
38
40
|
if (type === "track") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/third-parties/meta-pixel.ts"],"sourcesContent":["import { type FBQ, type PixelId, mapFBEvent } from '../track/fbq';\nimport type { EventName, TrackName, TrackProperties } from '../track/types';\nimport { getFirst } from '../utils/field';\nimport type { UpdateVisitorDTO } from '../visitor/types';\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n interface Window extends FBQ {}\n}\n\nconst metrics = ['CLS', 'FCP', 'FID', 'INP', 'LCP', 'TTFB'];\n\nexport function sendFBEvent<T extends EventName>(\n name: TrackName<T>,\n properties?: TrackProperties<T>,\n event_id?: string\n) {\n if (typeof window === 'undefined' || !window.fbq) {\n console.warn('fbq has not been initialized');\n return;\n }\n if (metrics.includes(name)) return;\n\n const options = { eventID: event_id };\n const [type, fbEventName, fbEventProperties] = mapFBEvent(name, properties);\n if (type === 'track') {\n window.fbq(type, fbEventName, fbEventProperties, options);\n } else {\n window.fbq(type, fbEventName, fbEventProperties, options);\n }\n}\n\nexport function setFBUser(pixelId: PixelId) {\n return ({ user_id, data }: UpdateVisitorDTO) => {\n if (typeof window === 'undefined' || !window.fbq) {\n console.warn('fbq has not been initialized');\n return;\n }\n\n const address = getFirst(data?.address);\n\n window.fbq('init', pixelId, {\n em: getFirst(data?.email),\n fn: address?.first_name,\n ln: address?.last_name,\n ph: getFirst(data?.phone_number),\n external_id: user_id,\n ct: address?.city,\n st: address?.street,\n zp: address?.postal_code,\n country: address?.country,\n });\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAmD;AAEnD,mBAAyB;AAQzB,IAAM,UAAU,CAAC,OAAO,OAAO,OAAO,OAAO,OAAO,MAAM;AAEnD,SAAS,YACd,MACA,YACA,UACA;AACA,MAAI,OAAO,WAAW,eAAe,CAAC,OAAO,KAAK;AAChD,YAAQ,KAAK,8BAA8B;AAC3C;AAAA,EACF;AACA,MAAI,QAAQ,SAAS,IAAI,EAAG;
|
|
1
|
+
{"version":3,"sources":["../../src/third-parties/meta-pixel.ts"],"sourcesContent":["import { type FBQ, type PixelId, mapFBEvent } from '../track/fbq';\nimport type { EventName, TrackName, TrackProperties } from '../track/types';\nimport { getFirst } from '../utils/field';\nimport type { UpdateVisitorDTO } from '../visitor/types';\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n interface Window extends FBQ {}\n}\n\nconst metrics = ['CLS', 'FCP', 'FID', 'INP', 'LCP', 'TTFB'];\n\nexport function sendFBEvent<T extends EventName>(\n name: TrackName<T>,\n properties?: TrackProperties<T>,\n event_id?: string\n) {\n if (typeof window === 'undefined' || !window.fbq) {\n console.warn('fbq has not been initialized');\n return;\n }\n if (metrics.includes(name)) return;\n if (window.location.host.includes('127.0.0.1')) return;\n if (window.location.host.includes('localhost')) return;\n\n const options = { eventID: event_id };\n const [type, fbEventName, fbEventProperties] = mapFBEvent(name, properties);\n if (type === 'track') {\n window.fbq(type, fbEventName, fbEventProperties, options);\n } else {\n window.fbq(type, fbEventName, fbEventProperties, options);\n }\n}\n\nexport function setFBUser(pixelId: PixelId) {\n return ({ user_id, data }: UpdateVisitorDTO) => {\n if (typeof window === 'undefined' || !window.fbq) {\n console.warn('fbq has not been initialized');\n return;\n }\n\n const address = getFirst(data?.address);\n\n window.fbq('init', pixelId, {\n em: getFirst(data?.email),\n fn: address?.first_name,\n ln: address?.last_name,\n ph: getFirst(data?.phone_number),\n external_id: user_id,\n ct: address?.city,\n st: address?.street,\n zp: address?.postal_code,\n country: address?.country,\n });\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAmD;AAEnD,mBAAyB;AAQzB,IAAM,UAAU,CAAC,OAAO,OAAO,OAAO,OAAO,OAAO,MAAM;AAEnD,SAAS,YACd,MACA,YACA,UACA;AACA,MAAI,OAAO,WAAW,eAAe,CAAC,OAAO,KAAK;AAChD,YAAQ,KAAK,8BAA8B;AAC3C;AAAA,EACF;AACA,MAAI,QAAQ,SAAS,IAAI,EAAG;AAC5B,MAAI,OAAO,SAAS,KAAK,SAAS,WAAW,EAAG;AAChD,MAAI,OAAO,SAAS,KAAK,SAAS,WAAW,EAAG;AAEhD,QAAM,UAAU,EAAE,SAAS,SAAS;AACpC,QAAM,CAAC,MAAM,aAAa,iBAAiB,QAAI,uBAAW,MAAM,UAAU;AAC1E,MAAI,SAAS,SAAS;AACpB,WAAO,IAAI,MAAM,aAAa,mBAAmB,OAAO;AAAA,EAC1D,OAAO;AACL,WAAO,IAAI,MAAM,aAAa,mBAAmB,OAAO;AAAA,EAC1D;AACF;AAEO,SAAS,UAAU,SAAkB;AAC1C,SAAO,CAAC,EAAE,SAAS,KAAK,MAAwB;AAC9C,QAAI,OAAO,WAAW,eAAe,CAAC,OAAO,KAAK;AAChD,cAAQ,KAAK,8BAA8B;AAC3C;AAAA,IACF;AAEA,UAAM,cAAU,uBAAS,6BAAM,OAAO;AAEtC,WAAO,IAAI,QAAQ,SAAS;AAAA,MAC1B,QAAI,uBAAS,6BAAM,KAAK;AAAA,MACxB,IAAI,mCAAS;AAAA,MACb,IAAI,mCAAS;AAAA,MACb,QAAI,uBAAS,6BAAM,YAAY;AAAA,MAC/B,aAAa;AAAA,MACb,IAAI,mCAAS;AAAA,MACb,IAAI,mCAAS;AAAA,MACb,IAAI,mCAAS;AAAA,MACb,SAAS,mCAAS;AAAA,IACpB,CAAC;AAAA,EACH;AACF;","names":[]}
|
|
@@ -8,6 +8,8 @@ function sendFBEvent(name, properties, event_id) {
|
|
|
8
8
|
return;
|
|
9
9
|
}
|
|
10
10
|
if (metrics.includes(name)) return;
|
|
11
|
+
if (window.location.host.includes("127.0.0.1")) return;
|
|
12
|
+
if (window.location.host.includes("localhost")) return;
|
|
11
13
|
const options = { eventID: event_id };
|
|
12
14
|
const [type, fbEventName, fbEventProperties] = mapFBEvent(name, properties);
|
|
13
15
|
if (type === "track") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/third-parties/meta-pixel.ts"],"sourcesContent":["import { type FBQ, type PixelId, mapFBEvent } from '../track/fbq';\nimport type { EventName, TrackName, TrackProperties } from '../track/types';\nimport { getFirst } from '../utils/field';\nimport type { UpdateVisitorDTO } from '../visitor/types';\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n interface Window extends FBQ {}\n}\n\nconst metrics = ['CLS', 'FCP', 'FID', 'INP', 'LCP', 'TTFB'];\n\nexport function sendFBEvent<T extends EventName>(\n name: TrackName<T>,\n properties?: TrackProperties<T>,\n event_id?: string\n) {\n if (typeof window === 'undefined' || !window.fbq) {\n console.warn('fbq has not been initialized');\n return;\n }\n if (metrics.includes(name)) return;\n\n const options = { eventID: event_id };\n const [type, fbEventName, fbEventProperties] = mapFBEvent(name, properties);\n if (type === 'track') {\n window.fbq(type, fbEventName, fbEventProperties, options);\n } else {\n window.fbq(type, fbEventName, fbEventProperties, options);\n }\n}\n\nexport function setFBUser(pixelId: PixelId) {\n return ({ user_id, data }: UpdateVisitorDTO) => {\n if (typeof window === 'undefined' || !window.fbq) {\n console.warn('fbq has not been initialized');\n return;\n }\n\n const address = getFirst(data?.address);\n\n window.fbq('init', pixelId, {\n em: getFirst(data?.email),\n fn: address?.first_name,\n ln: address?.last_name,\n ph: getFirst(data?.phone_number),\n external_id: user_id,\n ct: address?.city,\n st: address?.street,\n zp: address?.postal_code,\n country: address?.country,\n });\n };\n}\n"],"mappings":";AAAA,SAAiC,kBAAkB;AAEnD,SAAS,gBAAgB;AAQzB,IAAM,UAAU,CAAC,OAAO,OAAO,OAAO,OAAO,OAAO,MAAM;AAEnD,SAAS,YACd,MACA,YACA,UACA;AACA,MAAI,OAAO,WAAW,eAAe,CAAC,OAAO,KAAK;AAChD,YAAQ,KAAK,8BAA8B;AAC3C;AAAA,EACF;AACA,MAAI,QAAQ,SAAS,IAAI,EAAG;
|
|
1
|
+
{"version":3,"sources":["../../src/third-parties/meta-pixel.ts"],"sourcesContent":["import { type FBQ, type PixelId, mapFBEvent } from '../track/fbq';\nimport type { EventName, TrackName, TrackProperties } from '../track/types';\nimport { getFirst } from '../utils/field';\nimport type { UpdateVisitorDTO } from '../visitor/types';\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n interface Window extends FBQ {}\n}\n\nconst metrics = ['CLS', 'FCP', 'FID', 'INP', 'LCP', 'TTFB'];\n\nexport function sendFBEvent<T extends EventName>(\n name: TrackName<T>,\n properties?: TrackProperties<T>,\n event_id?: string\n) {\n if (typeof window === 'undefined' || !window.fbq) {\n console.warn('fbq has not been initialized');\n return;\n }\n if (metrics.includes(name)) return;\n if (window.location.host.includes('127.0.0.1')) return;\n if (window.location.host.includes('localhost')) return;\n\n const options = { eventID: event_id };\n const [type, fbEventName, fbEventProperties] = mapFBEvent(name, properties);\n if (type === 'track') {\n window.fbq(type, fbEventName, fbEventProperties, options);\n } else {\n window.fbq(type, fbEventName, fbEventProperties, options);\n }\n}\n\nexport function setFBUser(pixelId: PixelId) {\n return ({ user_id, data }: UpdateVisitorDTO) => {\n if (typeof window === 'undefined' || !window.fbq) {\n console.warn('fbq has not been initialized');\n return;\n }\n\n const address = getFirst(data?.address);\n\n window.fbq('init', pixelId, {\n em: getFirst(data?.email),\n fn: address?.first_name,\n ln: address?.last_name,\n ph: getFirst(data?.phone_number),\n external_id: user_id,\n ct: address?.city,\n st: address?.street,\n zp: address?.postal_code,\n country: address?.country,\n });\n };\n}\n"],"mappings":";AAAA,SAAiC,kBAAkB;AAEnD,SAAS,gBAAgB;AAQzB,IAAM,UAAU,CAAC,OAAO,OAAO,OAAO,OAAO,OAAO,MAAM;AAEnD,SAAS,YACd,MACA,YACA,UACA;AACA,MAAI,OAAO,WAAW,eAAe,CAAC,OAAO,KAAK;AAChD,YAAQ,KAAK,8BAA8B;AAC3C;AAAA,EACF;AACA,MAAI,QAAQ,SAAS,IAAI,EAAG;AAC5B,MAAI,OAAO,SAAS,KAAK,SAAS,WAAW,EAAG;AAChD,MAAI,OAAO,SAAS,KAAK,SAAS,WAAW,EAAG;AAEhD,QAAM,UAAU,EAAE,SAAS,SAAS;AACpC,QAAM,CAAC,MAAM,aAAa,iBAAiB,IAAI,WAAW,MAAM,UAAU;AAC1E,MAAI,SAAS,SAAS;AACpB,WAAO,IAAI,MAAM,aAAa,mBAAmB,OAAO;AAAA,EAC1D,OAAO;AACL,WAAO,IAAI,MAAM,aAAa,mBAAmB,OAAO;AAAA,EAC1D;AACF;AAEO,SAAS,UAAU,SAAkB;AAC1C,SAAO,CAAC,EAAE,SAAS,KAAK,MAAwB;AAC9C,QAAI,OAAO,WAAW,eAAe,CAAC,OAAO,KAAK;AAChD,cAAQ,KAAK,8BAA8B;AAC3C;AAAA,IACF;AAEA,UAAM,UAAU,SAAS,6BAAM,OAAO;AAEtC,WAAO,IAAI,QAAQ,SAAS;AAAA,MAC1B,IAAI,SAAS,6BAAM,KAAK;AAAA,MACxB,IAAI,mCAAS;AAAA,MACb,IAAI,mCAAS;AAAA,MACb,IAAI,SAAS,6BAAM,YAAY;AAAA,MAC/B,aAAa;AAAA,MACb,IAAI,mCAAS;AAAA,MACb,IAAI,mCAAS;AAAA,MACb,IAAI,mCAAS;AAAA,MACb,SAAS,mCAAS;AAAA,IACpB,CAAC;AAAA,EACH;AACF;","names":[]}
|
|
@@ -33,6 +33,8 @@ function sendRedditEvent(name, properties, eventId) {
|
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
35
|
if (metrics.includes(name)) return;
|
|
36
|
+
if (window.location.host.includes("127.0.0.1")) return;
|
|
37
|
+
if (window.location.host.includes("localhost")) return;
|
|
36
38
|
const [type, params] = (0, import_rdt.mapRDTEvent)(name, properties, eventId);
|
|
37
39
|
if (type === "Custom") {
|
|
38
40
|
window.rdt("track", type, JSON.parse(JSON.stringify(params)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/third-parties/reddit-pixel.ts"],"sourcesContent":["import { type PixelId, type RDT, mapRDTEvent } from '../track/rdt';\nimport type { EventName, TrackName, TrackProperties } from '../track/types';\nimport { getFirst } from '../utils/field';\nimport type { UpdateVisitorDTO } from '../visitor/types';\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n interface Window extends RDT {}\n}\n\nconst metrics = ['CLS', 'FCP', 'FID', 'INP', 'LCP', 'TTFB'];\n\nexport function sendRedditEvent<T extends EventName>(\n name: TrackName<T>,\n properties?: TrackProperties<T>,\n eventId?: string\n) {\n if (typeof window === 'undefined' || !window.rdt) {\n console.warn('rdt has not been initialized');\n return;\n }\n if (metrics.includes(name)) return;\n\n const [type, params] = mapRDTEvent(name, properties, eventId);\n if (type === 'Custom') {\n window.rdt('track', type, JSON.parse(JSON.stringify(params)));\n } else {\n window.rdt('track', type, JSON.parse(JSON.stringify(params)));\n }\n}\n\nexport function setRedditUser(pixelId: PixelId) {\n return ({ user_id, data }: UpdateVisitorDTO) => {\n if (!window.rdt) {\n console.warn('rdt has not been initialized');\n return;\n }\n\n window.rdt('init', pixelId, {\n email: getFirst(data?.email),\n phoneNumber: getFirst(data?.phone_number),\n externalId: user_id,\n });\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAoD;AAEpD,mBAAyB;AAQzB,IAAM,UAAU,CAAC,OAAO,OAAO,OAAO,OAAO,OAAO,MAAM;AAEnD,SAAS,gBACd,MACA,YACA,SACA;AACA,MAAI,OAAO,WAAW,eAAe,CAAC,OAAO,KAAK;AAChD,YAAQ,KAAK,8BAA8B;AAC3C;AAAA,EACF;AACA,MAAI,QAAQ,SAAS,IAAI,EAAG;
|
|
1
|
+
{"version":3,"sources":["../../src/third-parties/reddit-pixel.ts"],"sourcesContent":["import { type PixelId, type RDT, mapRDTEvent } from '../track/rdt';\nimport type { EventName, TrackName, TrackProperties } from '../track/types';\nimport { getFirst } from '../utils/field';\nimport type { UpdateVisitorDTO } from '../visitor/types';\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n interface Window extends RDT {}\n}\n\nconst metrics = ['CLS', 'FCP', 'FID', 'INP', 'LCP', 'TTFB'];\n\nexport function sendRedditEvent<T extends EventName>(\n name: TrackName<T>,\n properties?: TrackProperties<T>,\n eventId?: string\n) {\n if (typeof window === 'undefined' || !window.rdt) {\n console.warn('rdt has not been initialized');\n return;\n }\n if (metrics.includes(name)) return;\n if (window.location.host.includes('127.0.0.1')) return;\n if (window.location.host.includes('localhost')) return;\n\n const [type, params] = mapRDTEvent(name, properties, eventId);\n if (type === 'Custom') {\n window.rdt('track', type, JSON.parse(JSON.stringify(params)));\n } else {\n window.rdt('track', type, JSON.parse(JSON.stringify(params)));\n }\n}\n\nexport function setRedditUser(pixelId: PixelId) {\n return ({ user_id, data }: UpdateVisitorDTO) => {\n if (!window.rdt) {\n console.warn('rdt has not been initialized');\n return;\n }\n\n window.rdt('init', pixelId, {\n email: getFirst(data?.email),\n phoneNumber: getFirst(data?.phone_number),\n externalId: user_id,\n });\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAoD;AAEpD,mBAAyB;AAQzB,IAAM,UAAU,CAAC,OAAO,OAAO,OAAO,OAAO,OAAO,MAAM;AAEnD,SAAS,gBACd,MACA,YACA,SACA;AACA,MAAI,OAAO,WAAW,eAAe,CAAC,OAAO,KAAK;AAChD,YAAQ,KAAK,8BAA8B;AAC3C;AAAA,EACF;AACA,MAAI,QAAQ,SAAS,IAAI,EAAG;AAC5B,MAAI,OAAO,SAAS,KAAK,SAAS,WAAW,EAAG;AAChD,MAAI,OAAO,SAAS,KAAK,SAAS,WAAW,EAAG;AAEhD,QAAM,CAAC,MAAM,MAAM,QAAI,wBAAY,MAAM,YAAY,OAAO;AAC5D,MAAI,SAAS,UAAU;AACrB,WAAO,IAAI,SAAS,MAAM,KAAK,MAAM,KAAK,UAAU,MAAM,CAAC,CAAC;AAAA,EAC9D,OAAO;AACL,WAAO,IAAI,SAAS,MAAM,KAAK,MAAM,KAAK,UAAU,MAAM,CAAC,CAAC;AAAA,EAC9D;AACF;AAEO,SAAS,cAAc,SAAkB;AAC9C,SAAO,CAAC,EAAE,SAAS,KAAK,MAAwB;AAC9C,QAAI,CAAC,OAAO,KAAK;AACf,cAAQ,KAAK,8BAA8B;AAC3C;AAAA,IACF;AAEA,WAAO,IAAI,QAAQ,SAAS;AAAA,MAC1B,WAAO,uBAAS,6BAAM,KAAK;AAAA,MAC3B,iBAAa,uBAAS,6BAAM,YAAY;AAAA,MACxC,YAAY;AAAA,IACd,CAAC;AAAA,EACH;AACF;","names":[]}
|
|
@@ -8,6 +8,8 @@ function sendRedditEvent(name, properties, eventId) {
|
|
|
8
8
|
return;
|
|
9
9
|
}
|
|
10
10
|
if (metrics.includes(name)) return;
|
|
11
|
+
if (window.location.host.includes("127.0.0.1")) return;
|
|
12
|
+
if (window.location.host.includes("localhost")) return;
|
|
11
13
|
const [type, params] = mapRDTEvent(name, properties, eventId);
|
|
12
14
|
if (type === "Custom") {
|
|
13
15
|
window.rdt("track", type, JSON.parse(JSON.stringify(params)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/third-parties/reddit-pixel.ts"],"sourcesContent":["import { type PixelId, type RDT, mapRDTEvent } from '../track/rdt';\nimport type { EventName, TrackName, TrackProperties } from '../track/types';\nimport { getFirst } from '../utils/field';\nimport type { UpdateVisitorDTO } from '../visitor/types';\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n interface Window extends RDT {}\n}\n\nconst metrics = ['CLS', 'FCP', 'FID', 'INP', 'LCP', 'TTFB'];\n\nexport function sendRedditEvent<T extends EventName>(\n name: TrackName<T>,\n properties?: TrackProperties<T>,\n eventId?: string\n) {\n if (typeof window === 'undefined' || !window.rdt) {\n console.warn('rdt has not been initialized');\n return;\n }\n if (metrics.includes(name)) return;\n\n const [type, params] = mapRDTEvent(name, properties, eventId);\n if (type === 'Custom') {\n window.rdt('track', type, JSON.parse(JSON.stringify(params)));\n } else {\n window.rdt('track', type, JSON.parse(JSON.stringify(params)));\n }\n}\n\nexport function setRedditUser(pixelId: PixelId) {\n return ({ user_id, data }: UpdateVisitorDTO) => {\n if (!window.rdt) {\n console.warn('rdt has not been initialized');\n return;\n }\n\n window.rdt('init', pixelId, {\n email: getFirst(data?.email),\n phoneNumber: getFirst(data?.phone_number),\n externalId: user_id,\n });\n };\n}\n"],"mappings":";AAAA,SAAiC,mBAAmB;AAEpD,SAAS,gBAAgB;AAQzB,IAAM,UAAU,CAAC,OAAO,OAAO,OAAO,OAAO,OAAO,MAAM;AAEnD,SAAS,gBACd,MACA,YACA,SACA;AACA,MAAI,OAAO,WAAW,eAAe,CAAC,OAAO,KAAK;AAChD,YAAQ,KAAK,8BAA8B;AAC3C;AAAA,EACF;AACA,MAAI,QAAQ,SAAS,IAAI,EAAG;
|
|
1
|
+
{"version":3,"sources":["../../src/third-parties/reddit-pixel.ts"],"sourcesContent":["import { type PixelId, type RDT, mapRDTEvent } from '../track/rdt';\nimport type { EventName, TrackName, TrackProperties } from '../track/types';\nimport { getFirst } from '../utils/field';\nimport type { UpdateVisitorDTO } from '../visitor/types';\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n interface Window extends RDT {}\n}\n\nconst metrics = ['CLS', 'FCP', 'FID', 'INP', 'LCP', 'TTFB'];\n\nexport function sendRedditEvent<T extends EventName>(\n name: TrackName<T>,\n properties?: TrackProperties<T>,\n eventId?: string\n) {\n if (typeof window === 'undefined' || !window.rdt) {\n console.warn('rdt has not been initialized');\n return;\n }\n if (metrics.includes(name)) return;\n if (window.location.host.includes('127.0.0.1')) return;\n if (window.location.host.includes('localhost')) return;\n\n const [type, params] = mapRDTEvent(name, properties, eventId);\n if (type === 'Custom') {\n window.rdt('track', type, JSON.parse(JSON.stringify(params)));\n } else {\n window.rdt('track', type, JSON.parse(JSON.stringify(params)));\n }\n}\n\nexport function setRedditUser(pixelId: PixelId) {\n return ({ user_id, data }: UpdateVisitorDTO) => {\n if (!window.rdt) {\n console.warn('rdt has not been initialized');\n return;\n }\n\n window.rdt('init', pixelId, {\n email: getFirst(data?.email),\n phoneNumber: getFirst(data?.phone_number),\n externalId: user_id,\n });\n };\n}\n"],"mappings":";AAAA,SAAiC,mBAAmB;AAEpD,SAAS,gBAAgB;AAQzB,IAAM,UAAU,CAAC,OAAO,OAAO,OAAO,OAAO,OAAO,MAAM;AAEnD,SAAS,gBACd,MACA,YACA,SACA;AACA,MAAI,OAAO,WAAW,eAAe,CAAC,OAAO,KAAK;AAChD,YAAQ,KAAK,8BAA8B;AAC3C;AAAA,EACF;AACA,MAAI,QAAQ,SAAS,IAAI,EAAG;AAC5B,MAAI,OAAO,SAAS,KAAK,SAAS,WAAW,EAAG;AAChD,MAAI,OAAO,SAAS,KAAK,SAAS,WAAW,EAAG;AAEhD,QAAM,CAAC,MAAM,MAAM,IAAI,YAAY,MAAM,YAAY,OAAO;AAC5D,MAAI,SAAS,UAAU;AACrB,WAAO,IAAI,SAAS,MAAM,KAAK,MAAM,KAAK,UAAU,MAAM,CAAC,CAAC;AAAA,EAC9D,OAAO;AACL,WAAO,IAAI,SAAS,MAAM,KAAK,MAAM,KAAK,UAAU,MAAM,CAAC,CAAC;AAAA,EAC9D;AACF;AAEO,SAAS,cAAc,SAAkB;AAC9C,SAAO,CAAC,EAAE,SAAS,KAAK,MAAwB;AAC9C,QAAI,CAAC,OAAO,KAAK;AACf,cAAQ,KAAK,8BAA8B;AAC3C;AAAA,IACF;AAEA,WAAO,IAAI,QAAQ,SAAS;AAAA,MAC1B,OAAO,SAAS,6BAAM,KAAK;AAAA,MAC3B,aAAa,SAAS,6BAAM,YAAY;AAAA,MACxC,YAAY;AAAA,IACd,CAAC;AAAA,EACH;AACF;","names":[]}
|