How to change the campaign final URL suffix automatically?

607 views
Skip to first unread message

Yevheniya Shafar

unread,
Dec 2, 2019, 5:43:24 AM12/2/19
to Google Ads Scripts Forum
Hi there,

I need your experts-help!! 
We've got 10 accounts with a lot of different campaigns. Every campaign has his own final URL suffix. 
Those suffixes should be changed every season. Because of a huge amount on campaigns, we would like to automate that process.

So we were thinking about the script. Is there some possibility to do it over the script? Does anyone did it already and could help me with the script?

I'm very grateful for any help!

Yevheniya

Google Ads Scripts Forum Advisor

unread,
Dec 2, 2019, 3:03:31 PM12/2/19
to adwords-scripts+apn2wqcq54kn04cr...@googlegroups.com, adwords-scripts+apn2wqcq54kn04cr...@googlegroups.co, adwords...@googlegroups.com
Hi Yevheniya,

You can get and set campaign final URL suffixes through the campaign URLs class

function main() {
  var campaignIterator = AdsApp.campaigns().withCondition("Name = 'Search Campaign'").get();
  
  if(campaignIterator.hasNext()) {
    var campaign = campaignIterator.next();
    
    //Get final URL suffix
    var finalUrlSuffix = campaign.urls().setFinalUrlSuffix('NEW_SUFFIX');    
  }  
}

If you wish to run the script from an MCC, on the 10 child accounts, you can use Ad Manager scripts. If each campaign has a unique suffix then you can read them in from a source (e.g. a spreadsheet). 

Regards,
Matt
Google Ads Scripts Team

ref:_00D1U1174p._5001UODbAM:ref

Yevheniya Shafar

unread,
Dec 3, 2019, 4:23:34 AM12/3/19
to Google Ads Scripts Forum
Thanks a lot Matt! 

We will try it out and if you don't mind will be back with one more question :)
Message has been deleted

Nils Rooijmans

unread,
Dec 10, 2024, 6:36:20 AM12/10/24
to Google Ads Scripts Forum
here's a script you can use to automatically set the UTM parameters , including campaign name:

Hope this helps,

Nils Rooijmans
https://nilsrooijmans.com
See my Google Ads Scripts FAQ to avoid the same mistakes I made: https://nilsrooijmans.com/google-ads-scripts-faq/

Google Ads Scripts Forum Advisor

unread,
Dec 10, 2024, 8:20:02 AM12/10/24
to adwords...@googlegroups.com
Hi,

@Nils, thank you for your input.

I would recommend you follow the suggestion given by Nils to automatically set the UTM parameters and get back to us if you face any further queries.
 
This message is in relation to case "ref:!00D1U01174p.!5001U0ODbAM:ref" (ADR-00022728)

Thanks,
 
Google Logo Google Ads Scripts Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5


 


Reply all
Reply to author
Forward
0 new messages