如何在Android应用程序中获取Google Play引荐来源网址 [英] How to get Google Play referer in an Android application

查看:651
本文介绍了如何在Android应用程序中获取Google Play引荐来源网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在开发一个Android应用程序.而且我们想跟踪我们的能力.基本上,我们希望与合作伙伴一起在Google Play URL中放置一个单词,然后在应用程序中检索该单词,然后将其发送到我们的服务器.

我们已经将Google Analytics(分析)安装到了我们的应用程序中,我们能够在Google统计板上跟踪用户在应用程序中的操作.但是,我们如何使用它来实现我们真正想要的呢?我们确实需要用这个词将用户数据库链接起来.

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

解决方案

您正在寻找 Google Play广告系列归因

Google Play广告系列评估功能可让您查看哪些广告系列和点击量来源向用户发送了从Google Play商店下载您的应用的信息.建议所有开发人员都实施Google Play商店广告系列评估.

实施Google Play广告系列归因

从Google Play商店下载您的应用后,Play商店应用会在安装过程中向您的应用广播INSTALL_REFERRER意向.此意图包含用于访问应用程序的Google Play商店页面的链接的referrer参数的值(如果存在的话).

要将应用程序下载归因于广告系列,您必须在指向Google Play商店的任何链接中添加referrer参数,并向您的应用程序添加BroadcastReceiver以接收并设置意图中包含的广告系列信息在您的Google Analytics(分析)跟踪器上.

建议大多数开发人员使用SDK随附的BroadcastReceiver.要使用随附的接收器实施Google Play商店广告系列衡量,

1.将Google Analytics(分析)接收器添加到您的AndroidManifest .xml文件中..要将Google Analytics(分析)接收器添加到清单中,请复制并粘贴以下标记:

    <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. 将Google Analytics(分析)广告系列参数添加到Google Play网址

    接下来,在将直接链接到Google Play商店的所有URL中添加referrer参数,并将该参数的值设置为描述来源的Google Analytics(分析)广告系列参数的字符串,如下例所示:

    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

要了解如何构建广告系列参数字符串,请使用 Google Play URL Builder ,或咨询广告系列参数参考部分.

测试Google Play广告系列归因

要在发布您的应用之前验证您的Google Play广告系列评估实施是否按预期工作,请使用测试Google Play广告系列归因解决方案指南.

此外,请参见此类似文章.

We are developping an Android application. And we want to track our compaigns. Basically, we want to know from where our users arrives to Google play, by putting a word in the Google Play URL with our parteners and retrieve that word in the application and then send it to our server.

We have already installed Google Analytics to our application, we are able to track what the user does in the application on the Google statistics board. But how can we use it to achieve what we really want ? We really need to link our users data base with that word.

I heard about INSTALL_REFERER, but I really don't know how to use it.

解决方案

You are looking for Campaign Measurement. In the documentation, it discusses how using INSTALL_REFERRER will help you determine which source is sending users to your App in the Google Play Store.

It's as simple as placing a receiver in your AndroidManifest and modifying your App's Google Play URLs.

From the docs:

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.

Also, see this similar post.

这篇关于如何在Android应用程序中获取Google Play引荐来源网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆