//Initializing Smart Script arguments var oneLinkURL = "https://engmntqa.onelink.me/LtRd/"; var mediaSource = {keys: [], defaultValue: "my_media_value"}; var campaign = {keys: [], defaultValue: "my_campaign"}; //Calling the function after embedding the code will be through a global parameter on the window object called window.AF_SMART_SCRIPT //Onelink URL is generated var result = window.AF_SMART_SCRIPT.generateOneLinkURL({ oneLinkURL, afParameters:{ mediaSource: mediaSource, campaign: campaign } }) var result_url = "No output from script" if (result) { result_url = result.clickURL; document.getElementById('andrd_link').setAttribute('href', result_url); document.getElementById('ios_link').setAttribute('href', result_url); } document.getElementById('output_url').innerHTML = result_url;