Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

DTM - Attach click even to a link that doesn't have ID

Avatar

Avatar
Validate 1
Level 2
amine74235389
Level 2

Likes

3 likes

Total Posts

10 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
amine74235389
Level 2

Likes

3 likes

Total Posts

10 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
View profile
amine74235389
Level 2

05-01-2017

Hi,

I have a page that has a link. Unfortunately the link does not have an ID and I can't add one (technical issues with CMS). I have jQuery/JS code that can listen for the link click and fire a pixel, but I'm not sure how to create the rule in DTM.

The jQuery is something like this:

$("a").click(function(){

    if($("a").attr('data-utc')=="12345")
       //Fire pixel    
});

Any idea how to create such custom rule in DTM?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 10
Level 10
ParitMittal
Level 10

Likes

91 likes

Total Posts

817 posts

Correct Reply

349 solutions
Top badges earned
Validate 10
Validate 1
Boost 50
Boost 5
Boost 3
View profile

Avatar
Validate 10
Level 10
ParitMittal
Level 10

Likes

91 likes

Total Posts

817 posts

Correct Reply

349 solutions
Top badges earned
Validate 10
Validate 1
Boost 50
Boost 5
Boost 3
View profile
ParitMittal
Level 10

05-01-2017

Hi Amin,

For your Use-case you can create  Create an Event based rule with Event type as "Click" and "Element or Tag Selector"  as  a and Please check the box to manually assign properties & attributes and then specify the attributes with their value. Please see the below snapshot for more help.

Thanks & Regards

Parit Mittal

Answers (1)

Answers (1)

Avatar

Avatar
Validate 1
Level 2
amine74235389
Level 2

Likes

3 likes

Total Posts

10 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
amine74235389
Level 2

Likes

3 likes

Total Posts

10 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
View profile
amine74235389
Level 2

06-01-2017

I used the above with regex and it worked. Thank you.