Google App Invites: Tracking Invites

2019-06-07 04:35发布

问题:

I'm trying to understand this part of the guide (https://developers.google.com/app-invites/android/guides/app):

Tracking Invitations

After your app has received an invitation and taken the intended actions, it should call the updateInvitationOnAppInstalled method to mark the invitation as successful:

private void updateInvitationStatus(Intent intent) {
    String invitationId = AppInviteReferral.getInvitationId(intent);

    // Note: these  calls return PendingResult(s), so one could also wait to see
    // if this succeeds instead of using fire-and-forget, as is shown here
    if (AppInviteReferral.isOpenedFromPlayStore(intent)) {
        AppInvite.AppInviteApi.updateInvitationOnInstall(mGoogleApiClient,invitationId);

    }

    // If your invitation contains deep link information such as a coupon code, you may
    // want to wait to call `convertInvitation` until the time when the user actually
    // uses the deep link data, rather than immediately upon receipt
    AppInvite.AppInviteApi.convertInvitation(mGoogleApiClient, invitationId);
}

The code above requires a connected GoogleApiClient with AppInvite.API enabled.

I see you can track app invites with AppInvite.API but I don't see a way in which one can view the stats after tracking it.

The AppInviteApi just says the following:

The main entry point for interacting with AppInvite invitations. This class provides a method to update invitation status after receiving an invitation id after app installation.

Link to AppInviteApi docs

How can I view what I'm tracking? I opened a Google Analytics account but it will only display data in 1-2 days and I doubt it will even be displayed there as from my understanding, Google Analytics is optional when using Google App Invites.

回答1:

Does this link help at all?: https://developers.google.com/app-invites/android/guides/analytics

Just checking, as there is a lot more to it than simple opening an account in Google Analytics.



回答2:

I don't know if you found a way to solve your problem but I'm currently having the same problem. I see nothing on my Google Analytics dashboard. Moreover I do not see antyhing on logs when i'm using thoses commands in terminal

adb shell setprop log.tag.GAv4 DEBUG
adb logcat -s GAv4 

In thoses logs I can see custom events I implemented like favorite items...

Hit delivery requested [...........]
Hit sent to the device AnalyticsService for delivery

When I'm looking at widget called Invitation Actions Totals I can see it uses a regular expression on event categorie to match invitation.

So maybe we have to handle it manually. I mean, maybe we have to use HitBuilders.EventBuilder() to build and send custom event.

For example, when user send an invite we have to use:

Tracker t = ((AnalyticsApplication) activity.getApplication()).getDefaultTracker();

t.send(new HitBuilders.EventBuilder()
    .setCategory("invitation")
    .setAction("sent")
    .build());

And when user open the app from an invite:

Tracker t = ((AnalyticsApplication) activity.getApplication()).getDefaultTracker();

t.send(new HitBuilders.EventBuilder()
    .setCategory("invitation")
    .setAction("completed")
    .build());

And to be more accurate we could use the setLabel method to define the invite ID.

I haven't tested it so far. I don't know if we have to handle it this way or if AppInvite handle it automatically. But we probably have to handle it manually because we can use App Invite without Google Analytics...



回答3:

Use Firebase Invites to drive app referrals and sharing through email or SMS

By combining the power of word of mouth with a frictionless and personalized onboarding flow, Firebase Invites help drive installs by enabling your users to share an app or their favorite in-app content with people they know. Firebase Invites help you optimize an important means of app discovery — according to a Google and Ipsos MediaCT survey, 52% of people say they discover apps through word of mouth.

Firebase Link

Referral link