How to install Facebook SDK for App Ads in Ionic project?


#1

I’m working on an Android project where by I want to add Facebook SDK for App Ads inside it. I read the docs and Getting Started Android SDK docs but I couldn’t understand it because I don’t have native programming knowledge.

Can someone please show me a tutorial or step-by-step guide how to add Facebook SDK for App Ads inside Ionic Android project?


#2

https://developers.facebook.com/docs/javascript/howto/angularjs


#3

Thanks for the link @bengtler. But I couldn’t find any examples on how to activate the Facebook SDK for App Ads inside the docs page. Could you share some example?


#4

I do not know how this works, but in the docs to facebook API they are mentioned that you can use the javascript sdk.
Maybe you use a cordova plugin as alternative:


#5

Thanks @bengtler for pointing that out. I found some solutions on Stackoverflow:
http://stackoverflow.com/questions/24868984/cordova-phonegap-tracking-apps-install-with-facebook-sdk

The plugin inside the link you’ve shared is not what I want. That plugin is for adding ads in mobile app actually.

What I’m looking for right now is, the plugin that can help me track my app installs via Facebook Ads. But nevermind, I’ll do some more research about this. Thanks for helping. Really appreciate it!


#6

@zulhfreelancer a tip from Stackoverflow funcionoun for you?
I’m having this same problem to 1 month :’(


#7

Still couldn’t find any simple solution for that. :cry:


#8

Hi,
I’m in the same situation. Any update about it?


#9

Any update about this?


#10

im also having exactly the same problem , did someone found any solution for this?


#11

I think this plugin will be helpful to integrate facebook sdk in android and ios both:


#12

Ok, so has anyone successfully got Ionic2 and the Facebook AD SDK working (ie. tracking ads so you can tell how effective your facebook ad campaign is for driving mobile installs?)


#13

Yep. I used ngx-facebook in Ionic 2 and it worked like a charm!

  1. index.html -> include FB SDK:

script type=“text/javascript” src=“https://connect.facebook.net/en_US/sdk.js

  1. yourPage.ts ->

constructor(private fb: FacebookService);
ngOnInit(){
const initParams: InitParams = {
appId: ‘yourAppId’,
xfbml: true,
version: ‘v2.8’
};
this.fb.init(initParams);
}

Of course, you have to register the FacebookService as a provider in your app.module.ts


#14

@alarv
can u share the whole code??


#15

This does it all: https://ionicframework.com/docs/native/facebook/

App Installs are tracked for you automatically, just go to Facebook Analytics -https://www.facebook.com/analytics/

You can add custom events too.