How to update the title and body of a facebook ad via the API?

Digital Marketing Facebook Marketing API 3 years ago

1.1K 1 0 0 0

_x000D_ _x000D_ I want to use the facebook API v2.5 to update the title and body of an existing facebook ad. I am using the PHP sdk (and the facebook API explorer). What is the correct way to do this? This what I have tried so far. After fetching the ad, I read the related ad_creative: $ad = new Ad(); $ad_creatives = $ad->getAdCreatives(); $creative = new AdCreative($ad_creatives[0]->id); // fetch from API $fields = $creative->getFields(); $creative->read($fields); Changing a value and calling update has no effect: $creative->{AdCreativeFields::BODY} = 'When life gives you lemons'; $creative->update(); Another possible way is to create a new creative and clone the data from the existing one: $data = $creative->getData(); $new_creative = new AdCreative(null, ); $new_creative->setData($data); $new_creative->create(); But it seems I will need to do some tinkering to get it right, because the api is returning errors. Btw, the app has the following permissions: ads_management, manage_pages, publish_pages.

User submissions are the sole responsibility of contributors, with TuteeHUB disclaiming liability for accuracy, copyrights, or consequences of use; content is for informational purposes only and not professional advice.

Answers (1)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 3 years ago
_x000D_ Creative content is immutable. In order to update the tittle or body you will need to create a new creative (and then update your ad to use the new creative instead of the old one).
0 views
0 shares

No matter what stage you're at in your education or career, TuteeHUB will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.

Similar Forum


Q

What are the best SEO tools for a personal website? What website or tools should I use to build and...

What are the best SEO tools for a personal website? What website or tools should I use to build and...
Q

Why is keyword research important?

Why is keyword research important?
Q

What is SEO ?

What is SEO ?