This Google Ads Script automates the process of assigning labels to multiple client accounts within a Manager (MCC) account using data provided in a Google Sheet. It verifies the existence of labels at the MCC level, creates labels if necessary, and applies them to the specified accounts.
- Batch Label Assignment: Efficiently assigns labels to multiple accounts based on a Google Sheet.
- Automated Label Management: Automatically verifies or creates labels at the MCC level.
- Reporting: Generates execution logs and optionally sends an email report.
- Data Validation: Checks and validates Customer IDs (CIDs) and label data to prevent errors.
Follow these steps to set up and use the script:
-
Set Up Google Sheet:
- Create or use an existing Google Sheet.
- Ensure it has columns for Customer IDs (CIDs) and Labels (default: CID in Column C, Label in Column I).
-
Open Google Ads Scripts:
- Sign in to your MCC account at ads.google.com.
- Navigate to Tools & Settings → Bulk Actions → Scripts.
-
Create a New Script:
- Click the '+' button to create a new script.
- Delete any default code present.
-
Paste the Script:
- Copy and paste the provided MCC Label Assignment script into the editor.
-
Configure the Script: Update the
CONFIGsection with your specifics:const CONFIG = { SPREADSHEET_URL: 'your-google-sheet-url', // URL of your Google Sheet SHEET_NAME: 'Master Sheet', // Sheet name containing data CID_COLUMN: 3, // Column for Customer IDs (C by default) LABEL_COLUMN: 9, // Column for Labels (I by default) EMAIL_REPORT: true, // Set to true if email report is desired REPORT_EMAIL_ADDRESS: 'your-email@example.com', // Email for reports };
-
Authorize and Run the Script:
- Click "Authorize" to grant required permissions.
- Click "Run" to execute.
-
Scheduling (Optional):
- Set a schedule (e.g., daily or weekly) to automate label assignments.
The script logs each operation clearly, noting successes, errors, or skipped rows. Logs are viewable within the Google Ads interface and optionally emailed as a detailed report.
- Label Issues: Confirm labels are accurately named in your sheet and match existing labels in MCC.
- CID Issues: Ensure CIDs are correctly formatted as 10-digit IDs.
- Permissions: Confirm the script has sufficient permissions to access your Google Sheet and Google Ads account.
Contact your Google Ads representative or script developer for additional assistance or customizations.