Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The easiest way is using <strong><code>adb</code></strong>. You don't have to write any code.</p> <p>Just <strong>run in a terminal</strong>:</p> <pre><code>adb shell am broadcast -a com.android.vending.INSTALL_REFERRER -n &lt;your.package&gt;/.&lt;path.up.until.your.BroadcastReceiver&gt; --es "referrer" "utm_source=test_source\&amp;utm_medium=test_medium\&amp;utm_term=test_term\&amp;utm_content=test_content\&amp;utm_campaign=test_name" </code></pre> <p>Here's my exact line:</p> <pre><code>am broadcast -a com.android.vending.INSTALL_REFERRER -n net.lp.collectionista/.util.broadcast_receivers.FacadeBroadcastReceiver --es "referrer" "utm_source=test_source\&amp;utm_medium=test_medium\&amp;utm_term=test_term\&amp;utm_content=test_content\&amp;utm_campaign=test_name" </code></pre> <p>But your <code>BroadcastReceiver</code> may need to be the <code>AnalyticsReceiver</code>, i.e. </p> <p>For Google Analytics v2:</p> <blockquote> <p>com.your.package/com.google.analytics.tracking.android.CampaignTrackingReceiver</p> </blockquote> <p>For Google Analytics v3:</p> <blockquote> <p>com.your.package/com.google.android.apps.analytics.AnalyticsReceiver</p> </blockquote> <p>For Google Analytics v4:</p> <blockquote> <p>com.your.package/com.google.android.gms.analytics.CampaignTrackingReceiver</p> </blockquote> <p>As Luigi said, you can also leave out the <code>"-n"</code> componentname part, but then every app on your device will receive the referral. This can be a good extra test to see if your <code>BroadcastReceiver</code> can be found properly.</p> <p>The output I see (especially the last line is important):</p> <pre><code>05-13 17:28:08.335: D/Collectionista FacadeBroadcastReceiver(8525): Receiver called 05-13 17:28:08.335: V/Collectionista FacadeBroadcastReceiver(8525): Receiver called with action: com.android.vending.INSTALL_REFERRER 05-13 17:28:08.365: D/GoogleAnalyticsTracker(8525): Stored referrer:utmcsr=test_source|utmccn=test_name|utmcmd=test_medium|utmctr=test_term|utmcct=test_content </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload