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

Avatar

Avatar

roshanc44331495

Avatar

roshanc44331495

roshanc44331495

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 (0)

Answers (1)

Answers (1)

Avatar

Avatar

StewSchilling

MVP

Avatar

StewSchilling

MVP

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)?