Facebook Ads

Hey guys, I was wondering if any of you had any luck implementing any kind of Facebook Ads ?

I’ve tried to follow this tutorial @technotip
This this is starting to drive my crazy ! I keep getting the error below, so if somebody knows the problem, it would be awesome ! :slight_smile:

2017-03-16 00:47:16.114272 FB1[8978:2789473] [FBAudienceNetworkLog/FBAdProvider:138 <error>] Ad request error: Error Domain=com.facebook.ads.sdk Code=2000 "Server Error" UserInfo={NSLocalizedDescription=Server Error, FBAdErrorDetailKey={
    code = "-1";
    message = Fatal;
    type = OAuthException;
    url = "https://graph.facebook.com/network_ads_common/";
}}
2017-03-16 00:47:16.115709 FB1[8978:2789473] FacebookAds, onAdFailLoad, {'adNetwork':'FacebookAds','adType':'native','adEvent':'onAdFailLoad','error':2000,'reason':'Server Error'}

My code is:

  if(FacebookAds){

    FacebookAds.setOptions({
        isTesting: true,
        deviceHash: "da39a3ee5e6b4b0d3255bfef95601890afd80709"
    });

    FacebookAds.createNativeAd('1741382996175565_1743923605921504', function(data){
      document.addEventListener("onAdLoaded", function(data){
        let temp: any = data;

        if(temp.adType == "native"){
          document.getElementById('adCover').setAttribute("src", temp.adRes.coverImage.url);
          document.getElementById('adTitle').innerHTML = temp.adRes.title;
          document.getElementById('adBody').innerHTML = temp.adRes.body;
        }
      })
    },  function(err) { alert(JSON.stringify(err)); });
    this.start = 1;
  }

And here are my Facebook settings:
image

1 Like

remove setOptions block and execute the code.

Also try implementing simple banner ads first Facebook Banner and Interstitial Ads: Ionic 2 And let me know if it worked.

I’ve tried implementing an add banner like you show and I get the same error.

Here is what I get without the setOptions block

2017-03-19 15:08:08.002333 FB1[2431:750014] [FBAudienceNetworkLog/FBAdSettings:95] When testing your app with Facebook’s ad units you must specify the device hashed ID to ensure the delivery of test ads, add the following code before loading an ad: [FBAdSettings addTestDevice:@“da39a3ee5e6b4b0d3255bfef95601890afd80709”]
2017-03-19 15:08:08.002504 FB1[2431:750014] [FBAudienceNetworkLog/FBAdSettings:96] Test mode device hash: da39a3ee5e6b4b0d3255bfef95601890afd80709
2017-03-19 15:08:08.168114 FB1[2431:750014] THREAD WARNING: [‘FacebookAds’] took ‘271.866211’ ms. Plugin should use a background thread.
2017-03-19 15:08:09.739078 FB1[2431:750014] [FBAudienceNetworkLog/FBAdProvider:138 ] Ad request error: Error Domain=com.facebook.ads.sdk Code=1001 “No fill” UserInfo={NSLocalizedDescription=No fill, FBAdErrorDetailKey={
msg = "No fill. We are not able to serve ads to this person. Please refer to https://developers.facebook.com/docs/audience-network/faq#a12. If you are integrating Audience Network for the first time, you can use test ads https://developers.facebook.com/docs/audience-network/testing.";
}}
2017-03-19 15:08:09.739769 FB1[2431:750014] FacebookAds, onAdFailLoad, {‘adNetwork’:‘FacebookAds’,‘adType’:‘native’,‘adEvent’:‘onAdFailLoad’,‘error’:1001,‘reason’:‘No fill’}

Thanks

Do you have any idea of the problem ? I’m running of things to try…

Dude which plugin are you using?
Use the one specified in this tutorial Facebook Banner and Interstitial Ads: Ionic 2

I tried integrating it once again before replying you, and its working perfectly fine.

That’s the one that I’m using, but finally we decided to create our own ads, this way we will be able to have Native ads with an 100% fill rate :slight_smile:

Own ad? Private ads? That’s a great way to go with Native Advertising. You get to keep 100% of the revenue.
BTW, Facebook’s ‘Audience Network’ sucks interms of revenue and fill rate.

My best wishes … :+1:

1 Like

Hello, I have the same problem. Have you resolved now?

No I gave up :confused: sorry

Hi tchinou1, it seems this is the way I am leaning too with advertising in ionic. Did you build everything yourself for billing and reporting in the backend? or any tools/services that you used?

No, we are using affiliate membership so there is no need for billing and all. However, I have recently seen that it seems to have been implemented in this demo app. https://market.ionicframework.com/starters/hala-news-ionic-mobile-application-for-wordpress-with-facebook-comment-google-recaptcha

If you succeed please let me know !

William