Hammad ul Hasan
Hammad ul Hasan

Reputation: 314

Facebooks ads campaign Nodejs

I want to create facebook ads by creating facebook ad campaign , but getting error of special_ad_category can't resolve this

const createCompainNew = async () => {
let test5 = 'Create Edge';
let create = await account.createCampaign([special_ad_category], {
    [Campaign.Fields.name]: 'Test Campaign - Delete',
    [Campaign.Fields.status]: Campaign.Status.paused,
    [Campaign.Fields.objective]: Campaign.Objective.page_likes,
})
    .then(campaign => {
        console.log(campaign)
        logPassedTest(test5 + ':Pass', account);
    })
    .catch(errorFunction(test5));
    return create
}

Upvotes: 2

Views: 360

Answers (1)

Hammad ul Hasan
Hammad ul Hasan

Reputation: 314

i tried many things but at last tried this and successful to create a ad campaign

const createCompainNew = async () => {
let test5 = 'Create Edge';
let special_ad_category = "NONE"
let create = await account.createCampaign([], {
    special_ad_category : special_ad_category,  
    [Campaign.Fields.name]: 'Test Campaign - Delete',
    [Campaign.Fields.status]: Campaign.Status.paused,
    [Campaign.Fields.objective]: Campaign.Objective.page_likes,
})
    .then(campaign => {
        console.log(campaign)
        logPassedTest(test5 + ':Pass', account);
    })
    .catch(errorFunction(test5));
return create
} 

Upvotes: 2

Related Questions