We all know that websites continuously evolve. New pages get added, old pages are no longer used, links break and get fixed. It can be quite a hassle to keep your Google Ads campaigns, and the link between your website, healthy. The last thing anyone wants is to have advertisements live that may be pointing to non-existing pages or pay for clicks that result in 404 errors. For a very small number of campaigns it would completely be feasible to go in the campaigns daily and manually check all the campaigns. However, this quickly becomes impossible to do if you have more campaigns with multiple ad groups, ads & multiple sitelinks to top it of. A solution can be found in the form of the link checker tool / script.
How does it work
The Link Checker iterates through all the ads, keywords, and sitelinks used in the account. It checks if the landing pages do not result in “Page not found” or other types of responses. If it were to discover such errors, it will alert you by sending an email with a clear overview of where the specific error occurred. It saves all the results of its analysis in a spreadsheet.
Important to note that some accounts have a large number of URLS that cannot be checked in ‘the same run’ (due to execution time limits or quotas). The script works around this by tracking its progress over multiple runs and only checking URLS that it has not checked previously.
How to set it up
- Go the following page
- Scroll down to set-up
- click on the first point (template spreadsheet) and make a copy of the spreadsheet (easiest to open in new tab because otherwise you'll leave the page
- First step = name the sheet (you then can also bookmark it to easily find it back again)
- Via share (upper right) give access to the team/other people that need to have access to this document but most importantly, give access to 'anyone with link' . This is because you'll have to paste the url/link in the script and it needs access
- Open the Google Ads account where you want to implement the script
- Go to: TOOLS - Bulk actions - Scripts - Add new script
- Will get page below
- Change script name (Optional, to find it easier back in your other scripts but not mandatory - e.g. ‘Link Checker - Country XXX’)
- Note the yellow warning. You'll need to authorise (right) so that the script can make changes
- Login with your account and give access etc.
- Then delete what's already written in the code field (function etc… on the screenshot above)
- Go back to the developers page
- Scroll down to the source code (below set-up)
- Copy the code entirely by clicking the symbol to the right
- Go back to the script page in Google Ads and paste in the empty code field (see 2f)
- You’ll still have to adapt some things on line 50 & 54
- 50: paste the url of the copy of the sheet you created earlier on (step 1 - c to e)
- 54: fill in email address to be used if issues are found
- Scroll down and click on preview. Google will again give a pop-up that the scripts needs authorization, authorise it
- Should be good to go so click on run!
What does it look like
Once the script is implemented you’ll have a sheet with three tabs (options, results, archive). The first tab has the main options that can be set in the script.
- Scope: you can choose what the script will have to check (URLs, KWs, and/or sitelinks), and whether the script has to check these even if they are paused.
- Valid Response Codes: List the HTTP response codes that the script should consider a valid response. Most users should consider only 200 a valid response code.
- Email and spreadsheet output: allows you to specify after which tasks the script can already send an email. For example only after it checked ALL the URLs or also after every execution.
- Frequency of execution: Allows you to set how often the scripts start a fresh analysis of your ads.