Adobe DTM: Event Rule | Capture data attribute

126 Views Asked by At

HTML Markup shown here

Hi, I would like to get data-target values using Adobe DTM event based Rule. As shown in image at top (Image name: HTML Markup), all menu items belongs to plan-home-navigation class. And each item have unique data-target attribute. How can I capture this using DTM event based Rule. I tried below shared combination but did not work. Adobe DTM: Event based Rule

1

There are 1 best solutions below

0
On

You are targeting the wrong element to trigger the event based rule. Instead of the div container of the navigation header, you will need to trigger the event based rule on the anchor elements themselves. So the Element Tag should be div.plan-home-navigation a[data-target]. You can further narrow down the selection by manually specifying data-target as the property and #plan- with regex option turned on.

Quick Fire. Untested.

Come to think of it, [data-target] might not even be required if these are the only anchor links in the container. Let alone manually specifying data-target.