We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 07e08c6 commit 9c1a6a2Copy full SHA for 9c1a6a2
src/utils/addCustomEventListener.ts
@@ -17,6 +17,9 @@ export const addCustomClickEventListener = (eventName: string) => {
17
// Try to get the first element with href or action, falls back to the first layer of the clicked element
18
const targetElement = path.find((el) => !!el.href || !!el.action) || path[0]
19
20
+ // If the element doesn't have href or action we don't need to send it to dataLayer
21
+ if (!targetElement.href && !targetElement.action) return
22
+
23
if (!window.dataLayer) {
24
window.dataLayer = []
25
}
0 commit comments