Can't copy an excluded search audience

33 views
Skip to first unread message

Jon

unread,
Jan 30, 2020, 11:20:22 AM1/30/20
to Google Ads Scripts Forum
I'm trying to make a script that copies an excluded search audience from one Google Ads campaign to another. After trying several options I simply copied two codes provides in the Google Scripts examples, here:

https://developers.google.com/google-ads/scripts/docs/examples/search-audiences

but it doesn't work. Running in a preview mode it seems to be Ok but when executing de script it return an error: Item not found (or similar, in Spanish: No se ha encontrado el elemento).

This is the code:

    function main() {
     
     
var CAMPAIGN_NAME = "CAMPAIGN_NAME" ;// insert here the name of the source campaign
     
     
//Get excluded search audiences for a campaign
   
     
// Retrieve the campaign.
     
var campaign = AdsApp.campaigns()
         
.withCondition('Name = "' + CAMPAIGN_NAME + '"')
         
.get()
         
.next();
   
     
var excludedAudiences = campaign.targeting().excludedAudiences().get();
   
     
while (excludedAudiences.hasNext()) {
       
var audience = excludedAudiences.next();
     
}
   
     
// Exclude search audience from a campaign
   
     
var targetCampaign = "targetCampaign" ;// insert here the name of the output campaign  
     
var AUDIENCE_LIST_ID = audience.getAudienceId();
   
     
// Retrieve the campaign.
     
var campaignDest = AdsApp.campaigns()
         
.withCondition('Name = "' + targetCampaign + '"')
         
.get()
         
.next();
   
     
// Create the excluded audience.
     
var audienceDest = campaignDest.targeting()
         
.newUserListBuilder()
         
.withAudienceId(AUDIENCE_LIST_ID)
         
.exclude()
         
.getResult();

   
}



Thaks for any help.

Google Ads Scripts Forum Advisor

unread,
Jan 30, 2020, 4:24:54 PM1/30/20
to adwords-scripts+apn2wqe7npdwjlne...@googlegroups.com, adwords-scripts+apn2wqe7npdwjlne...@googlegroups.co, adwords...@googlegroups.com
Hi Jon,

Can you please provide your CID and script name so I can take a look at this issue in your account?

Thanks,
Matt
Google Ads Scripts Team

ref:_00D1U1174p._5001UUzqYp:ref
Message has been deleted
Message has been deleted

Google Ads Scripts Forum Advisor

unread,
Feb 6, 2020, 12:27:13 PM2/6/20
to adwords...@googlegroups.com
Hi Jonatan,

Thanks for reaching out on this. We're still looking into this issue on our end. As soon as we have more information, I'll provide an update on this thread.

Regards,

Jon Castaño

unread,
Feb 11, 2020, 12:09:50 PM2/11/20
to Google Ads Scripts Forum on behalf of adsscriptsforumadvisor
Hi, Matt,

thanks a lot for your help. I have seen that my Google Ads account Id, that i sent you  during our conversation, is now public in Google's help forum. Sorry for asking this but I would prefer to maintain this information privately. Is it possible to remove it from de forum?

Thank you in advanced.

Best regards.

Jonatan

--
-- You received this message because you are subscribed to the Google Groups AdWords Scripts Forum group. Please do not reply to this email. To post to this group or unsubscribe please visit https://developers.google.com/adwords/scripts/community.
---
You received this message because you are subscribed to the Google Groups "Google Ads Scripts Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-scrip...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-scripts/Rjbzl000000000000000000000000000000000000000000000Q5AJ5500VQ6C3oSOT3my0bfjeOUK_g%40sfdc.net.

Google Ads Scripts Forum Advisor

unread,
Feb 11, 2020, 1:46:56 PM2/11/20
to adwords...@googlegroups.com
Hi Jonatan,

I have removed your initial post containing that information as well as any replies with trail-mail that also contained the information. 

Thanks again for your patience while we investigate the initial issue.

Thanks,

Jon Castaño

unread,
Feb 12, 2020, 10:08:08 AM2/12/20
to Google Ads Scripts Forum on behalf of adsscriptsforumadvisor
Hi Matt,

thanks a lot for all your help.

Best regards,

Jonatan

--
-- You received this message because you are subscribed to the Google Groups AdWords Scripts Forum group. Please do not reply to this email. To post to this group or unsubscribe please visit https://developers.google.com/adwords/scripts/community.
---
You received this message because you are subscribed to the Google Groups "Google Ads Scripts Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-scrip...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages