Search code examples
pythonasp.net-mvcfacebook-graph-apifacebook-marketing-api

Python Facebook Marketing Ads not working


We have integrated python facebook marketing Ads api in our dot project for creating fb markting ads and it is working fine on local & test environment, but not working on live server. Each time when we try to create Ads we are getting different type of error. Below is error details:

File "e:\5ac3b64c-c498-4468-a191-ed4e2e5430f3.py", line 90, in <module>
File "C:\Python34\lib\site-packages\facebookads\adobjects\abstractcrudobject.py", line 290, in remote_create
File "C:\Python34\lib\site-packages\facebookads\api.py", line 658, in execute
File "C:\Python34\lib\site-packages\facebookads\api.py", line 325, in call
facebookads.exceptions.FacebookRequestError: 
Message: Call was not successful
Path:    https://graph.facebook.com/v2.8/act_108119133030423/ads
Response:
"error": {
"error_subcode": 1815460,
"message": "Fatal",
"code": -1,
"error_user_msg": "This account has been created too recently, or spends too little to be eligible for CPA ad creation"
 }

Some times we are getting below errors:

File "e:\d633ae30-c809-47e4-8d45-e50db6277b08.py", line 66, in <module>
File "C:\Python34\lib\site-packages\facebookads\adobjects\abstractcrudobject.py", line 290, in remote_create
File "C:\Python34\lib\site-packages\facebookads\api.py", line 658, in execute
File "C:\Python34\lib\site-packages\facebookads\api.py", line 325, in call
facebookads.exceptions.FacebookRequestError: 
Message: Call was not successful
Path:    https://graph.facebook.com/v2.8/act_108119133030423/adsets
Response:
"error": {
"type": "OAuthException",
"blame_field": "targeting"
"is_transient": false,
"code": 100,
"error_user_title": "Incorrect Location Format",
     }

Some times we are also getting below errors:

File "e:\639d2c5c-2fe9-4b53-833c-41342cf14df9.py", line 72, in <module>
File "C:\Python34\lib\site-packages\facebookads\adobjects\abstractcrudobject.py", line 290, in remote_create
File "C:\Python34\lib\site-packages\facebookads\api.py", line 658, in execute
File "C:\Python34\lib\site-packages\facebookads\api.py", line 325, in call
facebookads.exceptions.FacebookRequestError: 
Message: Call was not successful
Path:    https://graph.facebook.com/v2.8/act_108119133030423/adcreatives
Response:
"error": {
"error_subcode": 1885516,
"error_user_title": "Link Data Caption is Not an Url",
"error_data": {
           [
"link_data",
           ]
       },
"type": "OAuthException",
     }

So each time we are getting different different. Please help me to resolve this error.

Thanks in advance.


Solution

  • We have resolved the issue. Issue was due to CTC ads was not enabled for our fb account. For resolving this we spent 50 NOK amount from our fb account (By creating fb ad from https://www.facebook.com/ads/manager page). Once amount spent reached to 50 NOK, CTC ads become enabled and we are able to create ads from our code as well.

    Thanks