@builder.io/sdk 6.1.2 → 6.1.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @builder.io/sdk
2
2
 
3
+ ## 6.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 3e864ce: fix: incorrect conversion tracking
8
+
3
9
  ## 6.1.2
4
10
 
5
11
  ### Patch Changes
@@ -1052,7 +1052,7 @@
1052
1052
 
1053
1053
  var DEFAULT_API_VERSION = 'v3';
1054
1054
 
1055
- var SDK_VERSION = '6.1.2';
1055
+ var SDK_VERSION = '6.1.3';
1056
1056
 
1057
1057
  function datePlusMinutes(minutes) {
1058
1058
  if (minutes === void 0) { minutes = 30; }
@@ -1210,6 +1210,7 @@
1210
1210
  this.hasOverriddenCanTrack = false;
1211
1211
  this.apiKey$ = new BehaviorSubject(null);
1212
1212
  this.authToken$ = new BehaviorSubject(null);
1213
+ this.contentId$ = new BehaviorSubject(null);
1213
1214
  this.userAttributesChanged = new BehaviorSubject(null);
1214
1215
  this.editingMode$ = new BehaviorSubject(isIframe);
1215
1216
  // TODO: decorator to do this stuff with the get/set (how do with typing too? compiler?)
@@ -1805,7 +1806,21 @@
1805
1806
  }
1806
1807
  var meta = typeof contentId === 'object' ? contentId : customProperties;
1807
1808
  var useContentId = typeof contentId === 'string' ? contentId : undefined;
1808
- this.track('conversion', { amount: amount, variationId: variationId, meta: meta, contentId: useContentId }, context);
1809
+ if (!useContentId && !contentId && this.contentId) {
1810
+ useContentId = this.contentId;
1811
+ }
1812
+ var useVariationId = variationId;
1813
+ if (!useVariationId && useContentId) {
1814
+ useVariationId = this.getTestCookie(useContentId);
1815
+ }
1816
+ this.track('conversion', {
1817
+ amount: amount,
1818
+ variationId: useVariationId && useContentId && useVariationId !== useContentId
1819
+ ? useVariationId
1820
+ : undefined,
1821
+ meta: meta,
1822
+ contentId: useContentId,
1823
+ }, context);
1809
1824
  };
1810
1825
  Object.defineProperty(Builder.prototype, "isDevelopmentEnv", {
1811
1826
  // TODO: set this for QA
@@ -1883,6 +1898,16 @@
1883
1898
  enumerable: false,
1884
1899
  configurable: true
1885
1900
  });
1901
+ Object.defineProperty(Builder.prototype, "contentId", {
1902
+ get: function () {
1903
+ return this.contentId$.value;
1904
+ },
1905
+ set: function (id) {
1906
+ this.contentId$.next(id);
1907
+ },
1908
+ enumerable: false,
1909
+ configurable: true
1910
+ });
1886
1911
  Object.defineProperty(Builder.prototype, "authToken", {
1887
1912
  get: function () {
1888
1913
  return this.authToken$.value;