@brainfish-ai/web-tracker 0.0.4-alpha.17 → 0.0.4-alpha.19
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/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -18,7 +18,7 @@ export type TrackerOptions = TrackerSdkOptions & {
|
|
|
18
18
|
|
|
19
19
|
function toCamelCase(str: string) {
|
|
20
20
|
return str.replace(/([-_][a-z])/gi, ($1) =>
|
|
21
|
-
$1.toUpperCase().replace('-', '').replace('_', '')
|
|
21
|
+
$1.toUpperCase().replace('-', '').replace('_', '')
|
|
22
22
|
);
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -135,8 +135,8 @@ export class Tracker extends TrackerSdk {
|
|
|
135
135
|
const element = btn?.getAttribute('data-track')
|
|
136
136
|
? btn
|
|
137
137
|
: anchor?.getAttribute('data-track')
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
? anchor
|
|
139
|
+
: null;
|
|
140
140
|
if (element) {
|
|
141
141
|
const properties: Record<string, unknown> = {};
|
|
142
142
|
for (const attr of element.attributes) {
|
|
@@ -157,7 +157,7 @@ export class Tracker extends TrackerSdk {
|
|
|
157
157
|
async screenView(path: string, properties?: TrackProperties): Promise<void>;
|
|
158
158
|
async screenView(
|
|
159
159
|
pathOrProperties?: string | TrackProperties,
|
|
160
|
-
propertiesOrUndefined?: TrackProperties
|
|
160
|
+
propertiesOrUndefined?: TrackProperties
|
|
161
161
|
): Promise<void> {
|
|
162
162
|
if (this.isServer()) {
|
|
163
163
|
return;
|
|
@@ -184,7 +184,7 @@ export class Tracker extends TrackerSdk {
|
|
|
184
184
|
this.lastPath = path;
|
|
185
185
|
super.track('screen_view', {
|
|
186
186
|
...(properties ?? {}),
|
|
187
|
-
|
|
187
|
+
__screenshot: snapshot,
|
|
188
188
|
__path: path,
|
|
189
189
|
__title: document.title,
|
|
190
190
|
});
|