gatsby-core-theme 32.0.0 → 32.0.1

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,3 +1,10 @@
1
+ ## [32.0.1](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v32.0.0...v32.0.1) (2024-05-30)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * tracker ([72f0022](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/72f0022e49a21ab9e6a7750a090257aac6058072))
7
+
1
8
  # [32.0.0](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v31.0.2...v32.0.0) (2024-05-28)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "32.0.0",
3
+ "version": "32.0.1",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-nested-ternary */
1
2
  /* eslint-disable no-underscore-dangle */
2
3
  import { generateTrackerLink } from '~helpers/generators';
3
4
 
@@ -90,6 +91,7 @@ export async function getAffiliateLink(operator, path, page, headers, url) {
90
91
  facebook_browser_id: cookie ? cookie._fbp || null : null,
91
92
  facebook_click_id: cookie ? cookie._fbc || null : null,
92
93
  split_test_name: cookie ? cookie.split_test_name || null : null,
94
+ google_client_id: cookie ? cookie._ga || null : null,
93
95
  split_test_variant: cookie ? cookie.split_test_variant || null : null,
94
96
  facebook_pixel_id: process.env.PIXEL_ID || null,
95
97
  ...(isJsonString(cookie.affObject) ? JSON.parse(cookie.affObject) : {}),
@@ -102,7 +104,7 @@ export async function getAffiliateLink(operator, path, page, headers, url) {
102
104
  : {}),
103
105
  ...(extraURLParams || {}),
104
106
  };
105
-
107
+
106
108
  const res = await fetch(
107
109
  `${process.env.GATSBY_TRACKING_API_URL}?${new URLSearchParams(clean(urlParam)).toString()}`
108
110
  ).catch((err) => null);
@@ -115,6 +117,7 @@ export async function getAffiliateLink(operator, path, page, headers, url) {
115
117
 
116
118
  export function getTrackingAPIParams(pageTemplate, module, tracker, clickedElement, url, referer) {
117
119
  const urlParams = {};
120
+ let extraData = {}
118
121
 
119
122
  if (pageTemplate) {
120
123
  urlParams.page_type = pageTemplate;
@@ -137,22 +140,20 @@ export function getTrackingAPIParams(pageTemplate, module, tracker, clickedEleme
137
140
  if (url && url.split('?').length === 2) {
138
141
  // eslint-disable-next-line prefer-destructuring
139
142
  urlParams.request_url = url.split('?')[0];
140
- const extraData = deparam(url.split('?')[1]);
143
+ extraData = deparam(url.split('?')[1]);
141
144
 
142
145
  if (extraData.msclkid) {
143
- urlParams.microsoft_click_id = extraData.msclkid;
144
- }
145
-
146
- if (extraData.brevo_customer_id) {
147
- urlParams.brevo_customer_id = extraData.brevo_customer_id;
146
+ extraData.microsoft_click_id = extraData.msclkid;
147
+ delete extraData.msclkid;
148
148
  }
149
149
 
150
150
  if (extraData.gclid) {
151
- urlParams.google_click_id = extraData.gclid;
151
+ extraData.google_click_id = extraData.gclid;
152
+ delete extraData.gclid;
152
153
  }
153
154
  } else if (url) {
154
155
  urlParams.request_url = url;
155
156
  }
156
-
157
- return urlParams;
157
+
158
+ return {...urlParams, ...extraData};
158
159
  }