Update IAB tracking

pull/384/head
Alex Baker 9 years ago
parent 1e652e5e33
commit 187f174c90

@ -59,12 +59,11 @@ public class Tracker {
.build());
}
public void reportIabResult(IabResult result, Purchase info) {
public void reportIabResult(IabResult result, String sku) {
tracker.send(new HitBuilders.EventBuilder()
.setCategory(context.getString(R.string.tracking_category_iab))
.setAction(context.getString(R.string.tracking_action_purchase))
.setLabel(info != null ? info.getSku() : "")
.setValue(result.getResponse())
.setAction(sku)
.setLabel(result.getMessage())
.build());
}
}

@ -44,7 +44,6 @@ public class PurchaseHelper implements IabHelper.OnIabSetupFinishedListener {
@Inject
public PurchaseHelper(@ForApplication Context context, Preferences preferences, Tracker tracker,
Broadcaster broadcaster, InventoryHelper inventory) {
Timber.d("Injecting new PurchaseHelper");
this.context = context;
this.preferences = preferences;
this.tracker = tracker;
@ -158,7 +157,7 @@ public class PurchaseHelper implements IabHelper.OnIabSetupFinishedListener {
@Override
public void onIabPurchaseFinished(IabResult result, Purchase info) {
Timber.d(result.toString());
tracker.reportIabResult(result, info);
tracker.reportIabResult(result, sku);
if (result.isSuccess()) {
if (!Strings.isNullOrEmpty(pref)) {
preferences.setBoolean(pref, true);

@ -92,9 +92,7 @@ public class DashClockExtension extends InjectingDashClockExtension {
.icon(R.drawable.ic_check_white_24dp)
.status(getString(R.string.buy))
.expandedTitle(getString(R.string.buy_dashclock_extension))
.clickIntent(new Intent(this, DashClockSettings.class) {{
setFlags(FLAG_ACTIVITY_NEW_TASK);
}}));
.clickIntent(new Intent(this, DashClockSettings.class)));
}
}
}

@ -285,7 +285,6 @@
<string name="tracking_category_preferences">Preferences</string>
<string name="tracking_category_iab">IAB</string>
<string name="tracking_action_set">Set</string>
<string name="tracking_action_purchase">Purchase</string>
<string name="p_tesla_unread_enabled">tesla_unread_enabled</string>
<string name="p_purchased_tesla_unread">purchased_tesla_unread</string>
<string name="p_purchased_tasker">purchased_tasker</string>

Loading…
Cancel
Save