I am developing an Android App.
I fire a Google Analytics event when a purchase has been made successfully.
If I compare the Google Play Developer console data with the Google Analytics data, I see a huge difference between them. I mean there are like 40 or 50 events related to successful purchases (for a lot of different type of items), and in the Google play console I don't see them (only 2 or 3 items).
Do you know if the same Google Analytics event can be fired multiple times ?
Is there any possibility my Java code calls the callback function
OnSuccess function of a purchase multiple times (i am using SDKBOX
plugin for cocos2d-x), when a purchase is made?
Notice that I see GA events for items that I have never sold.
Many thanks
My last doubt is the apps that hacks for in-app purchases are sufficiently popular that they could be the reason...
I am not sure and its just a guess. May be your users are using some illegal means to buy in-apps like root or jailbreak.
Related
I have an Android app that has several features available as in-app purchases. We have published the app on both Google Play and the Amazon App Store. We need to stop offering one of the features as of a certain date. However, customers who have already purchased the feature should be able to use it past that date, even if they install the app on a new device. They should also still be able to purchase other features.
I was thinking that we could simply update our app so that the UI offered no option for purchasing the feature in question. However, that would not prevent a user with an older version of the app from purchasing the feature. So it seems like in addition to removing the feature purchase logic from the app (but not the feature itself), we need to do something to turn off the purchase at the store end. But whatever that something is, it must still allow the app to check whether the user had previously purchased the feature.
I've been unable to figure out from the Google Play or Amazon App Store documentation how to set this up. My understanding, from what I've read, is that removing the item (from either store) will cause checks for previous purchases to fail. Is it possible to do what I've described? We need solutions for both stores.
P.S. I did find one related question on SO: Are Google Play in-app purchases still valid if the app or the product is removed? However, it has no answer and also is a little too narrowly framed. (I'm not assuming that the product has to be removed and I also need to know about the Amazon store.)
I was thinking that we could simply update our app so that the UI
offered no option for purchasing the feature in question. However,
that would not prevent a user with an older version of the app from
purchasing the feature. So it seems like in addition to removing the
feature purchase logic from the app (but not the feature itself), we
need to do something to turn off the purchase at the store end.
For Amazon Appstore, you would need to contact their support team to get the in-app item in question suppressed (it's not a self-service as of today). Once suppressed, that in-app item would no longer be purchasable. It would not affect existing users who purchased that item in the past.
When it comes to in-app purchase I always opt for implementing everything in my own server. when a user buys something, I instantly consume it and notify my server. Then instead of querying Google or Amazon, I query my own server which gives me a lot of flexibility. If I face something like your problem I just add few lines of code!
Since you already published your app this may not work for you unless you willing to force users to update the app to the newer version. (Hoping you can do that!)
You mentioned that you don't know what happens if you deactivate the product and there is no documentation, well you can try it on a test project and see what happens! It shouldn't be that hard. If that doesn't work as you expect there is nothing you can do, your logic is in your app and it's already published so...
We're using Firebase Analytics to track our Android app.
We've connected it to our Google Play account in hopes to receive the automatic in_app_purchase events. What we later realized is that does not support in-app subscriptions: https://support.google.com/firebase/answer/6317485?hl=en
How do we track subscription revenue events?
We thought about using the ecommerce_purchase event (https://support.google.com/firebase/answer/6317499?hl=en) so we could track the ARPU, ARPPU and LTV of our users.
The problem we are facing is dealing with subscription recurrence. Should we manually send this event each month/year and stop sending once the subscription is cancelled? It seems like a error-prone hack ...
Any other ideas?
Thanks!
If you want to pursue the technique you described, from your server, you can track whether a google subscription event is active or cancelled via the subscriptions API.
If you poll this API, you should be able to determine when to send the ecommerce_purchase event to firebase.
Here is a ruby example of polling the API for Google Play. You can poll the iTunes API with a similar technique.
supscriptions are a complex thing to measure and track in app, because the app might not get the cancel/change event and therefore continue tracking on something, that does not exist anymore. This leads to corrupt and untrustworthy data.
For that reason, we implemented it as follows:
client side:
We track all creation, changes and cancelations as custom events.
server side:
whenever we charge a subscription, we track this as a "purchase" event. Therefore, the calculated life-time-value of the user is correct and we still have a workflow of all the actions, changes, ... the user made.
I can really recommend this solution, because - even though it is slightly more complex - allows you to follow the full user journey, while having correct firebase stats at the same time.
According to this
https://support.google.com/firebase/answer/6317485?hl=en
in_app_purchase event will be automatically tracked when a user completes an in-app purchase.
The problem occurs with test users.
They are not charged (since they are entered in "Test Accounts" list in google developer console) but in_app_purchase events are tracked for them too.
So, there are discrepancies between analytics and real payments.
Is there a way to separate somehow real and 'test' purchases?
Either, maybe a way to disable automatically tracking for certain events and send them manually? And how to recognize 'test' purchases in this case at runtime (in order to don't send in_app_purchase event)
I know it's a bit late, but putting down my 2-cents here:
I think you might already know that test purchases for Android in Firebase Analytics are accounted for, as mentioned here(see in_app_purchases), "Note: paid app-purchase revenue, subscription revenue (Android only), and refunds are not automatically tracked. Your reported revenue may differ from the values you see in the Google Play Developer Console. Events that are flagged as being invalid or as sandbox (test) are ignored. Only iOS events are flagged as sandbox".
That said, there isn't a way to recognize such purchases at runtime and avoid them from being reported for Android and populating your prod app data. However, there are only a couple of ways to deal with it currently(in my opinion):
Separate your prod data from test data: Look into this document on how to set up a separate app in Firebase to record your test data.
Disable collection of analytics for your test app: As shown here, you can temporarily or permanently disable collection of Firebase Analytics data. It includes the option to be able to disable and enable it at runtime.
Although, I would consider option #2 a little counter-intuitive given your case and go with #1 instead.
Disabling reporting of test purchase data to Analytics at runtime would require 2 things:
Knowledge of how the Google Play system recognizes a test purchase, what event is sent from the user device for such an event, and the ability to recognize/intercept that event.
The option of preventing an event from being reported to Firebase Analytics at runtime.
In this case, #2 definitely does not seem like an option currently. Hence, all we can do here is reach out to Firebase Support and request that feature. But until then, I don't see another way. But I'm curious and open to suggestions if somebody else has. :)
I've been implementing an inapp-purchase solution using the google iab v3 api, and it works perfectly when buying items on one device, but I have stumbled upon one problem.
If a user has several devices on which he logs on with the same account and uses my app I would expect to have the function billingService.getPurchases(...) return the same list of purchases.
This is not the case, if I make different purchases on two devices the list of purchases is (randomly) updated on each device.
My best guess is that this is related to the fact that the google play billingService does internal caching? But if I try to buy one item already bought on another device I get the error: "You already own this item", but the list/cache is still not updated.
Is there anyone with similar experiences?
Do you know if it is possible to force the billingservice to update against the google server?
Is there any known schedule on when the billingservice updates the cache?
Thanks
Bernt-Johan
Simple solution is to launch the Google Play Store App, the internal cache should then be updated.
There are other queries on this, but none seem to provide the answer.
I am trying to implement in-app billing. Code in the real app is based on the dungeons code. I have to managed to get it all working fine on the test ids, but cannot get it to work with a real purchase id. I have:
Signed the app by exporting from eclipse.
Installed this version to the phone.
Uploaded same version to google play, saved it, activated it, but left it unpublished.
Created a managed in-app billing item.
Published that, although I notice that it does say 'item will only take on published state when app is published', no way round that as far as I can see.
Checked carefully that product ids match.
Added a gmail test account, made sure this is the primary account on the phone.
Waited several hours to make sure it gets propagated across all servers.
And all I get is 'item is unavailable for purchase'. It finds the item OK because in the background on the screen under the dialog is all the right info about it.
What is especially annoying is that the exact same billing code when built into a pure test app, does work, and I can purchase a real managed item. So I am sure the logic in the code is working. It just does not work in the real app with the real managed item.
I feel therefore that this must be some sort of fault with what I/Google have done at the developer console end, not in the app code.
Any ideas? I'm at my wits end with the whole in app billing system.
It was just time in the end.Took over two days to sort itself out.