gatsby-core-theme 41.0.1 → 41.0.2

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 (25) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/package.json +1 -1
  3. package/src/components/atoms/button/operator-cta.js +21 -23
  4. package/src/components/atoms/button/operator-cta.test.js +1 -1
  5. package/src/components/atoms/header-operator-bannner/index.js +7 -3
  6. package/src/components/atoms/menu/mega-items/index.js +2 -1
  7. package/src/components/atoms/operator-info-block/index.js +3 -1
  8. package/src/components/atoms/pretty-link/index.js +4 -4
  9. package/src/components/atoms/pretty-link/pretty-link.test.js +1 -1
  10. package/src/components/atoms/search/autocomplete/operator.js +1 -1
  11. package/src/components/molecules/bonus/template-one/index.js +7 -6
  12. package/src/components/molecules/bonus/template-two/index.js +7 -6
  13. package/src/components/molecules/bonus-box/template-one/index.js +6 -4
  14. package/src/components/molecules/bonus-box/template-three/index.js +16 -12
  15. package/src/components/molecules/bonus-box/template-two/index.js +8 -5
  16. package/src/components/molecules/floating-area/index.js +2 -3
  17. package/src/components/molecules/header/variants/operator/template-one-two/index.js +13 -14
  18. package/src/components/molecules/header/variants/slot/template-one/index.js +5 -0
  19. package/src/components/molecules/toplist/default-row/index.js +5 -6
  20. package/src/components/molecules/toplist/header/index.js +5 -3
  21. package/src/components/organisms/toplist/index.js +11 -3
  22. package/src/components/organisms/toplist/list/index.js +3 -3
  23. package/src/constants/tracking-api.js +28 -0
  24. package/src/helpers/replaceMedia.js +5 -4
  25. package/src/helpers/replaceMedia.test.js +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ ## [41.0.2](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v41.0.1...v41.0.2) (2024-12-02)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * final version ([96d0d7f](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/96d0d7f278efded38fb063e7361853e7eeb09c07))
7
+ * mega menu toplist tracking ([5f35781](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/5f35781e8baf2a0399660fecef38e26f84ea9437))
8
+ * test ([ed32443](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/ed324433cfcd7b9342445ac640cd02d3b94e33e6))
9
+ * toplist tracking ([12448d0](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/12448d084e100cdb09c34e095eebb24e3c00209d))
10
+ * tracking api ([e93219b](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/e93219ba5cf0b7da59040b5d4964ddae387a7bb4))
11
+ * tracking-api ([90d4766](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/90d4766ea66d8636dd559dfef169a6955745cc70))
12
+
13
+
14
+ * Merge branch 'tracking-api' into 'master' ([418bf11](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/418bf11d49c85494727ee741a3e7fc1f080ac725))
15
+
1
16
  ## [41.0.1](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v41.0.0...v41.0.1) (2024-11-29)
2
17
 
3
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "41.0.1",
3
+ "version": "41.0.2",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -16,7 +16,8 @@ const OperatorCtaButton = ({
16
16
  gtmClass = '',
17
17
  buttonType = 'primary',
18
18
  buttonSize = '',
19
- module = null,
19
+ moduleName = null,
20
+ clickedElement="cta",
20
21
  tracker = 'main',
21
22
  titleSuffix,
22
23
  icon = null,
@@ -46,28 +47,28 @@ const OperatorCtaButton = ({
46
47
  typeof document !== 'undefined' && document?.referrer
47
48
  ? document.referrer
48
49
  : '';
49
-
50
+
50
51
  const prettyLink = `${prettyTracker(
51
52
  operator,
52
53
  trackerType,
53
54
  false
54
55
  )}`
55
-
56
+
56
57
  const translateBtn =
57
58
  status && translationsObj[status]
58
59
  ? // eslint-disable-next-line react-hooks/rules-of-hooks
59
- useTranslate(
60
- translationsObj[status]?.translationKey,
61
- translationsObj[status]?.defaultValue || ''
62
- )
60
+ useTranslate(
61
+ translationsObj[status]?.translationKey,
62
+ translationsObj[status]?.defaultValue || ''
63
+ )
63
64
  : 'Claim'
64
65
 
65
66
  const affObject = JSON.stringify(
66
67
  getTrackingAPIParams(
67
68
  pageTemplate,
68
- module,
69
+ moduleName,
69
70
  tracker,
70
- 'cta',
71
+ clickedElement,
71
72
  globalHistory.location.href,
72
73
  referer,
73
74
  modulePosition,
@@ -90,21 +91,18 @@ const OperatorCtaButton = ({
90
91
  }
91
92
  }
92
93
 
93
- const classes = `${styles[buttonType] || ''} ${status && styles[status] ? styles[status] : ''} ${
94
- buttonSize ? styles[`${buttonSize}_size`] : ''
95
- } `;
94
+ const classes = `${styles[buttonType] || ''} ${status && styles[status] ? styles[status] : ''} ${buttonSize ? styles[`${buttonSize}_size`] : ''
95
+ } `;
96
96
 
97
97
  return (
98
98
  trackerLinkActive(operator, tracker) &&
99
99
  (status === "active" ? (
100
100
  <a
101
- href={prettyLink || "#"}
102
- title={`${typeof translateBtn === "string" ? translateBtn : ""} ${
103
- titleSuffix || ""
104
- }`.trimEnd()}
105
- aria-label={`${typeof translateBtn === 'string' ? translateBtn : ''} ${
106
- titleSuffix || ''
107
- }`.trimEnd()}
101
+ href={prettyLink || "#"}
102
+ title={`${typeof translateBtn === "string" ? translateBtn : ""} ${titleSuffix || ""
103
+ }`.trimEnd()}
104
+ aria-label={`${typeof translateBtn === 'string' ? translateBtn : ''} ${titleSuffix || ''
105
+ }`.trimEnd()}
108
106
  className={`${classes} ${gtmClass}`}
109
107
  target="_blank"
110
108
  rel={rel}
@@ -115,9 +113,8 @@ const OperatorCtaButton = ({
115
113
  </a>
116
114
  ) : (
117
115
  <div
118
- title={`${typeof translateBtn === 'string' ? translateBtn : ''} ${
119
- titleSuffix || ''
120
- }`.trimEnd()}
116
+ title={`${typeof translateBtn === 'string' ? translateBtn : ''} ${titleSuffix || ''
117
+ }`.trimEnd()}
121
118
  className={`${classes || ''} ${gtmClass || ''}`}
122
119
  >
123
120
  {translateBtn}
@@ -139,7 +136,8 @@ OperatorCtaButton.propTypes = {
139
136
  buttonSize: PropTypes.string,
140
137
  buttonType: PropTypes.string,
141
138
  tracker: PropTypes.string,
142
- module: PropTypes.string,
139
+ moduleName: PropTypes.string,
140
+ clickedElement: PropTypes.string,
143
141
  translationsObj: PropTypes.shape({
144
142
  active: PropTypes.shape({
145
143
  translationKey: PropTypes.string,
@@ -75,7 +75,7 @@ describe('OperatorCtaButton Component', () => {
75
75
  writable: true, // possibility to override
76
76
  });
77
77
  const { container } = render(
78
- <OperatorCtaButton {...data()} pageTemplate="test" module="test2" tracker="testing" />
78
+ <OperatorCtaButton {...data()} pageTemplate="test" moduleName="test2" tracker="testing" />
79
79
  );
80
80
  const button = container.querySelector('a');
81
81
  if (button) {
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types'
3
3
  import LazyImage from '~hooks/lazy-image'
4
4
  import useTranslate from '~hooks/useTranslate/useTranslate'
5
5
  import Bonus from '~molecules/bonus-box/template-three'
6
+ import { TrackingKeys } from '~constants/tracking-api'
6
7
  import { getAltText, imagePrettyUrl } from '~helpers/getters'
7
8
 
8
9
  import styles from './header-operator-bannner.module.scss'
@@ -12,7 +13,8 @@ const HeaderOperatorBaner = ({
12
13
  logo,
13
14
  buttonType = 'primary',
14
15
  template,
15
- module = 'header_operator_banner',
16
+ moduleName = TrackingKeys?.OPERATORBANNER,
17
+ clickedElement = 'header_operator_banner',
16
18
  width = '64',
17
19
  height = '64',
18
20
  modulePosition,
@@ -38,7 +40,8 @@ const HeaderOperatorBaner = ({
38
40
  main = (
39
41
  <>
40
42
  <Bonus
41
- module={module}
43
+ moduleName={moduleName}
44
+ clickedElement={clickedElement}
42
45
  ctaBtn
43
46
  item={operator}
44
47
  tracker="main"
@@ -92,7 +95,8 @@ HeaderOperatorBaner.propTypes = {
92
95
  }),
93
96
  template: PropTypes.string,
94
97
  buttonType: PropTypes.string,
95
- module: PropTypes.string,
98
+ moduleName: PropTypes.string,
99
+ clickedElement: PropTypes.string,
96
100
  width: PropTypes.string,
97
101
  height: PropTypes.string,
98
102
  modulePosition: PropTypes.number,
@@ -7,6 +7,7 @@ import Item from "../items/item";
7
7
  import Toplist from "~molecules/toplist/header";
8
8
  import { Context } from "~context/MainProvider.js";
9
9
  import { getPositionClass } from "~helpers/menu";
10
+ import { TrackingKeys } from '~constants/tracking-api'
10
11
  import { isMobileDevice } from "~helpers/device-detect";
11
12
 
12
13
  // Test included with menu molecule test
@@ -70,7 +71,7 @@ const Items = ({ item, gtmClass = "", level = 1, toplist }) => {
70
71
  ))}
71
72
  </ul>
72
73
 
73
- {toplist && <Toplist module={toplist} limit={4} />}
74
+ {toplist && <Toplist module={toplist} limit={4} moduleName={TrackingKeys?.NAVIGATIONTOPLIST} />}
74
75
  </div>
75
76
  </div>
76
77
  )}
@@ -4,6 +4,8 @@ import React from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import PrettyLink from '~atoms/pretty-link';
6
6
  import styles from './operator-info-block.module.scss';
7
+ import { TrackingKeys } from '~constants/tracking-api'
8
+
7
9
  import keygen from '~helpers/keygen';
8
10
 
9
11
  const OperatorInfoBlock = ({ page, modulePosition }) => {
@@ -30,7 +32,7 @@ const OperatorInfoBlock = ({ page, modulePosition }) => {
30
32
  <PrettyLink
31
33
  operator={item}
32
34
  pageTemplate={page.template}
33
- module="operator_info_block"
35
+ moduleName={TrackingKeys?.INFOGRID}
34
36
  tracker="main"
35
37
  clickedElement="operator_name"
36
38
  className="operator-info-block-gtm"
@@ -11,12 +11,12 @@ const PrettyLink = ({
11
11
  operator,
12
12
  directPrettyLink = null,
13
13
  pageTemplate,
14
- module,
14
+ moduleName,
15
15
  tracker,
16
16
  titleSuffix,
17
17
  className,
18
18
  children,
19
- clickedElement = 'cta',
19
+ clickedElement = 'prettyLink',
20
20
  rel = 'nofollow sponsored',
21
21
  modulePosition,
22
22
  itemPosition
@@ -30,7 +30,7 @@ const PrettyLink = ({
30
30
  const affObject = JSON.stringify(
31
31
  getTrackingAPIParams(
32
32
  pageTemplate,
33
- module,
33
+ moduleName,
34
34
  tracker,
35
35
  clickedElement,
36
36
  globalHistory.location.href,
@@ -93,7 +93,7 @@ PrettyLink.propTypes = {
93
93
  }),
94
94
  directPrettyLink: PropTypes.string,
95
95
  pageTemplate: PropTypes.string,
96
- module: PropTypes.string,
96
+ moduleName: PropTypes.string,
97
97
  titleSuffix: PropTypes.string,
98
98
  tracker: PropTypes.string,
99
99
  className: PropTypes.string,
@@ -32,7 +32,7 @@ describe('PrettyLink Component', () => {
32
32
  <PrettyLink
33
33
  {...data()}
34
34
  pageTemplate="test"
35
- module="test2"
35
+ moduleName="test2"
36
36
  tracker="testing"
37
37
  clickedElement="cta"
38
38
  />
@@ -19,7 +19,7 @@ const Operator = ({ item = {}, width = '56', height = '56' }) => {
19
19
  alt={item.title}
20
20
  />
21
21
  <h3>{item.title}</h3>
22
- <OperatorCta module="search" operator={relation} gtmClass="toplist-operator-cta-gtm" />
22
+ <OperatorCta moduleName="search_autocomplete" operator={relation} gtmClass="toplist-operator-cta-gtm" />
23
23
  </div>
24
24
  );
25
25
  };
@@ -8,14 +8,14 @@ import OperatorCta from "~atoms/button/operator-cta";
8
8
  import Rating from "~molecules/star-rating/one-star";
9
9
  import Tnc from "~molecules/tnc";
10
10
  import PrettyLink from "~atoms/pretty-link";
11
+ import { TrackingKeys } from '~constants/tracking-api'
11
12
  import styles from "./bonus.module.scss";
12
13
 
13
14
  export default function Bonus({
14
15
  operator,
15
16
  pageTemplate,
16
- module = {
17
- name: "bonus",
18
- },
17
+ moduleName = TrackingKeys?.BONUS,
18
+ module = {},
19
19
  tncFixed = false,
20
20
  width = "120",
21
21
  height = "120",
@@ -30,7 +30,7 @@ export default function Bonus({
30
30
  <PrettyLink
31
31
  operator={operator}
32
32
  pageTemplate={pageTemplate}
33
- module={module.name}
33
+ moduleName={moduleName}
34
34
  tracker={module?.tracking_link_name || "main"}
35
35
  clickedElement="operator_logo"
36
36
  className={`${styles.logo || ""} operator-banner-gtm logo-cta`}
@@ -58,7 +58,7 @@ export default function Bonus({
58
58
  <div className={styles.bonus || ""}>
59
59
  <BonusBox
60
60
  item={operator}
61
- module={module.name}
61
+ moduleName={moduleName}
62
62
  pageTemplate={pageTemplate}
63
63
  tracker={module?.type || "main"}
64
64
  modulePosition={modulePosition}
@@ -69,7 +69,7 @@ export default function Bonus({
69
69
  operator={operator}
70
70
  pageTemplate={pageTemplate}
71
71
  tracker={module?.tracking_link_name || "main"}
72
- module={module.name}
72
+ moduleName={moduleName}
73
73
  icon={
74
74
  <FaArrowRight fontSize={20} title="Right-pointing Arrow Icon" />
75
75
  }
@@ -98,6 +98,7 @@ Bonus.propTypes = {
98
98
  }),
99
99
  tncFixed: PropTypes.bool,
100
100
  pageTemplate: PropTypes.string,
101
+ moduleName: PropTypes.string,
101
102
  module: PropTypes.shape({
102
103
  tracking_link_name: PropTypes.string,
103
104
  type: PropTypes.string,
@@ -11,14 +11,14 @@ import Rating from "~molecules/star-rating/one-star";
11
11
  import Tnc from "~molecules/tnc";
12
12
  import PrettyLink from "~atoms/pretty-link";
13
13
  import useTranslate from "~hooks/useTranslate/useTranslate";
14
+ import { TrackingKeys } from '~constants/tracking-api'
14
15
  import styles from "./bonus.module.scss";
15
16
 
16
17
  export default function TemplateOne({
17
18
  operator,
18
19
  pageTemplate,
19
- module = {
20
- name: "bonus",
21
- },
20
+ moduleName = TrackingKeys?.BONUS,
21
+ module = {},
22
22
  tncFixed = false,
23
23
  showWelcomeText = true,
24
24
  floating = false,
@@ -53,7 +53,7 @@ export default function TemplateOne({
53
53
  <PrettyLink
54
54
  operator={operator}
55
55
  pageTemplate={pageTemplate}
56
- module={module.name}
56
+ moduleName={moduleName}
57
57
  tracker={module?.tracking_link_name || "main"}
58
58
  clickedElement="operator_logo"
59
59
  className={`${styles.logo || ""} operator-banner-gtm logo-cta`}
@@ -83,14 +83,14 @@ export default function TemplateOne({
83
83
  <p className={styles.welcomeBonus}>{welcomeBonusText}</p>
84
84
  )}
85
85
 
86
- <BonusBox module={module.name} item={operator} tracker={module?.type || "main"} pageTemplate={pageTemplate} />
86
+ <BonusBox moduleName={moduleName} item={operator} tracker={module?.type || "main"} pageTemplate={pageTemplate} />
87
87
  {!tncFixed && <Tnc isFixed={tncFixed} operator={operator} />}
88
88
  </div>
89
89
  </div>
90
90
 
91
91
  <OperatorCta
92
92
  operator={operator}
93
- module={module.name}
93
+ moduleName={moduleName}
94
94
  pageTemplate={pageTemplate}
95
95
  tracker={module?.tracking_link_name || "main"}
96
96
  icon={
@@ -136,6 +136,7 @@ TemplateOne.propTypes = {
136
136
  type: PropTypes.string,
137
137
  name: PropTypes.string,
138
138
  }),
139
+ moduleName: PropTypes.string,
139
140
  width: PropTypes.string,
140
141
  height: PropTypes.string,
141
142
  showRoundedRating: PropTypes.bool,
@@ -10,7 +10,8 @@ export default function BonusBox({
10
10
  pageTemplate = null,
11
11
  splitBy = '+',
12
12
  feSeparator = '+',
13
- module = 'bonus_box',
13
+ moduleName = null,
14
+ clickedElement = "bonusBox",
14
15
  titleSuffix,
15
16
  modulePosition,
16
17
  itemPosition
@@ -21,10 +22,10 @@ export default function BonusBox({
21
22
  <PrettyLink
22
23
  operator={item}
23
24
  pageTemplate={pageTemplate}
24
- module={module}
25
+ moduleName={moduleName}
25
26
  tracker={tracker}
26
27
  titleSuffix={titleSuffix}
27
- clickedElement="oneliner"
28
+ clickedElement={clickedElement}
28
29
  className={`${styles.detailsBox} ${'bonus-box-gtm'}`}
29
30
  modulePosition={modulePosition}
30
31
  itemPosition={itemPosition}
@@ -43,7 +44,8 @@ BonusBox.propTypes = {
43
44
  pageTemplate: PropTypes.string,
44
45
  splitBy: PropTypes.string,
45
46
  feSeparator: PropTypes.string,
46
- module: PropTypes.string,
47
+ moduleName: PropTypes.string,
48
+ clickedElement: PropTypes.string,
47
49
  titleSuffix: PropTypes.string,
48
50
  modulePosition: PropTypes.number,
49
51
  itemPosition: PropTypes.number,
@@ -18,7 +18,8 @@ export default function BonusBox({
18
18
  splitBy = '+',
19
19
  feSeparator = '+',
20
20
  buttonType = 'primary',
21
- module = 'bonus_box',
21
+ moduleName = null,
22
+ clickedElement = "bonusBox",
22
23
  titleSuffix,
23
24
  modulePosition,
24
25
  itemPosition
@@ -30,10 +31,10 @@ export default function BonusBox({
30
31
  <PrettyLink
31
32
  operator={item}
32
33
  pageTemplate={pageTemplate}
33
- module={module}
34
+ moduleName={moduleName}
34
35
  tracker={tracker}
35
36
  titleSuffix={titleSuffix}
36
- clickedElement="oneliner"
37
+ clickedElement={clickedElement}
37
38
  className={`${styles.detailsBox} ${'bonus-box-gtm'}`}
38
39
  modulePosition={modulePosition}
39
40
  itemPosition={itemPosition}
@@ -52,9 +53,8 @@ export default function BonusBox({
52
53
 
53
54
  return (
54
55
  <div
55
- className={`${styles.bonusBox} ${
56
- showVariablesComponent ? styles.includeVariableComponent : ''
57
- }`}
56
+ className={`${styles.bonusBox} ${showVariablesComponent ? styles.includeVariableComponent : ''
57
+ }`}
58
58
  >
59
59
  {!showVariablesComponent ? (
60
60
  <>
@@ -63,7 +63,8 @@ export default function BonusBox({
63
63
  <CtaButton
64
64
  operator={item}
65
65
  buttonType={buttonType}
66
- module={module}
66
+ moduleName={moduleName}
67
+ clickedElement={`${clickedElement}_cta`}
67
68
  modulePosition={modulePosition}
68
69
  itemPosition={itemPosition}
69
70
  />
@@ -76,7 +77,8 @@ export default function BonusBox({
76
77
  <CtaButton
77
78
  operator={item}
78
79
  buttonType={buttonType}
79
- module={module}
80
+ moduleName={moduleName}
81
+ clickedElement={`${clickedElement}_cta`}
80
82
  modulePosition={modulePosition}
81
83
  itemPosition={itemPosition}
82
84
  />
@@ -84,7 +86,8 @@ export default function BonusBox({
84
86
  {showVariablesComponent && variableInsideContainer && (
85
87
  <VariableComponent
86
88
  item={item}
87
- module={module}
89
+ moduleName={moduleName}
90
+ clickedElement={`${clickedElement}_cta`}
88
91
  modulePosition={modulePosition}
89
92
  itemPosition={itemPosition}
90
93
  />
@@ -93,8 +96,8 @@ export default function BonusBox({
93
96
  )}
94
97
 
95
98
  {showVariablesComponent && !variableInsideContainer && (
96
- <VariableComponent item={item} modulePosition={modulePosition}
97
- itemPosition={itemPosition} />
99
+ <VariableComponent item={item} moduleName={moduleName} modulePosition={modulePosition}
100
+ itemPosition={itemPosition} clickedElement={clickedElement} />
98
101
  )}
99
102
  </div>
100
103
  )
@@ -111,7 +114,8 @@ BonusBox.propTypes = {
111
114
  feSeparator: PropTypes.string,
112
115
  buttonType: PropTypes.string,
113
116
  variableInsideContainer: PropTypes.bool,
114
- module: PropTypes.string,
117
+ moduleName: PropTypes.string,
118
+ clickedElement: PropTypes.string,
115
119
  titleSuffix: PropTypes.string,
116
120
  modulePosition: PropTypes.number,
117
121
  itemPosition: PropTypes.number,
@@ -13,7 +13,8 @@ export default function BonusBox({
13
13
  splitBy = '+',
14
14
  feSeparator = '+',
15
15
  buttonType = 'primary',
16
- module = 'bonus_box',
16
+ moduleName = null,
17
+ clickedElement = "bonusBox",
17
18
  titleSuffix,
18
19
  modulePosition,
19
20
  itemPosition
@@ -25,10 +26,10 @@ export default function BonusBox({
25
26
  <PrettyLink
26
27
  operator={item}
27
28
  pageTemplate={pageTemplate}
28
- module={module}
29
+ moduleName={moduleName}
29
30
  tracker={tracker}
30
31
  titleSuffix={titleSuffix}
31
- clickedElement="oneliner"
32
+ clickedElement={clickedElement}
32
33
  className={`${styles.detailsBox} ${'bonus-box-gtm'}`}
33
34
  modulePosition={modulePosition}
34
35
  itemPosition={itemPosition}
@@ -43,7 +44,8 @@ export default function BonusBox({
43
44
  operator={item}
44
45
  icon={<FaArrowRight title="Right-pointing Arrow Icon" />}
45
46
  buttonType={buttonType}
46
- module={module}
47
+ moduleName={moduleName}
48
+ clickedElement={`${clickedElement}_cta`}
47
49
  modulePosition={modulePosition}
48
50
  itemPosition={itemPosition}
49
51
  />
@@ -58,7 +60,8 @@ BonusBox.propTypes = {
58
60
  splitBy: PropTypes.string,
59
61
  feSeparator: PropTypes.string,
60
62
  buttonType: PropTypes.string,
61
- module: PropTypes.string,
63
+ moduleName: PropTypes.string,
64
+ clickedElement: PropTypes.string,
62
65
  titleSuffix: PropTypes.string,
63
66
  modulePosition: PropTypes.number,
64
67
  itemPosition: PropTypes.number,
@@ -6,6 +6,7 @@ import PropTypes from 'prop-types';
6
6
  import ScrollToTop from '~atoms/scroll-to-top';
7
7
  import CookieConsent from '~organisms/cookie-consent';
8
8
  import isSticky from '~hooks/stickyOnScroll';
9
+ import { TrackingKeys } from '~constants/tracking-api'
9
10
  import styles from './floating-area.module.scss';
10
11
 
11
12
  export default function FloatingArea({
@@ -46,9 +47,7 @@ export default function FloatingArea({
46
47
  <OperatorBanner
47
48
  type={pageType}
48
49
  pageTemplate={template}
49
- module={{
50
- name: 'bonus',
51
- }}
50
+ moduleName={TrackingKeys?.BONUS}
52
51
  sticky
53
52
  logo={pageContext.page.relation.logo_url}
54
53
  operator={pageContext.page.relation}
@@ -11,6 +11,7 @@ import Rating from '../../../../../atoms/ratings';
11
11
  import OperatorBanner from '../../../../../atoms/header-operator-bannner';
12
12
  import VariableComponent from '../variables';
13
13
  import styles from './template-one-two.module.scss';
14
+ import { TrackingKeys } from '~constants/tracking-api'
14
15
  import PrettyLink from '~atoms/pretty-link';
15
16
 
16
17
  const TemplateOneTwo = ({
@@ -23,6 +24,7 @@ const TemplateOneTwo = ({
23
24
  numOfStars = 5,
24
25
  icon,
25
26
  hasVariableComponent = false,
27
+ moduleName = TrackingKeys?.HEADEROPERATOR,
26
28
  template = 'template_one',
27
29
  showRoundedRating = false,
28
30
  width = '179',
@@ -34,7 +36,7 @@ const TemplateOneTwo = ({
34
36
  <PrettyLink
35
37
  operator={relation}
36
38
  pageTemplate={pageTemplate}
37
- module="header_operator_logo"
39
+ moduleName={moduleName}
38
40
  tracker="main"
39
41
  clickedElement="operator_logo"
40
42
  className="header-gtm logo-cta "
@@ -53,20 +55,17 @@ const TemplateOneTwo = ({
53
55
 
54
56
  return (
55
57
  <div
56
- className={`${styles.container} ${
57
- template === 'template_two' && styles.templateTwoContainer
58
- } ${hasVariableComponent ? styles.hasVariableComponent : ''}`}
58
+ className={`${styles.container} ${template === 'template_two' && styles.templateTwoContainer
59
+ } ${hasVariableComponent ? styles.hasVariableComponent : ''}`}
59
60
  >
60
61
  <div
61
- className={`${styles.topSection} ${
62
- template === 'template_two' && styles.templateTwoTopSection
63
- }`}
62
+ className={`${styles.topSection} ${template === 'template_two' && styles.templateTwoTopSection
63
+ }`}
64
64
  >
65
65
  {logo()}
66
66
  <div
67
- className={`${styles.topContent} ${
68
- template === 'template_two' && styles.templateTwoTopContent
69
- }`}
67
+ className={`${styles.topContent} ${template === 'template_two' && styles.templateTwoTopContent
68
+ }`}
70
69
  >
71
70
  <div className={styles.name}>
72
71
  <h1>{name}</h1>
@@ -74,9 +73,8 @@ const TemplateOneTwo = ({
74
73
  </div>
75
74
  {ribbon && (
76
75
  <p
77
- className={`${styles.ribbon} ${
78
- template === 'template_two' && styles.templateTwoRibbon
79
- }`}
76
+ className={`${styles.ribbon} ${template === 'template_two' && styles.templateTwoRibbon
77
+ }`}
80
78
  >
81
79
  {ribbon}
82
80
  </p>
@@ -107,7 +105,7 @@ const TemplateOneTwo = ({
107
105
  />
108
106
  )}
109
107
 
110
- <OperatorBanner logo={image} operator={relation} template={pageTemplate} />
108
+ <OperatorBanner clickedElement="header_operator_banner" moduleName={moduleName} logo={image} operator={relation} template={pageTemplate} />
111
109
  </div>
112
110
  );
113
111
  };
@@ -134,6 +132,7 @@ TemplateOneTwo.propTypes = {
134
132
  showRoundedRating: PropTypes.bool,
135
133
  width: PropTypes.string,
136
134
  height: PropTypes.string,
135
+ moduleName: PropTypes.string,
137
136
  };
138
137
 
139
138
  export default TemplateOneTwo;
@@ -6,10 +6,12 @@ import { imagePrettyUrl, getAltText } from 'gatsby-core-theme/src/helpers/getter
6
6
  import OperatorBanner from 'gatsby-core-theme/src/components/atoms/header-operator-bannner';
7
7
  import Rating from 'gatsby-core-theme/src/components/atoms/ratings';
8
8
  import Verify from '~images/icons/verify';
9
+ import { TrackingKeys } from '~constants/tracking-api'
9
10
  import styles from './slot.module.scss';
10
11
 
11
12
  export default function SlotHeader({
12
13
  page,
14
+ moduleName = TrackingKeys?.HEADERSLOTS,
13
15
  image = <Verify />,
14
16
  showExtraRatings = false,
15
17
  width = '170',
@@ -53,6 +55,8 @@ export default function SlotHeader({
53
55
  )}
54
56
  {headerBonus && (
55
57
  <OperatorBanner
58
+ moduleName={moduleName}
59
+ clickedElement="header_operator_banner"
56
60
  logo={headerBonus?.value?.logo}
57
61
  operator={headerBonus?.value}
58
62
  template={page?.template}
@@ -99,6 +103,7 @@ SlotHeader.propTypes = {
99
103
  }),
100
104
  image: PropTypes.element,
101
105
  showExtraRatings: PropTypes.bool,
106
+ moduleName: PropTypes.string,
102
107
  width: PropTypes.string,
103
108
  height: PropTypes.string,
104
109
  };
@@ -9,6 +9,7 @@ import PrettyLink from '~atoms/pretty-link'
9
9
  import OperatorCta from '~atoms/button/operator-cta'
10
10
  import { imagePrettyUrl, getAltText } from '~helpers/getters'
11
11
  import LazyImage from '~hooks/lazy-image'
12
+ import { TrackingKeys } from '~constants/tracking-api'
12
13
 
13
14
  import styles from './default-row.module.scss'
14
15
 
@@ -22,7 +23,7 @@ const Row = ({
22
23
  index,
23
24
  className,
24
25
  nofollow = false,
25
- module = "top_list",
26
+ moduleName = TrackingKeys?.TOPLIST,
26
27
  width = '100',
27
28
  height = '100',
28
29
  modulePosition,
@@ -50,7 +51,7 @@ const Row = ({
50
51
  <PrettyLink
51
52
  operator={item}
52
53
  pageTemplate={pageTemplate}
53
- module={module}
54
+ moduleName={moduleName}
54
55
  tracker={tracker}
55
56
  clickedElement="operator_logo"
56
57
  className={`casinos-top-list-gtm logo-cta ${styles.logo}`}
@@ -65,8 +66,7 @@ const Row = ({
65
66
  />
66
67
  </PrettyLink>
67
68
  <Bonus
68
- module={module}
69
- clickedElement='oneliner'
69
+ moduleName={moduleName}
70
70
  item={item}
71
71
  tracker={item.toplist_bonus || oneliner}
72
72
  modulePosition={modulePosition}
@@ -87,7 +87,7 @@ const Row = ({
87
87
  tracker={tracker}
88
88
  gtmClass="toplist-operator-cta-gtm"
89
89
  pageTemplate={pageTemplate}
90
- module={module}
90
+ moduleName={moduleName}
91
91
  modulePosition={modulePosition}
92
92
  itemPosition={itemPosition}
93
93
  />
@@ -99,7 +99,6 @@ Row.propTypes = {
99
99
  oneliner: PropTypes.string,
100
100
  layout: PropTypes.string,
101
101
  tracker: PropTypes.string,
102
- module: PropTypes.string,
103
102
  item: PropTypes.shape({
104
103
  name: PropTypes.string,
105
104
  ribbons: PropTypes.arrayOf(PropTypes.string),
@@ -5,9 +5,10 @@ import keygen from "~helpers/keygen";
5
5
  import { imagePrettyUrl, getAltText } from "~helpers/getters";
6
6
  import OperatorCta from "~atoms/button/operator-cta";
7
7
  import StarRating from "~molecules/star-rating";
8
+ import { TrackingKeys } from '~constants/tracking-api'
8
9
  import styles from "./header-toplist.module.scss";
9
10
 
10
- const HeaderToplist = ({ module, limit = null }) => {
11
+ const HeaderToplist = ({ module, limit = null, moduleName = TrackingKeys?.HEADER?.TOPLIST }) => {
11
12
  const items = module?.items.length > 0 && module.items[0];
12
13
  const title = module?.module_title;
13
14
  items.items = limit ? items.items.slice(0, limit) : items.items;
@@ -34,7 +35,7 @@ const HeaderToplist = ({ module, limit = null }) => {
34
35
  buttonSize="s"
35
36
  tracker={items.tracker}
36
37
  gtmClass="toplist-header-cta-gtm"
37
- module="header_toplist"
38
+ moduleName={moduleName}
38
39
  />
39
40
  </li>
40
41
  ))}
@@ -49,7 +50,8 @@ HeaderToplist.propTypes = {
49
50
  items: PropTypes.arrayOf(PropTypes.shape({})),
50
51
  module_title: PropTypes.string,
51
52
  }),
52
- limit: PropTypes.number
53
+ limit: PropTypes.number,
54
+ moduleName: PropTypes.string,
53
55
  };
54
56
 
55
57
  export default HeaderToplist;
@@ -1,12 +1,18 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
-
3
+ import { TrackingKeys } from '~constants/tracking-api'
4
4
  import keygen from '~helpers/keygen';
5
5
  import Tabs from '~hooks/tabs';
6
6
  import List from './list';
7
7
  import styles from './toplist.module.scss';
8
8
 
9
- const TopList = ({ module, toplistHeading, page, modulePosition }) => {
9
+ const TopList = ({
10
+ moduleName = TrackingKeys?.TOPLIST,
11
+ module,
12
+ toplistHeading,
13
+ page,
14
+ modulePosition
15
+ }) => {
10
16
  const showTabs = module.items.length > 1;
11
17
  const content = module.items.map((toplist) => (
12
18
  <div
@@ -22,7 +28,8 @@ const TopList = ({ module, toplistHeading, page, modulePosition }) => {
22
28
  initItemsCount={toplist.num_items_initial_load || 0}
23
29
  loadItemsCount={toplist.num_items_load_more}
24
30
  pageTemplate={page?.template}
25
- module={module.name}
31
+ moduleName={moduleName}
32
+ module={module}
26
33
  extraFields={page?.extraFields}
27
34
  modulePosition={modulePosition}
28
35
  />
@@ -40,6 +47,7 @@ const TopList = ({ module, toplistHeading, page, modulePosition }) => {
40
47
  TopList.propTypes = {
41
48
  // eslint-disable-next-line react/forbid-prop-types
42
49
  module: PropTypes.shape({ name: PropTypes.string, items: PropTypes.arrayOf(PropTypes.object) }),
50
+ moduleName: PropTypes.string,
43
51
  toplistHeading: PropTypes.element,
44
52
  page: PropTypes.shape({
45
53
  template: PropTypes.string,
@@ -12,7 +12,7 @@ export default function List({
12
12
  initItemsCount,
13
13
  loadItemsCount,
14
14
  pageTemplate,
15
- module,
15
+ moduleName,
16
16
  pagePath,
17
17
  modulePosition
18
18
  }) {
@@ -60,7 +60,7 @@ export default function List({
60
60
  itemRefs={elRefs}
61
61
  oneliner={toplist.one_liner}
62
62
  index={index}
63
- module={module}
63
+ moduleName={moduleName}
64
64
  itemPosition={index + 1}
65
65
  modulePosition={modulePosition}
66
66
  />
@@ -94,7 +94,7 @@ List.propTypes = {
94
94
  initItemsCount: PropTypes.string,
95
95
  loadItemsCount: PropTypes.string,
96
96
  pageTemplate: PropTypes.string,
97
- module: PropTypes.string,
98
97
  pagePath: PropTypes.string,
99
98
  modulePosition: PropTypes.number,
99
+ moduleName: PropTypes.string,
100
100
  }
@@ -0,0 +1,28 @@
1
+ /* eslint-disable import/prefer-default-export */
2
+ export const TrackingKeys = {
3
+ TOPLIST: 'toplist',
4
+ BONUS: 'bonus',
5
+ BONUSBOX: 'bonus_box',
6
+ OPERATORBANNER: 'operator_banner',
7
+ HEADEROPERATOR: 'header',
8
+ HEADERPAYMENT: 'header',
9
+ HEADERSLOTS: "header",
10
+ POPUP: "popup",
11
+ ODDSTABLE: 'odds_table',
12
+ CARDS: 'cards',
13
+ CONTENT: 'content',
14
+ INFOGRID: "information_grid",
15
+ COMPARISONTABLE: 'comparison_table',
16
+ OPERATORSUMMARY: "expert_review_summary",
17
+ WAGERINGCALCULATOR: 'wagering_calculator',
18
+ NAVIGATIONTOPLIST: 'navigation_toplist',
19
+ WELCOMEBONUS: 'welcome_bonus',
20
+ OPERATORSTABLE: 'comparison_table',
21
+ LOTTO: 'lotto',
22
+ NAVIGATIONEXLUSIVE: 'navigation_exclusive',
23
+ HEADER: {
24
+ TOPLIST: 'header_toplist',
25
+ BONUS: "header_bonus"
26
+ }
27
+ }
28
+
@@ -3,6 +3,7 @@ import React from 'react'
3
3
  import Iframe from 'gatsby-core-theme/src/components/atoms/iframe'
4
4
  import { isTrackerLink } from 'gatsby-core-theme/src/helpers/tracker.mjs'
5
5
  import processImageNode from './processImageNode.js'
6
+ import { TrackingKeys } from '~constants/tracking-api'
6
7
  import PrettyLink from '~atoms/pretty-link'
7
8
 
8
9
  export default (node, moduleWidth = 960, moduleName, pageTemplate, modulePosition, styles) => {
@@ -11,12 +12,12 @@ export default (node, moduleWidth = 960, moduleName, pageTemplate, modulePositio
11
12
  node.attribs.class = styles && styles[node?.attribs?.class];
12
13
  }
13
14
 
14
- if(node && node.attribs && node.attribs['data-anchor-label']) {
15
+ if (node && node.attribs && node.attribs['data-anchor-label']) {
15
16
  node.attribs['data-track'] = true;
16
17
  }
17
18
 
18
- if(node.name ==='div' && (node.attribs['data-type'] === 'columnBlock' || node.attribs['data-type'] === 'threeColumnBlock')) {
19
- node.attribs.class = `${styles.column} ${node.attribs?.class === 'two-column-block' ? styles.twoColumnBlock : styles.threeColumnBlock}`;
19
+ if (node.name === 'div' && (node.attribs['data-type'] === 'columnBlock' || node.attribs['data-type'] === 'threeColumnBlock')) {
20
+ node.attribs.class = `${styles.column} ${node.attribs?.class === 'two-column-block' ? styles.twoColumnBlock : styles.threeColumnBlock}`;
20
21
  }
21
22
 
22
23
  if (node.name === 'iframe') {
@@ -71,7 +72,7 @@ export default (node, moduleWidth = 960, moduleName, pageTemplate, modulePositio
71
72
  <PrettyLink
72
73
  directPrettyLink={node?.attribs?.href}
73
74
  pageTemplate={pageTemplate}
74
- module={moduleName}
75
+ moduleName={TrackingKeys?.CONTENT}
75
76
  tracker={module?.tracking_link_name || 'main'}
76
77
  className="content-module-gtm"
77
78
  clickedElement="link"
@@ -61,7 +61,6 @@ describe('replaceMedia function', () => {
61
61
  )
62
62
  expect(transformedNode.props.className).toBe('content-module-gtm')
63
63
  expect(transformedNode.props.clickedElement).toBe('link')
64
- expect(transformedNode.props.module).toBe('content')
65
64
  expect(transformedNode.props.pageTemplate).toBe('default')
66
65
  expect(transformedNode.props.tracker).toBe('main')
67
66
  })