We are trying to add app placement exclusions to a shared exclusion list at the mcc level using a Google Ads script that reads the exclusions from a Google Sheet. We already do this for websites and it works fine.
For App Exclusions, we use similar code and it works for some app placements, but others fail with reason "Placement URLs must be provided in a valid URL format" even though we can manually upload those App Exclusions via the online interface with the same URL that we are trying to upload via the script. Examples below.
One example from this list is Candy Crush. With a scheduled upload reading the same list of app URLs, it works fine to exclude with the full placement URL.
Manually uploading via the online interface works with either of the following, but none of these three work via script.
com.king.candycrushsaga
mobileapp::2-com.king.candycrushsaga
Again, the strange part is that the first one works for websites and works for some app placements, but not all of them. Thoughts on how to eliminate the not valid URL error for app exclusion uploads via scripts?
Gemini suggests providing the following info
- You are trying to add app placements (e.g., mobileapp::2-com.king.candycrushsaga) to an MCC-level exclusion list using a Google Ads Script.
- The excludedPlacementList.addExcludedPlacement() call in Apps Script completes without throwing an error, leading the script to believe the addition was successful.
- However, the Google Ads UI "Changes" history shows the operation failed with the error "Placement URLs must be provided in a valid URL format."
- Crucially, adding the exact same string (e.g., mobileapp::2-com.king.candycrushsaga) manually through the Google Ads UI to the same exclusion list works successfully.
- Also mention that adding the full Play Store URL manually works, but also fails via script with the same misleading error (and the script also doesn't catch this failure).
Thanks