Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/**
* Copyright (c) 2017-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the license found in the
* LICENSE file in the root directory of this source tree.
* @flow
*/
'use strict';
const bizSdk = require('facebook-nodejs-business-sdk');
const Business = bizSdk.Business;
const ProductCatalog = bizSdk.ProductCatalog;
const access_token = '';
const app_secret = '';
const app_id = '';
const id = '';
const api = bizSdk.FacebookAdsApi.init(access_token);
const showDebugingInfo = true; // Setting this to true shows more debugging info.
if (showDebugingInfo) {
api.setDebug(true);
}
const logApiCallResult = (apiCallName, data) => {
console.log(apiCallName);
if (showDebugingInfo) {
console.log('Data:' + JSON.stringify(data));
/**
* Copyright (c) 2017-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the license found in the
* LICENSE file in the root directory of this source tree.
* @flow
*/
'use strict';
const bizSdk = require('facebook-nodejs-business-sdk');
const Business = bizSdk.Business;
const ProductCatalog = bizSdk.ProductCatalog;
const access_token = '';
const app_secret = '';
const app_id = '';
const id = '';
const api = bizSdk.FacebookAdsApi.init(access_token);
const showDebugingInfo = true; // Setting this to true shows more debugging info.
if (showDebugingInfo) {
api.setDebug(true);
}
const logApiCallResult = (apiCallName, data) => {
console.log(apiCallName);
if (showDebugingInfo) {
console.log('Data:' + JSON.stringify(data));
/**
* Copyright (c) 2017-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the license found in the
* LICENSE file in the root directory of this source tree.
* @flow
*/
'use strict';
const bizSdk = require('facebook-nodejs-business-sdk');
const Business = bizSdk.Business;
const OfflineConversionDataSet = bizSdk.OfflineConversionDataSet;
const access_token = '';
const app_secret = '';
const app_id = '';
const id = '';
const api = bizSdk.FacebookAdsApi.init(access_token);
const showDebugingInfo = true; // Setting this to true shows more debugging info.
if (showDebugingInfo) {
api.setDebug(true);
}
const logApiCallResult = (apiCallName, data) => {
console.log(apiCallName);
if (showDebugingInfo) {
console.log('Data:' + JSON.stringify(data));
/**
* Copyright (c) 2017-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the license found in the
* LICENSE file in the root directory of this source tree.
* @flow
*/
'use strict';
const bizSdk = require('facebook-nodejs-business-sdk');
const Business = bizSdk.Business;
const ProductCatalog = bizSdk.ProductCatalog;
const access_token = '';
const app_secret = '';
const app_id = '';
const id = '';
const api = bizSdk.FacebookAdsApi.init(access_token);
const showDebugingInfo = true; // Setting this to true shows more debugging info.
if (showDebugingInfo) {
api.setDebug(true);
}
const logApiCallResult = (apiCallName, data) => {
console.log(apiCallName);
if (showDebugingInfo) {
console.log('Data:' + JSON.stringify(data));
/**
* Copyright (c) 2017-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the license found in the
* LICENSE file in the root directory of this source tree.
* @flow
*/
'use strict';
const bizSdk = require('facebook-nodejs-business-sdk');
const Business = bizSdk.Business;
const ProductCatalog = bizSdk.ProductCatalog;
const access_token = '';
const app_secret = '';
const app_id = '';
const id = '';
const api = bizSdk.FacebookAdsApi.init(access_token);
const showDebugingInfo = true; // Setting this to true shows more debugging info.
if (showDebugingInfo) {
api.setDebug(true);
}
const logApiCallResult = (apiCallName, data) => {
console.log(apiCallName);
if (showDebugingInfo) {
console.log('Data:' + JSON.stringify(data));
/**
* Copyright (c) 2017-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @flow
*/
const bizSdk = require('facebook-nodejs-business-sdk');
const Ad = bizSdk.Ad;
const AdAccount = bizSdk.AdAccount;
const Business = bizSdk.Business;
const Campaign = bizSdk.Campaign;
const accountId = 'act_';
const accessToken = '';
const bussinessId = ''; //ADD business ID here.
const campaignId = ''; //ADD Campaign ID Here
const api = bizSdk.FacebookAdsApi.init(accessToken);
const account = new AdAccount(accountId);
const showDebugingInfo = false;
if (showDebugingInfo) {
api.setDebug(true);
}
const errorFunction = scenarioName => {
let returnFunction = error => {
console.log('An error occurred while processing, ' + scenarioName);
console.log('Error Message:' + error);