gpt4 book ai didi

android - 如何在 Android 应用程序中获取 Google Play 引荐来源网址

转载 作者:行者123 更新时间:2023-12-02 16:23:46 25 4
gpt4 key购买 nike

我们正在开发一个 Android 应用程序。我们想要跟踪我们的 Activity 。基本上,我们希望通过与合作伙伴在 Google Play 网址中输入一个单词并在应用程序中检索该单词,然后将其发送到我们的服务器来了解用户从哪里到达 Google Play。

我们已经在我们的应用程序中安装了 Google Analytics,我们能够在 Google 统计板上跟踪用户在应用程序中执行的操作。但我们如何利用它来实现我们真正想要的呢?我们确实需要将我们的用户数据库与该词链接起来。

我听说过 INSTALL_REFERER,但我真的不知道如何使用它。

最佳答案

您正在寻找Campaign Measurement 。在文档中,它讨论了如何使用 INSTALL_REFERRER 帮助您确定哪个来源将用户引导至 Google Play 商店中的您的应用。

这就像在 AndroidManifest 中放置接收器并修改应用的 Google Play URL 一样简单。

来自文档:

Google Play Campaign Attribution

Google Play Campaign Measurement allows you to see which campaigns and traffic sources are sending users to download your app from the Google Play Store. It is recommended that all developers implement Google Play Store Campaign Measurement.

Implementing Google Play Campaign Attribution

When your app is downloaded from Google Play Store, the Play Store app broadcasts an INSTALL_REFERRER intent to your app during installation. This intent contains the value of the referrer parameter of the link used to reach your app's Google Play Store page, if one was present.

To attribute an app download to a campaign, you must add a referrer parameter to any links that point to Google Play Store, and add a BroadcastReceiver to your app to receive and set the campaign information contained in the intent on your Google Analytics tracker.

It is recommended that most developers use the BroadcastReceiver provided with the SDK. To implement Google Play Store Campaign Measurement using the included receiver:

1. Add the Google Analytics receiver to your AndroidManifest.xml file. To add the Google Analytics receiver to the manifest, copy and paste the following markup:

    <application>
<!-- Used for Google Play Store Campaign Measurement-->
<receiver android:name="com.google.android.gms.analytics.CampaignTrackingReceiver"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<service android:name="com.google.android.gms.analytics.CampaignTrackingService"
android:enabled="true"
android:exported="false" />
</application>
  1. Add Google Analytics Campaign Parameters to Google Play URLs

    Next, add a referrer parameter to any URLs that will be linking directly to Google Play Store and set the value of that parameter to a string of Google Analytics campaign parameters that describe the source, as in this example:

    https://play.google.com/store/apps/details?id=com.example.application &referrer=utm_source%3Dgoogle %26utm_medium%3Dcpc %26utm_term%3Drunning%252Bshoes %26utm_content%3Dlogolink %26utm_campaign%3Dspring_sale

To learn how to build a campaign parameter strings, use the Google Play URL Builder, or consult the Campaign Parameters reference section.

Testing Google Play Campaign Attribution

To verify that your Google Play Campaign Measurement implementation is working as expected before publishing your app, use the Testing Google Play Campaign Attribution Solution Guide.

另外,请参阅此 similar post .

关于android - 如何在 Android 应用程序中获取 Google Play 引荐来源网址,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43895757/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com