PHP Examples for Bing Ads
The PHP code examples for Bing Ads are developed and run within the environment described in Getting Started Using PHP with Bing Ads Services. Your custom configuration may vary.
To get started developing Bing Ads applications with PHP, you can download PHP examples with Bing Ads class files at Code Gallery.
This example demonstrates how to implement server-side authentication using OAuth.
|Server Side OAuth Authentication in PHP||Authenticate a BingAds user using the OAuth protocol.|
These examples show how to manage customers, accounts, and users. For related information, see Managing Customer Accounts.
|Link to Client Accounts in PHP||Use the Customer Management Service with agency credentials to invite a client, and use client credentials to accept the invitation. Run this sample multiple times to update and observe the status change, for example from LinkPending to LinkAccepted to Active.||AddClientLinks|
|Search Accounts by User in PHP||Use the Customer Management Service to search for accounts that can be managed by the current authenticated user.||GetUser|
These examples demonstrate how to setup and manage ads, associate ad extensions, and bid on keywords. For related information, see Campaign Setup and Basics.
|Ads and Keywords in PHP||Use the Campaign Management Service to add ads and keywords to a new ad group, and handle partial errors when some ads or keywords are not successfully created.||AddAdGroups|
|Negative Keywords in PHP||Use the Campaign Management Service to associate negative keywords and negative keyword lists with a campaign.||AddListItemsToSharedList|
These examples demonstrate how to setup and manage ad extensions. For more information, see Ad Extensions.
|Ad Extensions in PHP||Use the Campaign Management Service to add, get, and delete extensions for an account’s ad extension library, set, get, and delete the extension associations with a campaign, and determine why an extension failed editorial review.||AddAdExtensions|
These examples demonstrate how to setup and manage Bing Shopping campaigns with product ads. For more information, see Campaign Setup and Basics.
|Shopping Campaigns in PHP||Use the Campaign Management Service to apply product conditions for Bing Shopping campaigns.||AddAdGroups|
These examples demonstrate how to setup and manage targets for campaigns and ad groups. For more information, see Show Ads to Your Target Audience.
|Geographical Locations in PHP||Download the comma separated value (CSV) file that contains geographical location information that can be used with Bing Ads location targeting.||Not applicable.|
|Targets in PHP||Use the Campaign Management Service to associate targets with a campaign and ad group.||AddTargetsToLibrary|
This example demonstrates how to discover opportunities to improve your ads' performance and increase your return on investment. For related information, see Researching Bid and Budget Opportunities.
|Optimize Budget in PHP||Use the Ad Insight Service to get the budget opportunities for the specified account.||GetBudgetOpportunities|
This example demonstrates how to get detailed reports about accounts, campaigns, and ad groups. The information can help you track finances, measure performance, and adjust settings to optimize your budget or campaign. For related information, see Getting Reports.
|Report Requests in PHP||Use the Reporting Service to request and retrieve a keyword performance report.||SubmitGenerateReport|
|Download and Upload Campaigns in PHP||Download and upload the entities of one or more campaigns in the background.||DownloadCampaignsByCampaignIds|