Creating a direct click URL

🚧

This method requires v2.4.0 and above

📘

This method is an extension to Smart Script

Make sure you read the Smart Script implementation and arguments

概要

This method provides support for creating a click URLs, to be used mainly by non mobile platforms (e.g. Steam, CTVs etc). When the click is matched to an installation, an attribution will be noted.

引数

Argument 備考

afParameters

(必須)

 

 

 


mediaSource

(必須)

メディアソースのオブジェクト構成

  • Keys: ['incoming_mediasource’' 'utm_source']
  • オーバーライド値:{twitter: 'twitter_int', orig_src: 'new_src'}
  • デフォルト値: ['any_source']

campaign

キャンペーンのオブジェクト構成

  • Keys: ['incoming_campaign', 'utm_campaign']
  • オーバーライド値: {campaign_name: 'new_campaign_name'}
  • デフォルト値: ['any_campaign_name']

channel

チャネルのオブジェクト構成

  • Keys: ['incoming_channel', 'utm_channel']
  • オーバーライド値: {video: 'new_video'}
  • デフォルト値: ['any_video']

ad

広告のオブジェクト構成

  • Keys: ['incoming_ad', 'utm_ad']
  • オーバーライド値: {ad_name: 'new_ad_name'}
  • デフォルト値: ['any_ad_name']
adSet

広告セットのオブジェクト構成

  • Keys: ['incoming_adset', 'utm_adset']
  • オーバーライド値: {'adset_name': 'new_adset_name'}
  • デフォルト値: ['any_adset_name']
他の(カスタム)クエリパラメーター
  • アトリビューションやディープリンクのために、送信URLに含めたいその他のパラメータを、その構成オブジェクトとともにリストアップします。
  • カスタムパラメータの名前は、開発者が設定オブジェクトの paramKey としてリストアップします。
  • paramKey: 'deep_link_sub1'
  • Keys: ['page_id']
  • オーバーライド値: {page12: 'new_page12'}
  • Default value: 'page1'
platform A string describes the platform. MUST be from this list:
  • smartcast
  • tizen
  • roku
  • webos
  • vidaa
  • playstation
  • android
  • ios
  • steam
  • quest
  • battlenet
  • "steam"
    app_id アプリケーションID "123456"
    redirectURL The URL the user will be redirected "https://store.steampowered.com/app/123456/Team_Fortress_2/"

    Code example for a Steam game

    //Initializing Smart Script arguments
    // If a media source key is NOT FOUND on the link and NO default value is found, the script will return a null string 
    var mediaSource = {keys: ["my_media_source"], defaultValue: "my_default_media_source"};
    var campaign = {keys: ["my_campaign"], defaultValue: "my_default_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.generateDirectClickURL({
      afParameters:{
        mediaSource: mediaSource,
        campaign: campaign
      },
      platform: 'steam',
      app_id: '123456',
      redirectURL:'https://store.steampowered.com/app/123456/Team_Fortress_2/'
    })
    
    var result_url = "No output from script"
    if (result) {
      result_url = result.clickURL;            
    }
    

    See example of the conversion of an incoming URL to an outgoing direct click URL for a Steam game.