Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Unlike JavaScript that executes in a browser, Microsoft Advertising scripts must define a main() function. The main function is the script's entry point and contains the program logic you want to execute. The script may also define custom functions. For example, the following script defines a main function that calls a custom function named getAllCampaigns.
function main() {
getAllCampaigns();
}
function getAllCampaigns() {
var campaigns = AdsApp.campaigns().get();
while(campaigns.hasNext()){
var campaign = campaigns.next();
}
}