Profile Scripts for mobile app | Community
Skip to main content
May 11, 2024
Question

Profile Scripts for mobile app

  • May 11, 2024
  • 1 reply
  • 587 views

I have to select a landing page if an user has been there. Then a variable might be returned with some string. I have used page.url.indexOf and mbox.name.indexOf but nothing happens. Can you help me?
This's the code I was trying:

var r;

if (page.url.indexOf("additionalCardHiring") > -1 || page.url.indexOf("additionalCardProducts") > -1 || page.url.indexOf("additional-card-products") > -1 || page.url.indexOf("funds-hiring") > -1){
r = "atdc";
}
else if (page.url.indexOf("fundsHiring") > -1 || page.name.indexOf("fundsHiring") > -1 || page.url.indexOf("funds-hiring") > -1 || mbox.name.indexOf("fundsHiring") > -1 || page.url.indexOf("additional-card-products") > -1 || page.url.indexOf("additional-card-hiring") > -1) {
r ="fci";
}
else {
r = "dft";
}
return r;
This code always returns "dft". Thoose strings in indexOf() methods are from localStorage url, mbox name (supossed), adobeTarget.pageName() and location.href url.

Thank you!


This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

alexbishop
Adobe Employee
Adobe Employee
May 14, 2024

Do you have an example of the payload that is sent to Target?