Facebook Analytics

Hi Scott,

My builds are succeeding but when I try to run my app in Xcode simulator I get this error.

Runtime error: module 'plugin.facebookAnalytics' not found:resource (plugin.facebookAnalytics.lu) does not exist in archive

My build.settings and main.lua are set up correctly, I think. If you don’t know of an immediate issue that could be causing this, I’ll post them for you.

Of note, in my console log when I build for the simulator it shows this

Apr 10 22:55:10.182 Analyzing plugins...Apr 10 22:55:10.182 Found native plugin: /Users/craigjanis/Desktop/Playmatic.app/.build/plugin.facebook.v4 Apr 10 22:55:10.183 Found native plugin: /Users/craigjanis/Desktop/Playmatic.app/.build/plugin.flurry.analytics                     Done.                                          Analyzing Lua plugins... Apr 10 22:55:10.183 Examining plugin: plugin.facebook.v4                     Examining plugin: plugin.flurry.analytics                     Examining plugin: plugin.facebookAnalytics                     Done.

It doesn’t show that the facebookAnalytics plugin is found, but it does seem to be “examining” it, whatever that means.

If you believe there is a bug file it here
https://docs.google.com/forms/d/e/1FAIpQLSf-V3z-V3FZ5y9Sb19cxVfjx7fSRV9HIbpAGptN7DaY3Ki_DA/viewform

Ok, I submitted it.

Scott - thanks for making the plugin. The documentation says to use the following require in the lua file:

local facebook = require("plugin.facebook.v4") local facebookAnalytics = require "plugin.facebookAnalytics" facebookAnalytics.init()

But given that Corona now uses v4a. Should that first line be this instead? thx!

local facebook = require( "plugin.facebook.v4a" )

You can use either

I’ve got trouble using custom events and multiple parameters:

Here is the event I tried:

facebookAnalytics.logEvent(“Hello game3”, {myParams = “hello”, myParams2 = 3})

But when I try to make a segment in the facebook console, I can see the first “myParams”, but I can’t see the “myParams2”. Has anyone already tried to use the plugin with multiple parameters?

I’m not quite sure about how to use it. The doc tells :

– params(number)(optional) other params of eventhere(App Event Schema)

But I expected params to be a lua table not a number. What am I missing?

Can you file a bug report

https://docs.google.com/forms/d/e/1FAIpQLSf-V3z-V3FZ5y9Sb19cxVfjx7fSRV9HIbpAGptN7DaY3Ki_DA/viewform

I’ve filled a bug report. Basically, my conclusions after in depth testings are:

-You can’t pass both parameters and a valueToSum in the same event.

-You can’t set parameters value to a number. It only works if it’s a string.

Any news about those bugs? I really need to, at least, be able to send events with a valueToSum and a parameter without this parameter being ignored.

It’s the second event type described in the documentation of the plugin:

facebookAnalytics.logEvent(“Hello world”, 100, {world = “hello”})

But it’s not working. I mean when calling this event, the param world is not sent. I’m sad the plugin sample does not include such event.

Also the fact that parameters cannot be number is annoying to make some decent analytics.

This has been patched

Hi Scott, 

Thanks for a plugin! 

My question is: can I use option “Log In-App Purchase Events Automatically on Andoird” ? Does this feature work for Corona + your plugin?

I don’t think so. I have to use corona’s facebook sdk so whichever version of the sdk they use I am stuck with. They use 4.16 I believe, I have not asked them in a while but don’t believe they have made any changes in a while. According to the facebook docs version, 4.27 is required. So there is not much I can do.
I do have a manual way
facebookAnalytics.logPurchase(cost, currency)
https://scotth.tech/plugin-facebookAnalytics

Hello

Help me please

http://joxi.net/krDJZ98HER1ed2

What have I to write in the field of “Main class”?

I don’t find any information at Corona SDK Docs

com.ansca.corona.CoronaActivity

Hi Scott

FacebookAnalytics broke on Android after Corona updated the Facebook SDK recently.

When I build (2019.3552) for android my app crashes when calling facebookAnalytics.init().

Same code used to build fine and I did no changes.

Here is the stack trace:

analytics.lua:122: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Context android.content.Context.getApplicationContext()' on a null object referenceJava Stack Trace: com.facebook.FacebookSdk.publishInstallAsync(FacebookSdk.java:619) com.facebook.appevents.AppEventsLoggerImpl.activateApp(AppEventsLoggerImpl.java:113) com.facebook.appevents.AppEventsLogger.activateApp(AppEventsLogger.java:200) com.facebook.appevents.AppEventsLogger.activateApp(AppEventsLogger.java:209) plugin.facebookAnalytics.LuaLoader$init.invoke(LuaLoader.java:168) com.ansca.corona.JavaToNativeShim.nativeRender(Native Method) com.ansca.corona.JavaToNativeShim.render(JavaToNativeShim.java:220) com.ansca.corona.Controller.updateRuntimeState(Controller.java:382) com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onDrawFrame(CoronaGLSurfaceView.java:450) com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1625) com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1380) -  stack traceback: [C]: in function 'init' /Users/qp/Workspace/components/network/analytics.lua:122: in function 'init' /Users/qp/Workspace/main.lua:157: in main chunk

This been fixed please use facebookAnalytics.init(facebookAppID)

@Scott_Harrison I paid for your plugin a few weeks ago.

In the iOS build, it works without problems
However, in the Android build, the build fails due to the following problems.
buildLog.txt (46.8 KB)
please check.

Did you use the plugin with any plugins?

@Scott_Harrison This is a list of plugins currently in use.

[“plugin.notifications.v2”]
[“CoronaProvider.native.popup.social”]
[“CoronaProvider.native.popup.activity”]
[“plugin.applovin.paid”]
[“plugin.appsflyer”]
[“plugin.facebook.v4”]
[“plugin.facebookAnalytics”]

try using plugin.facebook.v4a instead of v4