Skip to content

Instantly share code, notes, and snippets.

function main() {
// Create a phone number builder.
var phoneNumberBuilder = AdsApp.extensions().newPhoneNumberBuilder();
// Create a phone number operation.
var phoneNumberOperation = phoneNumberBuilder
.withCountry("IR") // required
.withPhoneNumber("02188888888") // required
.withMobilePreferred(true) // optional
.build();
function main() {
var accountBudgetLimit = 80; // set your account budget limit here
var accountCampaignsCost = 0;
var Campaign_List = "['Women Sport Shoes', 'Men Sport Shoes']";
var Email_Address = "youremail@example.com";
var campaigns = AdWordsApp.campaigns()
.withCondition("Name IN " + Campaign_List)
.get();
while (campaigns.hasNext()) {
/**
*
* Make Exact Match Exact
*
* Adds negatives for any search query that doesn't actually exactly match an exact
* match keyword.
*
* Version: 2.0
* Google AdWords Script maintained on brainlabsdigital.com
*
// Copyright 2015, Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
/*
*
* Advanced ad scheduling
*
* This script will apply ad schedules to campaigns or shopping campaigns and set
* the ad schedule bid modifier and mobile bid modifier at each hour according to
* multiplier timetables in a Google sheet.
*
* This version creates schedules with modifiers for 4 hours, then fills the rest
* of the day and the other days of the week with schedules with no modifier as a
function main() {
var costReport = AdWordsApp.report("Select Cost from ACCOUNT_PERFORMANCE_REPORT");
var reportRow = costReport.rows().next();
var totalCost = reportRow["Cost"].replace(',', '');
if (totalCost > 1000) {
var campaignIterator = AdWordsApp.campaigns().withCondition("Status = ENABLED").get();
while (campaignIterator.hasNext()) {
var campaign = campaignIterator.next();
campaign.pause();
}