Wizcorp / phonegap-facebook-plugin

The official plugin for Facebook in Apache Cordova/PhoneGap
Other
1.9k stars 2.01k forks source link

can not count the number of application installations for Android #877

Open helsen opened 9 years ago

helsen commented 9 years ago

I made the basic configuration of the plugin for counting application installations . For iOS it's perfectly, when user install app, Insight show me new installations correctly like: (Date: 12/21/14 02:13:22 | Client: iOS | App version: 1.0.3 | Event: App Installs).

For Android, log don't show Client, Insight show me installations event like: (Date: 12/21/14 02:13:22 | Client: unknown | App version: 1.0.3 | Event: App Installs).

As a result, Facebook App Install Campaign cannot track App Installs for Android.

Phonegap version 3.6.3 Phonegap-facebook-plugin : 0.9.0 APK generated with phonegap build.

felquis commented 9 years ago

@helsen witch method you use to get these information?

helsen commented 9 years ago

@felquis access step by step: 1- https://developers.facebook.com/tools/ 2- Click APP Insights 3- Click in my app 4- Click APP EVENTS Tab 5- Click Show Most Recent Events

PS: This panel stop to show my Android Events on the last week :(

aogilvie commented 9 years ago

Yes I think for Android this line needs to be changed: https://github.com/Wizcorp/phonegap-facebook-plugin/blob/master/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java#L80 to add the app id because we don't pass meta data in the AndroidManifest.xml

Google guide here http://blog.conjure.co.uk/2015/01/facebook-app-event-logging-tutorial-for-android-studio/ (apart from adding activateApp to onPause I think is incorrect)

helsen commented 9 years ago

@aogilvie just FYI, after downgrade plugin 0.8.0 in my android (phonegap build), I fixed my problem. Now facebook ads track instalations on android.

strazi commented 9 years ago

Where would the appId need to be added? I'm able to send all events manually, I just can't get it to work automatically.

mecampbellsoup commented 9 years ago

@helsen any particular reason why you tracked the 0.8.0 release? I'm experiencing your same issue.

helsen commented 9 years ago

@matiasleidemer no, just because 0.8.0 track some installs (for me 0.9 can't track any installs). But after 15 days of facebook ads with 0.8, I can say that 0.8 don't track all facebook installs. :(

strazi commented 9 years ago

I manually added a:

facebookConnectPlugin.logEvent('fb_mobile_activate_app');

at the startup of my app and it seems to be working okay. Never got the automatic session stuff working.

rmvgaines commented 9 years ago

I was having similar problems (Inconsistent firing of automated "App Installs" and "App Launches" events), however my symptoms differed slightly from those provided by @helsen in that I found the behavior identical in 0.8.0 and 0.11.0. In both cases, I found that manually sending an event caused the "App Installs" and "App Launches" to go ahead and log. My guess is that this is related to AppEventsLogger flushing, but I only have limited experience with the Facebook SDK, so I may well be wrong.

digaobarbosa commented 8 years ago

I was having the same problem. Debugging my application, I saw that that the onResume (which calls activateApp) was not being called.

I changed the plugin source code to be onload=true. So it get initialized at startup. Fixes this for me, but I don't know if it's the best solution. I made a pull request for this: https://github.com/Wizcorp/phonegap-facebook-plugin/pull/1161