aesirx-analytics 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
package/src/analytics.js CHANGED
@@ -125,17 +125,18 @@ const insertParam = (key, value) => {
125
125
 
126
126
  const replaceUrl = () => {
127
127
  const urlParams = new URLSearchParams(window.location.search);
128
- const event_id = urlParams.get('event_id');
129
- const uuid = urlParams.get('uuid');
128
+ const event_uuid = urlParams.get('event_uuid');
129
+ const visitor_uuid = urlParams.get('visitor_uuid');
130
130
 
131
131
  let anchors = document.getElementsByTagName('a');
132
+
132
133
  for (let i = 0; i < anchors.length; i++) {
133
- const eventIdParams = getParameterByName('event_id', anchors[i].href);
134
- const uuidParams = getParameterByName('uuid', anchors[i].href);
134
+ const eventIdParams = getParameterByName('event_uuid', anchors[i].href);
135
+ const visitorIdParams = getParameterByName('visitor_uuid', anchors[i].href);
135
136
  if (anchors[i].href) {
136
137
  const url = new URL(anchors[i].href);
137
- !eventIdParams && event_id && url.searchParams.append('event_id', event_id);
138
- !uuidParams && uuid && url.searchParams.append('uuid', uuid);
138
+ !eventIdParams && event_uuid && url.searchParams.append('event_uuid', event_uuid);
139
+ !visitorIdParams && visitor_uuid && url.searchParams.append('visitor_uuid', visitor_uuid);
139
140
  anchors[i].href = url.href;
140
141
  }
141
142
  }
@@ -26,7 +26,7 @@ const initTracker = async (endpoint, url, referrer, user_agent) => {
26
26
  urlParams.get(key) && attributes.push({ name: key, value: urlParams.get(key) });
27
27
  }
28
28
  }
29
- if (!urlParams.get('event_id') && !urlParams.get('uuid')) {
29
+ if (!urlParams.get('event_uuid') && !urlParams.get('visitor_uuid')) {
30
30
  let ip = '';
31
31
  const response = await trackerService(createRequest(endpoint, 'init'), {
32
32
  url: url,