How to use the google-ads-api.enums.AdvertisingChannelType function in google-ads-api

To help you get started, we’ve selected a few google-ads-api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Opteo / google-ads-api / examples / basic_operations / add_campaign.js View on Github external
async function main() {
    const customer = client.Customer({
        customer_account_id: '',
        refresh_token: '',
    })

    // Bonus: If you're using Typescript, set the type here to "types.Campaign" for autocomplete
    const campaign = {
        name: 'new-campaign',
        campaign_budget: 'customers/{customer_id}/campaignBudgets/{campaign_budget_id}',
        advertising_channel_type: enums.AdvertisingChannelType.SEARCH,
        status: enums.CampaignStatus.PAUSED,
    }

    try {
        const { results } = await customer.campaigns.create(campaign)
        /*
            The newly created campaign will have a resource name in the following format:
            "customers/{customer_id}/campaigns/{campaign_id}"
        */
    } catch (err) {
        console.log(err)
    }
}