JS if/else statement not firing from Custom Code in activity
Hello all,
I've been running into an issue with getting the 'else' portion of a block of code to fire in one of my activities and wanted to see if anyone had any insight or could point me in the right direction. I have experience as a front-end dev so am somewhat familiar with JS, but admittedly have not kept up with it as I've moved into a full-time A/B testing role, so I'm definitely rusty.
Basically we're trying to get our content to change in Target based on a variable value. The custom code in Target does fire, however it fires even if the variable value is incorrect. I'm including a screenshot of what I'm seeing, but the 'Modified with Target...' copy should not be displaying along with the banner image, as the ui.userInfo.bannerName value is set to HYSA 2 but was set to 'HYSA 1' in this case upon launching this site in our dev environment.

The code I'm using in my Target activity is below:
<script>
adobe.target.getOffer({
"mbox": "target-global-mbox",
"success": function(offer) {
console.log('success');
if ('ui.userInfo.bannerName == "HYSA 1"'){
console.log('param works');
$('#PromoBanner #AmexPromoBanner #adContent .cta #PromoBannerTitle').text('Modified with Target - 23-6484790928A');
$('#PromoBanner #AmexPromoBanner #heroImage').attr("src", "https://www.transunion.com/content/dam/transunion/global/consumer/images/testing/amex/planit.jpg");
} else {
console.log('param does not works');
$('#PromoBanner #AmexPromoBanner #heroImage').attr("src", "https://amexccvd-canary.slo-devweb.truelink.com/sites/CreditView/assets/images/promo-banner/mycred.png");
}
},
"error": function(status, error) {
console.log('error');
},
"timeout": 2000
});
</script>
Please let me know if anyone can help - thank you!
Dan