宏
宏(Macro)是在链接服务器的请求中动态更改的占位符值。虽然 Tenjin 为集成的广告投放渠道预先配置了宏,但是了解宏的工作方式对你添加自定义渠道很有用。
为什么需要宏?
我们需要固定的跟踪链接中的宏传递动态数据。
我们详细的介绍归因过程中链接,参数,值和动态更改值是如何工作的。
链接和参数
先来看一个标准的链接:
https://track.tenjin.io?param1=value1
。 在链接中你可以看到服务器地址 track.tenjin.io
和一个单独参数 param1
的值是 value1
。当这个链接触发 track.tenjin.io
服务器时, Tenjin 的服务器通过读取链接并解析参数和值,这里 param1
设置为 value1
。
在更实际的情况中, https://track.tenjin.io?advertising_id=xyz123&country=US
这条链接有2个参数(advertising_id
和 country
)和两个值。当这个请求到达 Tenjin 服务器 track.tenjin.io
时,我们就知道时 advertising_id
触发的是设备 xyz123
并带有 country
值为 US
。
动态参数值
现在,我们知道将参数和值如何传递到服务器,下面让我们看一下在归因和跟踪的时候链接是如何工作的。
为了让 Tenjin 对用户的点击 或 展示进行归因,Tenjin 收集每次点击个展示的设备信息和属性,这些数据用来和 App 安装的设备数据进行匹配。
每当你为非自归因或自定义渠道创建广告计划时,都会在 Tenjin 生成追踪链接。此跟踪链接包含的宏,可动态适应点击或展示周围的变化值。宏被用作在特定链接中会更改的值的占位符。
假设你要在非自归因]渠道上运行广告计划。你可以通过 Tenjin 控制面板创建跟踪链接,并将链接放到你的广告投放渠道。
Tenjin 的追踪链接看起来大概是这个样子的:
https://track.tenjin.io?advertising_id={idfa}&country={country}
这里的 {idfa}
和 {country}
就是宏。当一个设备使用这个链接是,广告投放渠道就会在这些宏里填上实际的信息。用上面的例子 {idfa}
和 {country}
分别会是 xyz123
和 US
。
信息填好之后,广告投放渠道就会用一下链接通知 Tenjin 的服务器:
https://track.tenjin.io?advertising_id=xyz123&country=US
Alternatively, if the user's device changed and had an另外,如果用户的设备改变,有 abc234
的advertising_id
和 country
为 CA
,链接将会是:
https://track.tenjin.io?advertising_id=abc234&country=CA
如你所见,这些方案使用相同的链接,但是会根据使用设备/用户的情况来更改跟踪链接的值。
宏允许广告投放渠道为每个用户修改点击/展示的链接。这些宏只是当不同用户与跟踪链接进行交互时所更改的占位符值。
宏在跟踪链接中的作用
每个广告投放渠道针对以下设备属性都有自己的点击和展示宏:
- Advertising ID
- IP address
- Bundle ID
- Country
- Click ID
- Site
- OS Platform
- Limit Ad Tracking
- Creative
如果广告投放渠道已与Tenjin集成并预先配置,则每个广告网络的宏将自动显示在每个广告计划的每个点击链接或展示跟踪链接上。
比如:
- Applovin
advertising_id
的宏看起来这样:{IDFA}
- Tapjoy
advertising_id
的宏看起来这样:TAPJOY_ADVERTISING_ID
Applovin 和 Tapjoy 的点击链接可能看起来像这样:
- Applovin:
https://track.tenjin.io/v0/id?advertising_id={IDFA}
- Tapjoy:
https://track.tenjin.io/v0/id?advertising_id=TAPJOY_ADVERTISING_ID
同样,每个渠道都有自己的宏格式。如果该网络已经与Tenjin预集成,则无需担心。这仅仅是为了让你知道点击和展示链接是如何工组成的。
Tenjin 回调和路由事件中的宏
设置对另一服务的 Tenjin 回调时,你可以使用宏来表示动态更改的数据值,以发送给其他服务器/服务。这就是我们所说的“routing”。
Tenjin允许你将实时事件数据实时路由到其他服务器。
这是在将数据发送到其他服务时可以设置的可用回调宏的列表。
Macro | 说明 |
---|---|
{{bundle_id}} | Bundle ID of the app. (com.tenjin.wordfinder) |
{{lowercase_bundle_id}} | Lower case of bundle ID of the app. (com.tenjin.wordfinder) |
{{platform}} | Platform of the app (ios) |
{{store_id}} | App Store ID of the app (887212194) |
{{time_in_ms}} | Request time in milliseconds |
{{time_in_seconds}} | Request time in seconds |
{{time_iso8601}} | Request time in ISO 8601 format |
{{engaged_at_s}} | Timestamp for click or impression event in seconds |
{{engaged_at_ms}} | Timestamp for click or impression event in milliseconds |
{{acquired_at_s}} | Timestamp for install event in seconds |
{{acquired_at_ms}} | Timestamp for install event in milliseconds |
{{advertising_id}} | Advertising identifier of the device |
{{lowercase_advertising_id}} | Lower case of advertising identifier of the device |
{{md5_advertising_id}} | MD5 of the advertising identifier |
{{developer_device_id}} | Identifier for Vendor (IDFV) or the developer device ID |
{{allow_ad_tracking}} | Device allows ad tracking? (true, false) |
{{limit_ad_tracking}} | Device limits ad tracking? (true, false) |
{{allow_ad_tracking_integer}} | Device allows ad tracking? (1, 0) |
{{limit_ad_tracking_integer}} | Device limits ad tracking? (1, 0) |
{{ip_address}} | User's IP address |
{{country}} | Country code of the user's device |
{{campaign_name}} | Tenjin Campaign Name that the user is attributed to |
{{campaign_name_encoded}} | Encoded Tenjin Campaign Name that the user is attributed to |
{{tenjin_campaign_id}} | Tenjin Campaign ID that the user is attributed to |
{{remote_campaign_id}} | Channel's Campaign ID that the user is attributed to |
{{click_id}} | Channel's click ID if the user is attributed to paid channels |
{{referrer}} | Android referrer |
{{site_id}} | Channel's site ID that a user is attributed to |
{{site_id_encoded}} | Encoded channel's site ID that a user is attributed to |
{{ad_network}} | Channel name that a user is attributed to |
{{revenue}} | Gross revenue earned for a purchase in original currency |
{{currency}} | Currency code of the purchase |
{{revenue_usd_net}} | Net revenue in USD for a purchase |
{{revenue_usd_gross}} | Gross revenue in USD for a purchase |
{{device}} | User's device |
{{os_version}} | User's OS version |
{{app_version}} | User's app version |
{{sdk_version}} | User's Tenjin SDK version |
{{language}} | User's language setting |
{{user_agent}} | User's user agent |
{{value}} | Custom event value |
{{creative_name}} | Creative name |
{{device_brand}} | Device brand |
{{device_model}} | Device model |
{{carrier}} | Device carrier |
{{connection_type}} | Connection type |
{{locale}} | Device locale |
{{timezone}} | Device timezone |
{{tracking_status}} | Integer for the iOS device's ATT status. 0 => not determined, 1 => restricted, 2 => denied, 3 => authorized |
{{tenjin_parameter_0}} | Pass through macro you can pass through from click url |
{{tenjin_parameter_1}} | Pass through macro you can pass through from click url |
{{tenjin_parameter_2}} | Pass through macro you can pass through from click url |
{{tenjin_parameter_3}} | Pass through macro you can pass through from click url |
{{tenjin_parameter_4}} | Pass through macro you can pass through from click url |
{{tenjin_parameter_5}} | Pass through macro you can pass through from click url |
你可以在路由部分阅读更多关于 Routing 和宏的信息。