gatsby-core-theme 30.0.78 → 30.0.80

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,18 @@
1
+ ## [30.0.80](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.79...v30.0.80) (2024-02-15)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * tracking api new params ([42a9982](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/42a9982b92dfb0588d9bf2f88c4244f5ddcaf2e0))
7
+
8
+ ## [30.0.79](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.78...v30.0.79) (2024-02-14)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * ssr templates ([77416a8](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/77416a8e1fe64b2c03b54247a760f1cd39b20c8c))
14
+ * tracker enable/disable splash screen ([48f71bd](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/48f71bdc79a3f91b7dace240db11675cab046a8d))
15
+
1
16
  ## [30.0.78](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v30.0.77...v30.0.78) (2024-02-12)
2
17
 
3
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "30.0.78",
3
+ "version": "30.0.80",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -29,13 +29,14 @@ const OperatorCtaButton = ({
29
29
  const status = operator?.status || '';
30
30
  const trackerType = tracker?.toLowerCase()?.replace(' ', '_');
31
31
  const url = typeof window !== 'undefined' ? window.location.href : '';
32
+ const referer = typeof document !== 'undefined' && document?.referrer ? document.referrer : '';
32
33
  const prettyLink = `${prettyTracker(operator, trackerType, false, pageTemplate)}`;
33
34
 
34
35
  const onCTAClick = () => {
35
36
  process.env.IS_TRACKING_SSR &&
36
37
  setCookie(
37
38
  'affObject',
38
- JSON.stringify(getTrackingAPIParams(pageTemplate, module, tracker, 'cta', url))
39
+ JSON.stringify(getTrackingAPIParams(pageTemplate, module, tracker, 'cta', url, referer))
39
40
  );
40
41
  };
41
42
 
@@ -15,12 +15,16 @@ const PrettyLink = ({
15
15
  }) => {
16
16
  const prettyLink = prettyTracker(operator, tracker, false, pageTemplate);
17
17
  const url = typeof window !== 'undefined' ? window.location.href : '';
18
+ const referer = typeof document !== 'undefined' && document?.referrer ? document.referrer : '';
19
+
18
20
  const onCTAClick = () => {
19
21
  // eslint-disable-next-line no-unused-expressions
20
22
  process.env.IS_TRACKING_SSR &&
21
23
  setCookie(
22
24
  'affObject',
23
- JSON.stringify(getTrackingAPIParams(pageTemplate, module, tracker, clickedElement, url))
25
+ JSON.stringify(
26
+ getTrackingAPIParams(pageTemplate, module, tracker, clickedElement, url, referer)
27
+ )
24
28
  );
25
29
  };
26
30
 
@@ -28,7 +28,7 @@ const Tracker = ({
28
28
  }) => {
29
29
  const { operator, page, translations } = pageContext;
30
30
  const disableSplashScreen =
31
- Boolean(getExtraField(operator.extra_fields, 'disable_splash_screen')) || false;
31
+ Boolean(Number(getExtraField(operator.extra_fields, 'disable_splash_screen'))) || false;
32
32
  const tracker = getTrackerName(operator, page, path);
33
33
 
34
34
  function redirect() {
@@ -48,8 +48,6 @@ export default {
48
48
  app_ssr: [
49
49
  'event',
50
50
  'tournament',
51
- 'sportstake_fixtures',
52
- 'sportstake_results',
53
- 'lotto',
51
+ 'lotto_results_and_fixtures'
54
52
  ]
55
53
  };
@@ -77,11 +77,11 @@ export async function getAffiliateLink(operator, path, page, headers, url) {
77
77
  tracker_name: trackerName.name,
78
78
  market_short_code: operator.market,
79
79
  ip_address: headers ? headers.get('x-real-ip') || headers.get('host') : '127.0.0.1',
80
- user_agent: headers ? headers.get('user-agent') || headers.get('user-agent') : 'N/A',
81
- user_uuid: cookie ? cookie.affUUID || 'N/A' : 'N/A',
82
- facebook_browser_id: cookie ? cookie._fbp || 'N/A' : 'N/A',
83
- facebook_click_id: cookie ? cookie._fbc || 'N/A' : 'N/A',
84
- facebook_pixel_id: process.env.PIXEL_ID || 'N/A',
80
+ user_agent: headers ? headers.get('user-agent') || headers.get('user-agent') : null,
81
+ user_uuid: cookie ? cookie.affUUID || null : null,
82
+ facebook_browser_id: cookie ? cookie._fbp || null : null,
83
+ facebook_click_id: cookie ? cookie._fbc || null : null,
84
+ facebook_pixel_id: process.env.PIXEL_ID || null,
85
85
  ...(isJsonString(cookie.affObject) ? JSON.parse(cookie.affObject) : {}),
86
86
  ...(extraParams || {}),
87
87
  };
@@ -96,7 +96,7 @@ export async function getAffiliateLink(operator, path, page, headers, url) {
96
96
  };
97
97
  }
98
98
 
99
- export function getTrackingAPIParams(pageTemplate, module, tracker, clickedElement, url) {
99
+ export function getTrackingAPIParams(pageTemplate, module, tracker, clickedElement, url, referer) {
100
100
  const urlParams = {};
101
101
 
102
102
  if (pageTemplate) {
@@ -113,6 +113,10 @@ export function getTrackingAPIParams(pageTemplate, module, tracker, clickedEleme
113
113
  urlParams.clicked_element = clickedElement;
114
114
  }
115
115
 
116
+ if(referer) {
117
+ urlParams.http_referer = referer;
118
+ }
119
+
116
120
  if (url && url.split('?').length === 2) {
117
121
  // eslint-disable-next-line prefer-destructuring
118
122
  urlParams.request_url = url.split('?')[0];
@@ -72,7 +72,7 @@ describe('Tracker Helper', () => {
72
72
  expect(fetch).toBeCalledWith(
73
73
  `${process.env.GATSBY_TRACKING_API_URL}?${new URLSearchParams(
74
74
  urlParam
75
- ).toString()}&user_agent=N%2FA&user_uuid=N%2FA&facebook_browser_id=N%2FA&facebook_click_id=N%2FA&facebook_pixel_id=N%2FA`
75
+ ).toString()}&user_agent=null&user_uuid=null&facebook_browser_id=null&facebook_click_id=null&facebook_pixel_id=null`
76
76
  );
77
77
  });
78
78
 
@@ -87,7 +87,7 @@ describe('Tracker Helper', () => {
87
87
 
88
88
  expect(fetch).toBeCalledTimes(1);
89
89
  expect(fetch).toBeCalledWith(
90
- `testlink?site_id=82&operator_short_name=rizk&operator_type=sportsbook&language=en&tracker_name=main&market_short_code=ie_en&ip_address=127.0.0.1&user_agent=N%2FA&user_uuid=N%2FA&facebook_browser_id=N%2FA&facebook_click_id=N%2FA&facebook_pixel_id=N%2FA&extraparam=val&extraparam2=val2`
90
+ `testlink?site_id=82&operator_short_name=rizk&operator_type=sportsbook&language=en&tracker_name=main&market_short_code=ie_en&ip_address=127.0.0.1&user_agent=null&user_uuid=null&facebook_browser_id=null&facebook_click_id=null&facebook_pixel_id=null&extraparam=val&extraparam2=val2`
91
91
  );
92
92
  });
93
93