Skip to content

Rename a resource without recreating it

When you adopt an existing account with refresh, bidsmith has to invent an internal name for every resource it pulls down. It often lands on awkward, machine-generated ones — reklama_1_7, niestandardowa_wideo_2023_05_24_5, language_languageconstants_1000_19. Those number suffixes are leftovers from de-duplicating; they mean nothing now, and they’re hard to read in plans and PRs.

You want to rename them to something sane. The catch: that name is how bidsmith and other resources refer to this one, so you can’t just edit the one line — you’d break every reference to it.

mv does the whole rename in one step.

The fix

Terminal window
bidsmith mv google_ads_ad_group_ad.reklama_1_7 google_ads_ad_group_ad.preroll_ad

bidsmith renames the resource and every reference to it, across all your files. The output tells you what it touched:

Renamed singapore_12sec.google_ads_ad_group_ad.reklama_1_7 ->
singapore_12sec.google_ads_ad_group_ad.preroll_ad:
1 block + 2 references across 1 file.

Confirm it’s a no-op

Terminal window
bidsmith plan .

Expected: 0 to create, 0 to update. The rename changed your files, not your account. Commit it like any other tidy-up.

Cleaning up a whole account at once

A freshly adopted account can carry hundreds of these names. Instead of one mv per resource, write a batch file — one from -> to per line — and apply it in a single pass:

renames.txt
google_ads_ad_group.niestandardowa_wideo_2023_05_24_5 -> google_ads_ad_group.instream_12sec
google_ads_ad_group_ad.reklama_1_7 -> google_ads_ad_group_ad.preroll_ad
google_ads_campaign_criterion.location_geotargetconstants_2702 -> google_ads_campaign_criterion.location_singapore
Terminal window
bidsmith mv --from-file renames.txt

The batch is all-or-nothing: if any line is wrong, nothing is written, so you never end up half-renamed. After it runs, bidsmith plan should still report no changes.

When the name is used in two files

Each .bid file is its own namespace, named after the file. If the same name appears in two files, bidsmith asks you to say which one:

mv: 'google_ads_campaign_criterion.broad_wikipedia' is declared in
multiple modules [nadarzyn, warszawa]; qualify it as
'<module>.google_ads_campaign_criterion.broad_wikipedia'

Add the file name (without .bid) as a prefix:

Terminal window
bidsmith mv nadarzyn.google_ads_campaign_criterion.broad_wikipedia \
nadarzyn.google_ads_campaign_criterion.wiki_broad

Only the nadarzyn one is renamed; the warszawa one is left alone.

What this does and doesn’t change

  • ✅ The internal handle, everywhere it’s used.
  • ❌ The public name Google Ads shows (the name = "..." line inside the resource). To change that, edit the attribute and apply normally — that one is a real change to your account.

See also