If auto-tagging is enabled in Google Ads account to final URL automatically is added gclid value for tracking purposes. In case if your URL doesn't work correctly with this parameter it can be the reason of data discrepancy in Google Analytics and it can even redirect your end-user to the page 404.
Script programmatically checks final URLs in your ads and tests gclid parameter according to this article.
At the end of script execution new Google spreadsheet is created on Google drive and report is pushed to the first sheet in this file.
Additional permission for Spreadsheet and Gogole Drive service is required because script should create spreadsheet and save it on Google Drive.50 ads with 50 different desktop/mobile urls were tested and output is available under this link.
http://google.com OK (gclid works correctly)
http://m.google.com NOT_OK (gclid doesn't work correctly)
http://baidu.com NO_IDEA (script was unable to determine the status and test should be done manually) http://m.baidu.com NO_IDEA (script was unable to determine the status and test should be done manually)
http://apple.com OK (gclid works correctly)
http://m.apple.com ERR (this site is unavailable and while checking occured error)