Skip to content

Commit 899308c

Browse files
author
Paulo Júnior
authored
fix: custom event props to match mkt expectations
1 parent 38d1e6d commit 899308c

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/components/nav/Header.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,9 @@ const Header = () => {
169169
fill="none"
170170
xmlns="http://www.w3.org/2000/svg"
171171
stroke="currentColor"
172-
stroke-linecap="round"
173-
stroke-linejoin="round"
174-
stroke-width="2"
172+
strokeLinecap="round"
173+
strokeLinejoin="round"
174+
strokeWidth="2"
175175
className="StyledIconBase-ea9ulj-0 jZGNBW"
176176
>
177177
<circle cx="11" cy="11" r="8"></circle>

src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ registerCustomElement({
77
component: App,
88
})
99

10-
addCustomClickEventListener('custom_click_event')
10+
addCustomClickEventListener('doc_nav_click')

src/utils/addCustomEventListener.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,14 @@ export const addCustomClickEventListener = (eventName: string) => {
2727

2828
window.dataLayer.push({
2929
event: eventName,
30-
custom_event: {
30+
gtm: {
3131
element: targetElement,
3232
elementId: targetElement.id || '',
3333
elementClasses: targetElement.className || '',
3434
elementUrl: targetElement.href || targetElement.action || '',
3535
elementTarget: targetElement.target || '',
36+
clickUrl: targetElement.href || targetElement.action || '',
37+
clickText: targetElement.textContent || '',
3638
originalEvent: event,
3739
inShadowDom: shadowFound,
3840
},

0 commit comments

Comments
 (0)