create ad that related to instagram post with facebook marketing api

Digital Marketing Facebook Marketing API 2 years ago

0 1 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating
_x000D_ _x000D_ TL;DR: how to create ad in business manager that connected to instagram post? I am using facebook marketing api to creating ads in the business manager that promote posts from my facebook page. I have instagram business account that connected with my facebook page and I want to be able creating ad with posts from my instagram account through the facebook marketing api (or any other api), this is possible? my code for creating ads with posts from my facebook page: Creating ad creative adsSdk.FacebookAdsApi.init(accessToken); const AdAccount = adsSdk.AdAccount; const account = new AdAccount(accountId); let fields = ['id', 'object_story_id']; let params = { 'name': 'Ad Creative test', 'effective_instagram_story_id': facebookPostId }; account.createAdCreative(fields, params).then(res =>{ console.log(`ad creative created successfully with id ` + res.id); }); Creating ad adsSdk.FacebookAdsApi.init(accessToken); const AdAccount = adsSdk.AdAccount; const account = new AdAccount(accountId); let fields = ['id']; let params = { 'name': 'New Ad', 'adset_id': adsetId, 'creative': '{\'creative_id\':' + creativeId + '}', 'status': 'PAUSED', }; account.createAd(fields, params).then(res => { console.log(`ad created successfully with id ` + id); }); If I just giving instagram post id instead of facebook post id I get error. Thanks for any kind of help :)

Posted on 16 Aug 2022, this text provides information on Facebook Marketing API related to Digital Marketing. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (1)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago
_x000D_ Create add using new AdAccount(id, context).createAdCreative() .setName("Promoted Post") .setObjectStoryId("_") .execute(); You can verify that your instagram account is linked using instagram_accounts if not try page_backed_instagram_accounts for verify try to implement: https://graph.facebook.com/v3.2/[pageId]?fields=instagram_accounts https://graph.facebook.com/v3.2/[pageId]?fields=page_backed_instagram_accounts

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.