コールバックマクロ
マクロはサーバへのリクエスト時に動的に変わる値を設定するプレースホルダーになります。これらのマクロはTenjinと連携済みのネットワークについては設定済みとなりますが、これらのマクロがどのように機能するかを学ぶことは、カスタムチャネルでのトラッキングにおいて有益です。
なぜマクロが必要か?
詳細を読む
マクロはトラッキングリンクのパラメータ上で値を動的に取得するのに必要となります。
下記に、URL、パラメータ、動的に変わる値がアトリビューション発生時にどのように機能するかを示します。
URLとパラメータ
下記の標準的なURLを例に取ります。
https://track.tenjin.io?param1=value1
このURLでは、track.tenjin.ioがサーバのアドレス、パラメータparam1にvalue1が設定されています。このURLがtrack.tenjin.ioのサーバにアクセスした際、TenjinのサーバはこのURLを解読し、パラメータと値を読み込みます。
実際のアトリビューションに使われるより具体的なURLでは、2つのパラメータ(advertising_idとclick_id)と2つの値を下記URLに設定します。
https://track.tenjin.io?advertising_id=xyz123&click_id=test
このURLがtrack.tenjin.ioのサーバにアクセスした際, advertising_idはxyz123で、click_idがtestであることを読み取ります。
ダイナミックパラメータ
Tenjinがユーザをクリックまたはインプレッションのイベントにアトリビュートするには, Tenjinは各クリックまたはインプレッションイベント発生時にデバイス情報を受け取ります。これらの情報はデバイスがアプリをインストールした際に取得する情報を紐づけられます。
セルフアトリビューションのネットワーク以外、またはカスタムチャネルにおいてキャンペーン作成時に、トラッキングリンクが生成されます。このトラッキングURLはクリックまたはインプレション発生時に値が動的に変わるマクロを含んでいます。
下記がTenjinで生成されるトラッキングリンクの例です。
https://track.tenjin.io?advertising_id={idfa}&click_id={click_id}
この例では、{idfa}および{country}がマクロになります。デバイスがこのリンクにアクセスした場合、アドネットワークはこれらのマクロをデバイスの実際の値に置き換えます。先述の例を用いると、{idfa}と{click_id}はxyz123とtestにそれぞれ置き換わります。
次に、アドネットワークはTenjinのサーバに下記のURLでアクセスします。
https://track.tenjin.io?advertising_id=xyz123&click_id=test
また, 別のユーザがURLにアクセスした場合、advertising_idはabc234、click_idはtest2となり、URLは下記のようになります。
https://track.tenjin.io?advertising_id=abc234&click=test2
上記のように、これらの例では同一のURLにアクセスしているもののユーザの属性によって値が変わります。
アドネットワークのコールバックマクロ
詳細を読む
それぞれのネットワークごとに、クリックまたはインプレッション発生時に下記のデバイス属性がマクロとして利用可能となります。
- Advertising ID
- IP address
- Bundle ID
- Click ID
- Site
- OS Platform
- Limit Ad Tracking
- Creative
- Campaign ID
ネットワークがすでにTenjinと連携済みの場合、それぞれのマクロは自動的に各キャンペーンのクリック/インプレッションURLとして自動的に表示されます。
例:
- Applovinの
advertising_idマクロは{IDFA} - Tapjoyの
advertising_idマクロはTAPJOY_ADVERTISING_ID
ApplovinとTapjoyのクリックURLは下記の通りとなります。
- Applovin:
https://track.tenjin.io/v0/id?advertising_id={IDFA} - Tapjoy:
https://track.tenjin.io/v0/id?advertising_id=TAPJOY_ADVERTISING_ID
カスタムコールバックのマクロ
詳細を読む
Tenjin上でコールバックを設定する際、これらのマクロを動的に設定することにより値を他サーバやサービスに送信することができます。下記が使用可能なマクロになります。
- アプリに関連するマクロ
| マクロ | 説明 |
|---|---|
| {{app_version}} | ユーザのアプリバージョン |
| {{bundle_id}} | アプリのバンドルID (com.tenjin.wordfinder) |
| {{lowercase_bundle_id}} | 小文字のアプリのバンドルID (com.tenjin.wordfinder) |
| {{platform}} | アプリのプラットフォーム (ios, android) |
| {{user_agent}} | ユーザのユーザエージェント |
| {{sdk_version}} | ユーザのTenjin SDKバージョン |
| {{store_id}} | アプリのストアID (887212194) |
- アトリビューションに関連するマクロ
| マクロ | 説明 |
|---|---|
| {{acquired_at_s}} | 秒単位でのインストールイベントの発生時間 |
| {{acquired_at_ms}} | ミリ秒単位でのインストールイベントの発生時間 |
| {{engaged_at_s}} | 秒単位でのクリックまたはインプレッションイベントの発生時間 |
| {{engaged_at_ms}} | ミリ秒単位でのクリックまたはインプレッションイベントの発生時間 |
| {{ad_network}} | ユーザがアトリビュートされているキャンペーンのネットワーク名 |
| {{campaign_id}} | {{remote_campaign_id}}と同じ |
| {{campaign_name}} | ユーザがアトリビュートされているキャンペーンの、Tenjinでのキャンペーン名 |
| {{campaign_name_encoded}} | ユーザがアトリビュートされているキャンペーンの、Tenjinでのエンコードされたキャンペーン名 |
| {{click_id}} | チャネルのクリックID |
| {{creative_name}} | クリエイティブ名 |
| {{deeplink_url}} | ディープリンクURL |
| {{is_conversion_integer}} | 1 => 初回起動, 0 => 他イベント |
| {{is_impression}} | 1 => ビュースルー, 0 => クリックアトリビューション |
| {{is_install_or_landing}} | install => 初回起動、landing => それ以降の起動イベント |
| {{ip_address}} | ユーザのIPアドレス |
| {{ip_address_click}} | クリックまたはインプレションのIPアドレス |
| {{remote_campaign_id}} | ユーザがアトリビュートされているキャンペーンの、チャネルでのキャンペーンID |
| {{site_id}} | ユーザがアトリビュートされているキャンペーンのサイトID |
| {{site_id_encoded}} | ユーザがアトリビュートされているキャンペーンのエンコードされたサイトID |
| {{ad_network_short_id_match_type}} | device, probabilistic, referrer。 ad_network_short_idの部分はネットワークごとに異なりますので、詳しくはお問い合わせください。 |
| {{is_organic}} | '1' -> ユーザがオーガニックにアトリビュートされている場合, '0' -> ユーザがオーガニック以外にアトリビュートされている場合 |
| {{tenjin_campaign_id}} | ユーザがアトリビュートされているキャンペーンの、TenjinでのキャンペーンID |
| {{tenjin_parameter_0}} | クリックURLから受け渡されるパススルーマクロ |
| {{tenjin_parameter_1}} | クリックURLから受け渡されるパススルーマクロ |
| {{tenjin_parameter_2}} | クリックURLから受け渡されるパススルーマクロ |
| {{tenjin_parameter_3}} | クリックURLから受け渡されるパススルーマクロ |
| {{tenjin_parameter_4}} | クリックURLから受け渡されるパススルーマクロ |
| {{tenjin_parameter_5}} | クリックURLから受け渡されるパススルーマクロ |
- デバイス識別子に関連するマクロ
| マクロ | 説明 |
|---|---|
| {{advertising_id}} | デバイスのIDFAまたはグーグル広告ID |
| {{analytics_installation_id}} | Androidデバイス用のアプリケーションインストール固有の識別子 |
| {{developer_device_id}} | ベンダーID(IDFV) |
| {{formatted_advertising_id}} | フォーマットされた広告ID、空白の場合は 00000000-0000-0000-0000-000000000000 |
| {{imei}} | IMEI |
| {{md5_advertising_id}} | MD5ハッシュ形式のデバイスのIDFAまたはグーグル広告ID |
| {{lowercase_advertising_id}} | 小文字のデバイスのIDFAまたはグーグル広告ID |
| {{md5_imei}} | MD5ハッシュ形式のIMEI |
| {{md5_oaid}} | MD5ハッシュ形式のOAID |
| {{oaid}} | OAID |
| {{customer_user_id}} | setCustomerUserId SDKメソッドによって設定された、アプリからのユーザーID |
- デバイス属性に関するマクロ
| マクロ | 説明 |
|---|---|
| {{allow_ad_tracking}} | 広告トラッキングの許可?(true, false) |
| {{allow_ad_tracking_integer}} | 広告トラッキングの許可? (1, 0) |
| {{carrier}} | デバイスキャリア |
| {{connection_type}} | 接続タイプ |
| {{country}} | ユーザの国コード (US) |
| {{device}} | ユーザのデバイス |
| {{device_brand}} | デバイスブランド |
| {{device_model}} | デバイスモデル |
| {{language}} | ユーザの言語設定 |
| {{limit_ad_tracking}} | 広告トラッキングを許可しない? (true, false) |
| {{limit_ad_tracking_integer}} | 広告トラッキングを許可しない? (1, 0) |
| {{locale}} | デバイスロケール |
| {{os_version}} | ユーザのOSバージョン |
| {{os_version_release}} | ユーザのリリースOSバージョン |
| {{referrer}} | アンドロイドリファラー |
| {{timezone}} | デバイスタイムゾーン |
| {{tracking_status}} | iOSデバイスのトラッキングステータス。0 = not determined, 1 = restricted, 2 = denied, 3 = authorized |
- イベントに関するマクロ
| マクロ | 説明 |
|---|---|
| {{currency}} | 課金イベントの通貨 (USD |
| {{event}} | イベント名 |
| {{time_in_seconds}} | 秒単位のイベント発生時間 |
| {{time_in_ms}} | ミリ秒単位のイベント発生時間 |
| {{time_iso8601}} | ISO 8601フォーマットでのイベント発生時間 |
| {{revenue}} | 元の通貨での、課金イベントのグロス売上 |
| {{revenue_usd_net}} | USDでの課金イベントのネット売上 |
| {{revenue_usd_gross}} | USDでの課金イベントのグロス売上 |
| {{value} | カスタムイベントの値 |
- 広告インプレッションに関するマクロ
AppLovin
| マクロ | 説明 |
|---|---|
| {{ad_unit_id}} | Ad unit ID reported by the winning network |
| {{currency}} | Currency ad revenue is reported in |
| {{ad_format}} | Format of the ad unit |
| {{mediation_country}} | Country from the mediation provider |
| {{network_name}} | Network that displayed the ad |
| {{ad_revenue}} | Revenue reported by the ad network |
| {{network_placement}} | Network defined placement |
| {{placement}} | Placement of the ad unit |
| {{creative_id}} | Creative ID of the ad unit |
| {{precision}} | Precision of the revenue |
ironSource
| マクロ | 説明 |
|---|---|
| {{ab_test}} | A/B test value |
| {{ad_format}} | Format of the ad unit |
| {{ad_revenue}} | Revenue reported by the ad network |
| {{auction_id}} | Auction ID from Ironsource mediation |
| {{ecpm}} | eCPM from Ironsource mediation |
| {{instance_id}} | Instance ID from Ironsource mediation |
| {{instance_name}} | Instance Name from Ironsource mediation |
| {{mediation_country}} | (not used, will use the Tenjin country macro) |
| {{mediation_ltv}} | Lifetime Revenue from Ironsource mediation |
| {{network_name}} | Network that displayed the ad |
| {{placement}} | Placement of the ad unit |
| {{precision}} | Precision of the revneue |
| {{segment}} | Segment Name from Ironsource mediation |
HyperBid
| マクロ | 説明 |
|---|---|
| {{mediation_country}} | Country from the mediation provider |
| {{ad_network_type}} | Type of Network, Cross Promotion, or exchange |
| {{adsource_index}} | Sorting of the current ad source in the Waterfall |
AdMob
| マクロ | 説明 |
|---|---|
| {{precision}} | Precision type defined by AdMob |
| {{ad_unit_id}} | Ad unit ID defined by AdMob |
| {{currency}} | Currency code from AdMob |
| {{adapter_class}} | Adapter class of ad network |
| {{response_id}} | Response ID provided by AdMob |
| {{ad_revenue_micro}} | Ad revenue in micro cents provided by AdMob |
Topon
| マクロ | 説明 |
|---|---|
| {{mediation_country}} | Country from the mediation provider |
| {{ad_network_type}} | Type of Network, Cross Promotion, or exchange |
| {{adsource_index}} | Sorting of the current ad source in the Waterfall |
- SANアトリビューション
SANアトリビューションマクロを使用するには、support@tenjin.comまでご連絡ください。
Meta
| マクロ | 説明 |
|---|---|
| {{meta::account_id}} | Ad account used to generate the ad |
| {{meta::ad_id}} | Unique ID of the ad clicked/viewed before conversion |
| {{meta::ad_objective_name}} | Objective selected when creating the campaign (e.g., MOBILE_APP_INSTALLS, CONVERSIONS) |
| {{meta::adgroup_id}} | ID of the Meta Ad |
| {{meta::adgroup_name}} | Name of the Meta Ad |
| {{meta::campaign_group_id}} | ID of the Meta Campaign |
| {{meta::campaign_group_name}} | Name of the Meta Campaign |
| {{meta::campaign_id}} | ID of the Meta AdSet |
| {{meta::campaign_name}} | Name of the Meta AdSet |
| {{meta::click_time}} | Timestamp of the last ad click before attribution |
| {{meta::engagement_type}} | Engagement type for attribution (e.g., engaged_view) |
| {{meta::is_fb}} | Whether the install was from Meta |
| {{meta::is_modeled}} | Whether attribution is modeled or deterministic |
| {{meta::is_paid}} | Whether the install was from a paid channel on Meta |
| {{meta::is_view_through}} | Whether attribution was view-through or click-based |
| {{meta::platform_position}} | Ad format shown on the platform |
| {{meta::publisher_platform}} | Platform where the ad was shown (e.g., AUDIENCE_NETWORK, INSTAGRAM, MESSENGER, FACEBOOK) |
| {{meta::view_time}} | Timestamp of the last ad view before attribution |
これらのマクロを使ってイベントを送信する手順については、コールバック設定のページをご確認ください。