create ad that related to instagram post with facebook marketing api
Digital Marketing
Facebook Marketing API
2 years ago
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.