Google Analytics iOS广告系列跟踪和网址构建器

[英]Google Analytics iOS Campaign Tracking and URL Builder

We want to track installs with Google Analytics for our iOS app. What we already done:

我们希望使用Google Analytics跟踪我们iOS应用的安装情况。我们已经做了什么:

  • we have last iOS SDK 3.10
  • 我们有最新的iOS SDK 3.10
  • we enabled idfa collection like it says here
  • 我们启用了像这里所说的idfa集合

idfa enabled

  • Build with IDFA available in AppStore ("ready for sale" in itunes connect)
  • 在AppStore中使用IDFA构建(在itunes connect中“准备出售”)
  • we have a tracking link that was generated using iOS Campaign Tracking URL Builder
  • 我们有一个使用iOS广告系列跟踪网址构建器生成的跟踪链接

enter image description here

Seems everything OK. But tracking link doesn't work. For user, that was redirected from this link, ga:campaign and ga:source are empty in GA database:


enter image description here

And there is nothing in Google Analytics Acquisition, only direct traffic:

Google Analytics Acquisition中没有任何内容,只有直接流量:

enter image description here

We are very confusing about the field Device ID Macro in URL Builder. Is it filled right? Any other ideas how to make the GA tracking work?

我们对URL Builder中的字段设备ID宏非常困惑。填充正确吗?如何使GA跟踪工作的任何其他想法?

3 个解决方案



The information below is only valid for iOS Install Tracking, Campaigns that target users that already have the app and deeplink into them are handled completely different.


This was designed to work with mobile adNetworks. When you create this campaign for your app in an adNetwork you can work with them to know how to pass the deviceId, each network might have its own syntax, and they can work in 2 different methods (ping or redirect).


If you are planning to use this url in a social campaign of some sort, or if you are testing it out by just visiting that url it won't work. Because a browser can't figure out the IDFA only an App can.


This is also the id used by Google Analytics to link an Ad click with the actual installation of the App.

这也是Google Analytics用于将广告点击与应用的实际安装相关联的ID。

Here's how it works for Google Analytics on redirect mode:

以下是重定向模式下Google Analytics的工作原理:

  1. The user is playing candy crush and sees a banner for your app.


  2. The user thinks it's a very sweet app so he clicks on it to install your app.


  3. The mobile network grabs the IDFA from inside candy crush and sends the user to a google analytic redirect url that looks like this:


  4. Google Analytics registers that specific IDFA clicked on your banner for your AppId and stores the campaign parameters for a while associated with this.

    Google Analytics会针对您的AppId注册您的横幅上的特定IDFA,并将广告系列参数存储一段时间与此相关联。

  5. The redirect takes place and the user lands straight at the AppStore for your App.


  6. If everything goes according to plan, the user hopefully installs your app and launches it.


  7. When he/she does so Google Analytics grabs the IDFA and start to register stats for your app, including appId.

    当他/她这样做时,Google Analytics会抓取IDFA并开始为您的应用注册统计信息,包括appId。

  8. Then Google Analytics notice that's the same IDFA that clicked on that link for the same appId just a few minutes ago.

    然后Google Analytics会注意到几分钟之前与同一appId点击该链接的IDFA相同。

  9. Google Analytics assumes the click generated an install and assigns the campaign information to that user.

    Google Analytics(分析)假定点击生成了安装,并将广告系列信息分配给该用户。

Ping mode is pretty much the same except that the adNetwork sends the url to analytics themselves so the user doesn't have to go through a redirect.


So as you can see it's quite a journey, but it should work fine if you:


  • Confirm that iOS campaign tracking is enabled
    • On Admin > Property Settings > iOS Campaign Tracking inside Google Analytics
    • 在Google Analytics中的管理>属性设置> iOS广告系列跟踪
  • 确认已启用iOS广告系列跟踪在Google Analytics中的管理>属性设置> iOS广告系列跟踪中
  • Confirm the appId on your Campaign url matches the appId for your App.
  • 确认您的广告系列网址上的appId与您应用的appId相匹配。
  • Checks with your adNetwork what you should use in the url to be replaced with the user IDFA
  • 与您的adNetwork一起检查您应该在用户名IDFA替换的网址中使用的内容
  • Make sure you have IDFA is being sent from Google Analytics on your app (it's not on by default)
  • 确保您的应用已从Google Analytics发送IDFA(默认情况下不启用)
  • Use the campaign url builder provided by Google.
  • 使用Google提供的广告系列网址构建器。

And for testing you will need to do that through either a live ad or a test version of your ad, if the network provides that.


UPDATE (2015-02-25)

Q: How can you do install tracking for campaigns that don't go through an adNetwork? eg (social campaigns, email campaigns, ...)


A: Google Analytics doesn't have support for that. Other attribution tools might try to fingerprint the user without using the IDFA, using IP address for instance, but that's not reliable, so Google Analytics opted to use only the IDFA.

答:Google Analytics不支持。其他归因工具可能会尝试在不使用IDFA的情况下指导用户,例如使用IP地址,但这不可靠,因此Google Analytics选择仅使用IDFA。

If the campaign is through email you might have other ways to fingerprint. You obviously know the user email, so you can store it in your database and give it a uniqueId. When the user clicks on your mail marketing you can go through a redirect on your systems where you register that userId as a custom dimension and send a hit to GA with campaign information using the measurement protocol through your BackEnd. Then when/if the user logs in your application you get the same userId and send other hits associated with it.


You have to use a uniqueId because the email itself is forbidden inside Google Analytics per TOS. You can't send it there.

您必须使用uniqueId,因为在每个TOS的Google Analytics中禁止使用电子邮件。你不能把它发送到那里。

This solution has other drawbacks as you will get hits for every user that clicks in your campaign in GA, but only those that actually install the APP will have future hits. So you might have inflated sessions with a single hit that never install the App. For that reason I'd recommend sending this to a secondary Google Analytics Web Property to avoid polluting your main property.

此解决方案还有其他一些缺点,因为您可以在GA中点击您的广告系列中的每个用户点击,但只有那些实际安装APP的用户才会有未来点击。因此,您可能会通过一次永不安装App的点击来夸大会话。出于这个原因,我建议将其发送到辅助Google Analytics网络媒体资源,以避免污染您的主要媒体资源。

As you can see it's not a great solution, but it's the only way you can do it. I wouldn't recommend spending time with a solution like this that creates other problems and is not reliable.




Is the information in Eduardos answer still up to date? As I understand it, you are saying that the IDFA can't be used to attribute campaign source if the ad/campaign is not placed within a mobile app? If for example the ad is placed on a web page, the browser can't catch the IDFA, hence no iOS install campaign attribution?


In that case, Google documentation is VERY confusing regarding this topic and I I can't see that they mention that little detail anywhere.


"Google Analytics offers out-of-the-box support for iOS Install Campaign Measurement for popular networks and provides the ability to generate your own custom URLs for any additional networks."

“Google Analytics为流行网络提供了对iOS安装广告系列衡量的开箱即用支持,并且可以为任何其他网络生成自己的自定义网址。”

Another related question: It should at least be possible to track general campaign sources (not install tracking) like described below, right?


"After an app has been installed, it may be launched by referrals from ad campaigns, websites, or other apps. In this scenario, referring traffic sources or marketing campaigns can be attributed to user activity in subsequent sessions by setting the campaign fields on a tracker directly."




yes, what Eduardo was saying is still true.


For iOS, Google uses IDFA to uniquesly identify a user. Therefore, any ad click that happens in an app is trackable as Google has access to IDFA. In a browser since the IDFA isn't available and as the APpStore doen'st pass a referrer to the app like in Android, it's not possible to track iOS conversions on mobile display network or mSearch.


One of the newest updates from our Google rep was: "With the new web bridge, you should be able to see Downloads for mSearch/mGDN in the next couple of weeks if you're using a supported SDK". So Google is working on it and we should be able to measure conversions even from web.

来自我们Google代表的最新更新之一是:“使用新的网桥,如果您使用支持的SDK,您应该能够在接下来的几周内看到mSearch / mGDN的下载”。所以谷歌正在努力,我们应该能够衡量甚至来自网络的转化。

Currently available solution to track everything is to installs Firebase SDK or 3rd party SDK like Tune etc.

目前可用的跟踪所有内容的解决方案是安装Firebase SDK或第三方SDK,如Tune等。



© 2014-2019 粤ICP备14056181号