@blotoutio/edgetag-sdk-browser 0.45.3 → 0.46.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.
Files changed (2) hide show
  1. package/index.js +22 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -11,10 +11,17 @@
11
11
  get init () { return init; },
12
12
  get isNewUser () { return isNewUser; },
13
13
  get keys () { return keys; },
14
+ get setConfig () { return setConfig; },
14
15
  get tag () { return tag; },
15
16
  get user () { return user; }
16
17
  });
17
18
 
19
+ const _config = {};
20
+ const setConfig$1 = (config) => {
21
+ Object.assign(_config, config);
22
+ };
23
+ const getConfig = () => _config;
24
+
18
25
  const getUserAgent = () => {
19
26
  try {
20
27
  const nav = navigator;
@@ -40,10 +47,12 @@
40
47
  };
41
48
  const getPageUrl = () => {
42
49
  try {
50
+ // we need to leave this one in for existing Custom pixel customers
43
51
  if (window.edgetagData && window.edgetagData['pageUrl']) {
44
52
  return window.edgetagData['pageUrl'];
45
53
  }
46
- return window.location.href;
54
+ const { pageUrl } = getConfig();
55
+ return pageUrl || window.location.href;
47
56
  }
48
57
  catch {
49
58
  return '';
@@ -365,7 +374,7 @@
365
374
  referrer: getReferrer(),
366
375
  search: getSearch(),
367
376
  locale: getLocale(),
368
- sdkVersion: "0.45.3" ,
377
+ sdkVersion: "0.46.0" ,
369
378
  ...(payload || {}),
370
379
  };
371
380
  let storage = {};
@@ -1127,6 +1136,10 @@
1127
1136
  });
1128
1137
  };
1129
1138
 
1139
+ const handleConfig = (config) => {
1140
+ setConfig$1(config);
1141
+ };
1142
+
1130
1143
  const init = (preferences) => {
1131
1144
  handleInit(preferences);
1132
1145
  };
@@ -1157,6 +1170,9 @@
1157
1170
  const isNewUser = () => {
1158
1171
  return handleIsNewUser();
1159
1172
  };
1173
+ const setConfig = (config) => {
1174
+ return handleConfig(config);
1175
+ };
1160
1176
 
1161
1177
  // TODO https://github.com/blotoutio/solutions/issues/826
1162
1178
 
@@ -1200,6 +1216,10 @@
1200
1216
  isNewUser() {
1201
1217
  return isNewUser()
1202
1218
  }
1219
+
1220
+ setConfig(config) {
1221
+ return setConfig()
1222
+ }
1203
1223
  }
1204
1224
 
1205
1225
  var api = new API();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blotoutio/edgetag-sdk-browser",
3
- "version": "0.45.3",
3
+ "version": "0.46.0",
4
4
  "description": "Browser SDK for EdgeTag",
5
5
  "author": "Blotout",
6
6
  "license": "MIT",