Conversion value in JS (LO Checkout)

I am using custom code to fire conversions with a 3rd party developer. I am working off this resource https://developer.blackbaud.com/skyapi/products/bbms/payments/checkout/transaction-parameters
The conversion is firing appropriately but the dot notation I am using to set conversion value isn't working. I attached the code snippet here for you to review. How can I use JS to pull in dynamic values?

document.addEventListener('checkoutComplete', function (event) {
var shoppingCartValue = data.amount;
feathr(
'convert',
'66292548d2c70df5e49cd64d',
{
amount: shoppingCartValue, // number, required
currency: 'USD', // string, optional, defaults to 'USD'
category: 'Conversion' // string, optional, defaults to 'Conversion'
}
);
});

Comments

  • Hey @Kelly Bodie, looks like you're not accessing the event when setting your variable. You could try:

    document.addEventListener('checkoutComplete', function (event) {
    var shoppingCartValue = event.detail.amount;
    feathr(
    'convert',
    '66292548d2c70df5e49cd64d',
    {
    amount: shoppingCartValue,
    currency: 'USD',
    category: 'Conversion'
    }
    );
    });

  • @Matt Thacker
    Thank you! I fired a test off and send it to my developer. I'll circle back.

  • Alex Wong
    Alex Wong Community All-Star
    Tenth Anniversary Kudos 5 Facilitator 4 bbcon 2025 Attendee Badge

    @Kelly Bodie
    While I don't know what you are trying to do with this code and what is feathr() as a function intake as parameter, you might want to make sure your “event” object actually has the data property on it that is the JSON returned by the API call. You can use console.log(event) to see what is “loaded” into event object or just alert(event).

    Not trying to be unfriendly, but generally “less inclined” to help when you are already working with a hired developer, I expect that the developer should know better as a hired professional on doing the work that was paid to do.

  • @Alex Wong
    I appreciate the insight and candor! From my limited understanding while debugging on a call with them, we thought the BB resource we were using was faulty or incomplete. Before bringing the question to this community discussion, I tried bringing it directly to support chat. Now with your notes, I think perhaps familiarity with this API is also a factor, and you're right to point out it's kinda crummy.

    I am also in line to get BB professional services to help and it's taking forever and a day. I'm not even sure they'll be able to help.

    As the nonprofit in the middle, I am extremely thankful for the help in this community! I have a summer campaign launching at the end of this month and I need this code complete.

    thanks!

  • Alex Wong
    Alex Wong Community All-Star
    Tenth Anniversary Kudos 5 Facilitator 4 bbcon 2025 Attendee Badge

    @Kelly Bodie
    You can have the developer try what Matt has suggested as well as my suggestion on outputting the event object's information. Also rather than you being in the middle between the developer and this Community of helpers, it may be better that you have the developer directly post his issue here to get help.

    I am not sure if BB profressional services has SKY API capability. You should reach out to your account rep to ensure BB profressional services that you are in line for is capable of what you are attempting to do.

    @Heather McLean @Erik Leaver I think you may have better answer regarding if BB professional services can help with SKY API project.

  • Erik Leaver
    Erik Leaver Blackbaud Employee
    Tenth Anniversary Kudos 5 First Reply Name Dropper

    @Alex Wong Our services team can help advise on SKY API questions but won't write APIs. But this also sounds like @Kelly Bodie's consultant is using the LO APIs so the team who would be involved might be a little different. In any case, it sounds like Kelly has engaged services. But this sounds less like a API question & more of a JS issue with the 3rd party tracking.

  • I connected and got this answered with the services team. The issue was more or less hunting down the correct field name to fetch - he found it through some sleuthing.

    Thanks to you all for your input. I'm glad this is solved! However, I know it's a temporary solution because LO Checkout in the S-tag is going away. Once I'm in a modal/embedded form, I'll have to restart the whole Pixel process.

Categories