Expand my Community achievements bar.

SOLVED

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

Avatar

Level 4

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!

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

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