Cordova / phonegap tracking APPs install with Face

2020-07-18 11:03发布

问题:

Related question: How do I implement Facebook Mobile Install Ad tracking in Phonegap/Cordova project?

I have a working cordova/phonegap application. I would like to track the APP install using the plugin facebook. I installed the cordova facebook connect plugin with:

cordova plugin add https://github.com/phonegap/phonegap-facebook-plugin.git --variable APP_ID="myappid" --variable APP_NAME="myappname"

The plugin is installed and usable as this report 'true':

alert('fb plugin usable: ' + typeof facebookConnectPlugin != 'undefined')

However I am no seeing anything in the "Most recently logged events" in the facebook developer section for this app. I added the correct Package Name and Class Name in the settings but the events are not just showing up.

Is there anything that I am missing or more info that I can provide ? I cannot find a good tutorial on this that explains the full process.

Should the APP install event just be logged by adding the plugin without any JS call in the app?

回答1:

I dug a bit in the plugin implementation and noted the activateApp was not implement at all. I cloned the repo and add the functionality for Android [following the FB guide for android ]:

The modifications required on the code are: code changes in plugin and : how to use in the JS code. In this way I can just call

facebookConnectPlugin.activateApp(fb_success, fb_fail);

where the callbacks are just dummy empty function.

and the FB is SDK tracks when there is an installation. I noticed however that the events are generated only when there is a FB app installed on the device [do not know if this is supposed to be like that].

UPDATE Probably my solution is old, I guess that now the official plugin for Facebook has already the feature implemented directly without the need of any additional customization in the JS files or touching the Java files.