@formo/analytics 1.8.0 → 1.10.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formo/analytics",
3
- "version": "1.8.0",
3
+ "version": "1.10.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/getformo/sdk.git"
@@ -215,6 +215,8 @@ export class FormoAnalytics implements IFormoAnalytics {
215
215
  }
216
216
 
217
217
  setTimeout(() => {
218
+ const url = new URL(window.location.href);
219
+ const params = new URLSearchParams(url.search);
218
220
  this.trackEvent('page_hit', {
219
221
  'user-agent': window.navigator.userAgent,
220
222
  locale: language,
@@ -222,6 +224,10 @@ export class FormoAnalytics implements IFormoAnalytics {
222
224
  referrer: document.referrer,
223
225
  pathname: window.location.pathname,
224
226
  href: window.location.href,
227
+ utm_source: params.get('utm_source'),
228
+ utm_medium: params.get('utm_medium'),
229
+ utm_campaign: params.get('utm_campaign'),
230
+ ref: params.get('ref'),
225
231
  });
226
232
  }, 300);
227
233
  }