No, it still doesn't sticks, tried many times. I must say I don't know where to go from there.
I don't have that issue but I have seen Apps Script get into a bad state. Try this, go to your Google Account, Security and find the Apps with access to your account section. The script will be in there with search console access. Click Remove Access. Then in the spreadsheet choose Reset Settings from the Search Console menu. Then run Authorize... from the same menu and authorize again. Then see if the authorization sticks.
I played a lot with the script and it itself is working fine, but the GSC authorisation seems to worn off really quickly, like 2 hours.
Script works fine, then 2 hours later back to "Error processing url Error: Access not granted or expired." and I have to authorize again.
Have you encountered the same issue ?
Change getDay() to getHours() on line 35 and schedule the script to run every hour instead of every day. This will run across hours 0-6. Optionally change line 111 to 24 instead of 7 (to spread out checks throughout the day). If you do this you need to change the spreadsheet column checkday to have 0-23 values instead of 0-6 (or just delete all rows and allow the script to regenerate. Hope that helps.
@robert and let's say I have a small website with a small sitemap. What lines do I need to change in the code to check instantly and not wait specific days ? thank you
Hi Bucheron, the 'Added from sitemap' status is the default when a URL is first loaded into the sheet. This will change to a real status once the index status API has been called for that URL.
Thank you very much for this script, it's fine work.
Would you know be any chance why I get many urls with just "Added from sitemap" as data ? No verdict, no indexing state.
All comments are moderated. Your email address is used to display a Gravatar and optionally for notification of new comments and to sign up for the newsletter.