0 Value is not being passed to the Adobe Analytics - DTM

Avatar

Avatar
Validate 10
Level 3
roshanc44331495
Level 3

Likes

25 likes

Total Posts

38 posts

Correct reply

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

Avatar
Validate 10
Level 3
roshanc44331495
Level 3

Likes

25 likes

Total Posts

38 posts

Correct reply

7 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile
roshanc44331495
Level 3

25-06-2018

Hi,

I have created following function to send values 0 and 1 when users give a kudo value=1 and for un-kudo value=0.

I am facing issue with un-kudo because it's not sending 0 value to the adobe, if we replace 0 with any numeric values like 2 it works. But I wanted to assign a 0 value for the un-kudo. How can we do this through DTM?

function bindKudoEvent(){

jQuery('.lia-button-image-kudos-kudoed .kudos-link').on('click',function(e){

console.log("KUDO REMOVE");

var isAcceptedSol = $(this).parents('.lia-message-view-display').hasClass('lia-accepted-solution');

console.log("Parent Solution CHECK", isAcceptedSol);

trackClickTkb(0,"kudo count",isAcceptedSol)

setTimeout(function(){ bindKudoEvent() }, 3500);

});

jQuery('.lia-button-image-kudos-not-kudoed .kudos-link').on('click',function(e){

console.log("kudo Given KUDO")

var isAcceptedSol = $(this).parents('.lia-message-view-display').hasClass('lia-accepted-solution');

console.log("Parent Solution CHECK", isAcceptedSol);

trackClickTkb(1,"kudo count")

setTimeout(function(){ bindKudoEvent() }, 3500);

});

}

Thanks in Advance!

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Coach
MVP
StewSchilling
MVP

Likes

342 likes

Total Posts

278 posts

Correct reply

85 solutions
Top badges earned
Coach
Give Back 25
Springboard
Bedrock
Validate 1
View profile

Avatar
Coach
MVP
StewSchilling
MVP

Likes

342 likes

Total Posts

278 posts

Correct reply

85 solutions
Top badges earned
Coach
Give Back 25
Springboard
Bedrock
Validate 1
View profile
StewSchilling
MVP

18-07-2018

My assumption is that something is evaluating your values as truthy or not truthy.  1 is Truthy and 0 is not. 

One option would be to try passing them as strings "0" and "1".  The other would be to use "F", "T" as indicators or "N", "Y".

My other observation is that this code replicates much of what DTM and Launch do out of the box. Why not just create a DTM event based rule (or two)?

Answers (0)