AppsFlyer logo
OneLink logo

OneLink Smart Script V2

OneLink Google Tag Manager Demo

Input URL

To edit: make changes to the input URL in the address bar and reload the page. Changes you have made to the script below will be lost after reload.

Code ran by Google Tag manager

        //Initializing Smart Script arguments
        var oneLinkURL = "";
        var mediaSource = {keys: ["my_source"], defaultValue: "noMediaSource"};
        var deepLinkValue = {keys: ["app_dest"], defaultValue: "default_view"};
        // Setting an attribution parameter
        var afSub4 = {keys: ["msg_id"], defaultValue: "no_msg_id"};
        // Setting OneLink custom parameter
        var deepLinkSub1 = {paramKey: "deep_link_sub1", keys: ["typeid"], defaultValue: "1a1a"};

        //Function is embedded on the window object in a global parameter called window.AF_SMART_SCRIPT.
        //Onelink URL is generated
        AF_SMART_SCRIPT_RESULT = window.AF_SMART_SCRIPT.generateOneLinkURL({
          oneLinkURL: oneLinkURL,
            mediaSource: mediaSource,
            deepLinkValue: deepLinkValue,
            afSub4: afSub4,
            afCustom: [

Output URL

app store link play store link