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

Adobe Launch: Rule to Capture ID for a Clicked Checkbox

Avatar

Avatar
Validate 10
Level 4
eham06
Level 4

Likes

44 likes

Total Posts

46 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile

Avatar
Validate 10
Level 4
eham06
Level 4

Likes

44 likes

Total Posts

46 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile
eham06
Level 4

10-04-2018

I have a series of check boxes. See source HTML below.

When the checkbox is clicked, I want Adobe Launch to capture the "id" and push into Adobe Analytics which clicked without having to wait for a pageload.

I have configured a rule to capture "id" for element "input" on mouse click.

However, the rule captures the 1st element "input" not the "input" which was clicked.

How do you configure a rule to capture the id for a clicked checkbox?

Can this be done without custom Javascript?

<input type="checkbox" id="Return3year" name="performance_returnsThreeYears" class=" skitchen-menu-input" value="performance_returnsThreeYears" data-bind="checked: orders().indexOf(&quot;performance_returnsThreeYears&quot;) >= 0">

<input type="checkbox" id="Return5year" name="performance_returnsFiveYears" class=" skitchen-menu-input" value="performance_returnsFiveYears" data-bind="checked: orders().indexOf(&quot;performance_returnsFiveYears&quot;) >= 0">

<input type="checkbox" id="Return10year" name="performance_returnsTenYears" class=" skitchen-menu-input" value="performance_returnsTenYears" data-bind="checked: orders().indexOf(&quot;performance_returnsTenYears&quot;) >= 0">

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 10
Level 4
eham06
Level 4

Likes

44 likes

Total Posts

46 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile

Avatar
Validate 10
Level 4
eham06
Level 4

Likes

44 likes

Total Posts

46 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile
eham06
Level 4

17-04-2018

I figured it out...

This will capture the current value of ID on each click...

temp1.png

Answers (6)

Answers (6)

Avatar

Avatar
Ignite 1
Level 2
saml9443
Level 2

Likes

7 likes

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Ignite 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Ignite 1
Level 2
saml9443
Level 2

Likes

7 likes

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Ignite 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile
saml9443
Level 2

16-03-2020

My best solution has been to create a data element with the custom code below which allows me to loop through each item with the <a> tag, find the index of the onclick, and return the text value.

 

It's interesting to see "this" being used - I'll have to give that a try!

 

 

var pageItemA = document.getElementsByTagName('a');
for (var pageItemAi = 0, len = pageItemA.length; pageItemAi<len; pageItemAi++) 
{ 
  (function(index) { 
    pageItemA[pageItemAi].onclick = function() {
      var pageSelectionA = document.getElementsByTagName('a')[index].textContent;
      _satellite.track("pageItemClick",{pageItem: pageSelectionA});
    } 
  }) (pageItemAi); 
}

 

 

Avatar

Avatar
Validate 10
Level 4
eham06
Level 4

Likes

44 likes

Total Posts

46 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile

Avatar
Validate 10
Level 4
eham06
Level 4

Likes

44 likes

Total Posts

46 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile
eham06
Level 4

20-12-2018

No, I did not specify this %this.id% as a data element.

Thanks

Avatar

Avatar
Shape 1
Level 2
Locutus243
Level 2

Likes

19 likes

Total Posts

37 posts

Correct Reply

0 solutions
Top badges earned
Shape 1
Give Back
Ignite 1
Validate 1
Boost 5
View profile

Avatar
Shape 1
Level 2
Locutus243
Level 2

Likes

19 likes

Total Posts

37 posts

Correct Reply

0 solutions
Top badges earned
Shape 1
Give Back
Ignite 1
Validate 1
Boost 5
View profile
Locutus243
Level 2

19-12-2018

How did you specify the %this.id% data element?

Avatar

Avatar
Validate 1000
Community Manager
jantzen_belliston-Adobe
Community Manager

Likes

337 likes

Total Posts

2,286 posts

Correct Reply

815 solutions
Top badges earned
Validate 1000
Springboard
Validate 500
Validate 250
Validate 100
View profile

Avatar
Validate 1000
Community Manager
jantzen_belliston-Adobe
Community Manager

Likes

337 likes

Total Posts

2,286 posts

Correct Reply

815 solutions
Top badges earned
Validate 1000
Springboard
Validate 500
Validate 250
Validate 100
View profile
jantzen_belliston-Adobe
Community Manager

18-04-2018

I'm glad you were able to figure it out. i was going to suggest looking into the "this" keyword for JavaScript/jQuery.

Avatar

Avatar
Validate 10
Level 4
eham06
Level 4

Likes

44 likes

Total Posts

46 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile

Avatar
Validate 10
Level 4
eham06
Level 4

Likes

44 likes

Total Posts

46 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile
eham06
Level 4

17-04-2018

Thanks

temp1.png

temp2.png

temp3.png

temp4.png

temp5.png

Avatar

Avatar
Validate 1000
Community Manager
jantzen_belliston-Adobe
Community Manager

Likes

337 likes

Total Posts

2,286 posts

Correct Reply

815 solutions
Top badges earned
Validate 1000
Springboard
Validate 500
Validate 250
Validate 100
View profile

Avatar
Validate 1000
Community Manager
jantzen_belliston-Adobe
Community Manager

Likes

337 likes

Total Posts

2,286 posts

Correct Reply

815 solutions
Top badges earned
Validate 1000
Springboard
Validate 500
Validate 250
Validate 100
View profile
jantzen_belliston-Adobe
Community Manager

16-04-2018

Can you post a screenshot of how you've configured the rule? I'm not sure if this can be done in the interface, but it could definitely be done with some custom JavaScript.