Hi Sonny,
Thanks for posting your concern.
To get you started on creating the script based on the provided requirement, you may try to implement this suggestion. Please follow the instruction below.
1. Implement the account's
selector and
iterator to process all your accounts.
2. Use the
select() method so that the script will determine which account will be processed first.
3. Implement the campaign's
selector and
iterator to get all the campaigns on each account.
4. Use the
getTrackingTemplate() method to retrieve the tracking templates at the campaign level.
5. Create a process that will get the numeric value after the "
source_id=" and before the "
&url=".
6. Create a condition to check whether the source ID has value.
7. If the condition is satisfied, change the campaign name by using the
setName(name) method.
To determine if there are duplicate source id, I suggest to import campaigns to the Google spreadsheet so that you can easily check if there are indeed duplicate source ID. You can use these
sample codes to import data in the Google spreadsheet.
Let me know if you have further questions/clarifications.
Regards,
Ejay
Google Ads Scripts Team

ref:_00D1U1174p._5001UODV58:ref