


Hi,
I need to show some banners after user inactivty of 15 sec on web page, I written JS code which is running on console but giving an error as "Invalid user input" on Target's profile script.
var time;
document.onload = resetTimer;
document.onmousemove = resetTimer;
document.onmousedown = resetTimer; // touchscreen presses
document.ontouchstart = resetTimer;
document.onclick = resetTimer; // touchpad clicks
function popup()
{return true; }
function resetTimer() {
clearTimeout(time);
time = setTimeout(popup, 15000);
}
can someone please guide me how I can use this as profile script? so based on this audience can be created.
Hi @RudraChaudhari - Profile Scripts leverage JS Rhino and function differently than client side executed javascript. For your use case, it would probably be better to deliver the javascript through a Target offer either using the VEC (Custom Code) or the Form Based composer. For reference, we also have some sample templates including one for a modal on a timer which can be viewed here. Try delivering it through an activity to the page rather than using Profile Scripts which are executed server side on Target's servers.
Hi @RudraChaudhari - Profile Scripts leverage JS Rhino and function differently than client side executed javascript. For your use case, it would probably be better to deliver the javascript through a Target offer either using the VEC (Custom Code) or the Form Based composer. For reference, we also have some sample templates including one for a modal on a timer which can be viewed here. Try delivering it through an activity to the page rather than using Profile Scripts which are executed server side on Target's servers.