How to get alerts/notifications when new campaigns are created

546 views
Skip to first unread message

Songül Senli

unread,
Sep 1, 2022, 7:10:41 AM9/1/22
to Google Ads Scripts Forum
Hi!

Is there any way to get alerts/notifications when new campaigns are created in Google Ads? I have automated scheduling through other platforms and when a new campaign is created this way into Google Ads I would like to receive information about it.

I have tried looking in the conversations but haven't found anything. Do you know if there is a ready script for this that I can use?

Best regards,
Songül.

Sigurd Fabrin

unread,
Sep 1, 2022, 9:10:57 AM9/1/22
to Google Ads Scripts Forum
Hi Songül.

That should be fairly easy if you filter on campaign.start_date 
- Or have a script build a list of campaigns in a spreadsheet and then compare the list with campaigns it finds in your account. I'd probably go with this approach as it will also catch pending campaigns and doesn't require labels.

Here's an example of the start date approach. It'll send an email with a list of campaigns that have their start date today
 - consider a label system so you don't get multiple alerts a day with the same campaign, if run hourly.
function main() {
  let today = Utilities.formatDate(new Date(),AdsApp.currentAccount().getTimeZone(),'yyyy-MM-dd');
   let query =
       'SELECT '+
       'campaign.name '+
       'FROM campaign '+
       'WHERE '+
       'campaign.start_date = "'+today+'"';
   let response = AdsApp.search(query);
   let newCampaigns = [];
   while (response.hasNext()) {
     let row = response.next();
     newCampaigns.push(row.campaign.name);
   }
   if (newCampaigns.length > 0) {
     MailApp.sendEmail(
       'em...@example.com',AdsApp.currentAccount().getName()+' - '+newCampaigns.length+' new campaigns today',
       'These new campaigns have gone live today\n\n '+newCampaigns.join('\n '));
   }
}


Cheers
Sigurd

Google Ads Scripts Forum Advisor

unread,
Sep 1, 2022, 3:21:45 PM9/1/22
to adwords...@googlegroups.com
Hi Sigurd,

Thank you for sharing your solution to the community.

@Songül,

You may also utilized a spreadsheet that will served as repository (or database) with complete list of all your campaigns, run through on your ads account's campaign, then compare if that campaign does exist on your repository. I've created a simple script which you can use. Kindly create a spreadsheet template just like on the screenshot and add the spreadsheet URL to the script. Also, kindly add your email on the recipient so that script can send an email once it detect a newly created campaign.

Regards,
Google Logo
Teejay Wennie
Google Ads Scripts Team
 
   

ref:_00D1U1174p._5004Q2duBMt:ref
send notification when new campaign created.txt
spreadsheet - sample.png

Jesper Eriksson

unread,
Dec 15, 2022, 4:26:08 AM12/15/22
to Google Ads Scripts Forum
Hi all, 

This script were more exactly what I was looking for now. 
Thanks for an awesome job providing this!

Regarding the email script: 
Is it possible to set it up to work on an MCC level? 
I've managed to get it to work on a specific sub-account, but not when applied to MCC level.
We're running 10+ markets, with one account for text ads and one account for shopping for all markets. 
We can, of course, set it up on each sub-account, but would be amazing if it was possible to alter the script to work on MCC level. 

Is this possible? 

With best regards
Jesper

Sigurd Fabrin

unread,
Dec 15, 2022, 5:08:26 AM12/15/22
to Google Ads Scripts Forum
It is possible to run a script on any number of accounts. Just wrap it in a few extra lines of code where you iterate over each account one at a time.
You can also execute scripts on up to 50 accounts in parallel - It's a little more involved. See https://developers.google.com/google-ads/scripts/docs/reference/adsmanagerapp/adsmanagerapp_managedaccountselector#executeInParallel_2

Example code that log account name of each account in turn
function main() {
  let accIter = AdsManagerApp.accounts().get();
  while (accIter.hasNext()) {
    let account = accIter.next();
    AdsManagerApp.select(account);
    console.log(account.getName())  
    // single account script here
  }
}


Sigurd

Google Ads Scripts Forum Advisor

unread,
Dec 16, 2022, 12:55:36 AM12/16/22
to adwords...@googlegroups.com

Hello,

I'm James, also a member of the Google Ads Scripts Team.

I concur with the given suggestion by Sigurd. In addition to that, you may also follow this guide on how you can incorporate MailApp service while working on each client account at MCC level. You may also follow our solution scripts for manager accounts that send email notification as reference.

Regards,

Google Logo
James Howell
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2duBMt:ref
Reply all
Reply to author
Forward
0 new messages