Niedzielski has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/223990

Change subject: Fix InstallReferrerFunnel reporting
......................................................................

Fix InstallReferrerFunnel reporting

The previous Funnel refactor and InstallRefererFunnel merged at about
the same time and neither accounted for the other. This patch fixes
install referrer event logging.

Tested with (dev flavor):
adb shell am broadcast -a com.android.vending.INSTALL_REFERRER \
  -n org.wikipedia.dev/org.wikipedia.analytics.InstallReferrerReceiver \
  --es "referrer" "referrer_url=foo&campaign_id=bar&install_id=buzz"

Change-Id: Idc4bda341d7440d93fb5daa36453047b21ba0e6e
---
M wikipedia/src/main/java/org/wikipedia/analytics/InstallReferrerFunnel.java
M wikipedia/src/main/java/org/wikipedia/analytics/InstallReferrerReceiver.java
2 files changed, 6 insertions(+), 25 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/90/223990/1

diff --git 
a/wikipedia/src/main/java/org/wikipedia/analytics/InstallReferrerFunnel.java 
b/wikipedia/src/main/java/org/wikipedia/analytics/InstallReferrerFunnel.java
index 1097e98..dbf60f6 100644
--- a/wikipedia/src/main/java/org/wikipedia/analytics/InstallReferrerFunnel.java
+++ b/wikipedia/src/main/java/org/wikipedia/analytics/InstallReferrerFunnel.java
@@ -1,5 +1,7 @@
 package org.wikipedia.analytics;
 
+import android.support.annotation.NonNull;
+
 import org.json.JSONException;
 import org.json.JSONObject;
 import org.wikipedia.Site;
@@ -15,30 +17,8 @@
     public static final String PARAM_CAMPAIGN_ID = "campaign_id";
     public static final String PARAM_CAMPAIGN_INSTALL_ID = "install_id";
 
-    private final String appInstallID;
-    private final Site site;
-
-    public InstallReferrerFunnel(WikipediaApp app, Site site) {
+    public InstallReferrerFunnel(WikipediaApp app) {
         super(app, SCHEMA_NAME, REV_ID);
-
-        //Retrieve this app installation's unique ID, used to record unique 
users of features
-        appInstallID = app.getAppInstallID();
-
-        this.site = site;
-    }
-
-    @Override
-    protected JSONObject preprocessData(JSONObject eventData) {
-        try {
-            eventData.put("appInstallID", appInstallID);
-        } catch (JSONException e) {
-            throw new RuntimeException(e);
-        }
-        return eventData;
-    }
-
-    protected void log(Object... params) {
-        super.log(site, params);
     }
 
     public void logInstall(String referrerUrl, String campaignID, String 
campaignInstallID) {
@@ -48,4 +28,6 @@
                 PARAM_CAMPAIGN_INSTALL_ID, campaignInstallID
         );
     }
+
+    @Override protected void preprocessSessionToken(@NonNull JSONObject 
eventData) { }
 }
diff --git 
a/wikipedia/src/main/java/org/wikipedia/analytics/InstallReferrerReceiver.java 
b/wikipedia/src/main/java/org/wikipedia/analytics/InstallReferrerReceiver.java
index d0c4e06..0dd3115 100644
--- 
a/wikipedia/src/main/java/org/wikipedia/analytics/InstallReferrerReceiver.java
+++ 
b/wikipedia/src/main/java/org/wikipedia/analytics/InstallReferrerReceiver.java
@@ -37,8 +37,7 @@
 
         // initialize the funnel with a dummy Site, since this is happening 
outside of
         // any kind of browsing or site interactions.
-        InstallReferrerFunnel funnel = new 
InstallReferrerFunnel(WikipediaApp.getInstance(),
-                                                                 
Site.forLanguage("test"));
+        InstallReferrerFunnel funnel = new 
InstallReferrerFunnel(WikipediaApp.getInstance());
         // and send the event!
         
funnel.logInstall(uri.getQueryParameter(InstallReferrerFunnel.PARAM_REFERRER_URL),
                           
uri.getQueryParameter(InstallReferrerFunnel.PARAM_CAMPAIGN_ID),

-- 
To view, visit https://gerrit.wikimedia.org/r/223990
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idc4bda341d7440d93fb5daa36453047b21ba0e6e
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Niedzielski <sniedziel...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to