{"id":162,"date":"2023-08-15T22:18:00","date_gmt":"2023-08-15T20:18:00","guid":{"rendered":"https:\/\/nilsrooijmans.com\/daily\/?p=162"},"modified":"2023-11-24T10:59:47","modified_gmt":"2023-11-24T09:59:47","slug":"error-403-response-code","status":"publish","type":"post","link":"https:\/\/nilsrooijmans.com\/daily\/error-403-response-code","title":{"rendered":"error: 403 response code"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Here\u2019s a common issue when you\u2019re running the\u00a0<a href=\"https:\/\/nilsrooijmans.com\/the-best-adwords-script-i-have-ever-used\/\" target=\"_blank\" rel=\"noreferrer noopener\">famous link checker script<\/a>: the script reports response code 403 for a number of URLs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The site loads fine, and checking the same URLs with your browser, FireBug, Screaming Frog or any other tool does not return any error. Yet still, the link checker script reports these damned\u00a0403 error(s).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A 403 Forbidden response code typically indicates that the server understands the request but refuses to authorize it;\u00a0it doesn&#8217;t give access to the requested resource.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>There can be loads of reasons for this annoying issue.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here&#8217;s the top 4:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>1. User-Agent Header:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Some servers check the User-Agent header to identify the client making the request. If the User-Agent header sent by UrlFetchApp is different from a standard browser&#8217;s, the server might block it. You could try setting the User-Agent header to mimic a common browser in your UrlFetchApp request. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Fix: If the server is configured to block requests from non-browser User-Agent strings, you can modify the User-Agent string in your UrlFetchApp request to mimic a common browser. (More details in the link below.)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>2. IP Whitelisting:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Some servers allow requests only from specific IP addresses or ranges. If the server&#8217;s configuration is set to allow requests only from certain IPs (like your own), requests from other sources (like Google&#8217;s servers) might be blocked. The web host is blocking Google in their firewall.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Fix: make sure to whitelist all IP addresses used by the UrlFetchApp service. Here&#8217;s the list of IP addresses:\u00a0<a href=\"https:\/\/www.gstatic.com\/ipranges\/goog.txt\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.gstatic.com\/ipranges\/goog.txt<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>3. Authentication:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If your website requires some form of authentication (like cookies or tokens), the request from UrlFetchApp may lack these credentials, leading to a 403 error.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Fix: Make sure that any required authentication headers or cookies are included in the UrlFetchApp request.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>4. Rate Limiting:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If the server has rate limiting in place and UrlFetchApp is making requests too frequently, it might trigger a 403 response. This might not be an issue with your browser if you&#8217;re not hitting those rate limits (your browsing behavior typically will not hit these limits, whereas an automated process will).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Fix: decrease the frequency and volume of the requests to your server, or change the server settings to allow for higher limits.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Because of the frequency of this 403 error, I&#8217;ve added an answer with some more causes and details to my Google Ads Scripts FAQ.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So, next time any of your team members gets this error message, simply send them this link:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/nilsrooijmans.com\/google-ads-scripts-faq\/error-403-response-code\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/nilsrooijmans.com\/google-ads-scripts-faq\/error-403-response-code\/<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Haven&#8217;t installed any link checker solutions yet? C&#8217;mon. It&#8217;s a no-brainer and only takes 5 minutes! Here&#8217;s the link: <a href=\"https:\/\/nilsrooijmans.com\/the-best-adwords-script-i-have-ever-used\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/nilsrooijmans.com\/the-best-adwords-script-i-have-ever-used\/<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8211; Nils<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here\u2019s a common issue when you\u2019re running the\u00a0famous link checker script: the script reports response code 403 for a number of URLs. The site loads fine, and checking the same URLs with your browser, FireBug, Screaming Frog or any other tool does not return any error. Yet still, the link checker script reports these damned\u00a0403 &hellip; <a href=\"https:\/\/nilsrooijmans.com\/daily\/error-403-response-code\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;error: 403 response code&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-162","post","type-post","status-publish","format-standard","hentry","category-google-ads"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>error: 403 response code - Nils Rooijmans<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/nilsrooijmans.com\/daily\/error-403-response-code\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"error: 403 response code - Nils Rooijmans\" \/>\n<meta property=\"og:description\" content=\"Here\u2019s a common issue when you\u2019re running the\u00a0famous link checker script: the script reports response code 403 for a number of URLs. The site loads fine, and checking the same URLs with your browser, FireBug, Screaming Frog or any other tool does not return any error. Yet still, the link checker script reports these damned\u00a0403 &hellip; Continue reading &quot;error: 403 response code&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/nilsrooijmans.com\/daily\/error-403-response-code\" \/>\n<meta property=\"og:site_name\" content=\"Nils Rooijmans\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-15T20:18:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-11-24T09:59:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/nilsrooijmans.com\/daily\/wp-content\/uploads\/2024\/05\/NilsRooijmans_GreenBG_SQUARE_200x186.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"200\" \/>\n\t<meta property=\"og:image:height\" content=\"186\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Nils Rooijmans\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nils Rooijmans\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/nilsrooijmans.com\/daily\/error-403-response-code#article\",\"isPartOf\":{\"@id\":\"https:\/\/nilsrooijmans.com\/daily\/error-403-response-code\"},\"author\":{\"name\":\"Nils Rooijmans\",\"@id\":\"https:\/\/nilsrooijmans.com\/daily\/#\/schema\/person\/645ba0bda90c1467f9d23d332d1f3aa0\"},\"headline\":\"error: 403 response code\",\"datePublished\":\"2023-08-15T20:18:00+00:00\",\"dateModified\":\"2023-11-24T09:59:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/nilsrooijmans.com\/daily\/error-403-response-code\"},\"wordCount\":454,\"publisher\":{\"@id\":\"https:\/\/nilsrooijmans.com\/daily\/#\/schema\/person\/645ba0bda90c1467f9d23d332d1f3aa0\"},\"articleSection\":[\"Google Ads\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/nilsrooijmans.com\/daily\/error-403-response-code\",\"url\":\"https:\/\/nilsrooijmans.com\/daily\/error-403-response-code\",\"name\":\"error: 403 response code - Nils Rooijmans\",\"isPartOf\":{\"@id\":\"https:\/\/nilsrooijmans.com\/daily\/#website\"},\"datePublished\":\"2023-08-15T20:18:00+00:00\",\"dateModified\":\"2023-11-24T09:59:47+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/nilsrooijmans.com\/daily\/error-403-response-code#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/nilsrooijmans.com\/daily\/error-403-response-code\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/nilsrooijmans.com\/daily\/error-403-response-code#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/nilsrooijmans.com\/daily\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"error: 403 response code\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/nilsrooijmans.com\/daily\/#website\",\"url\":\"https:\/\/nilsrooijmans.com\/daily\/\",\"name\":\"Nils Rooijmans Daily Newsletter - Google Ads\",\"description\":\"Daily emails to boost your Google Ads Performance\",\"publisher\":{\"@id\":\"https:\/\/nilsrooijmans.com\/daily\/#\/schema\/person\/645ba0bda90c1467f9d23d332d1f3aa0\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/nilsrooijmans.com\/daily\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/nilsrooijmans.com\/daily\/#\/schema\/person\/645ba0bda90c1467f9d23d332d1f3aa0\",\"name\":\"Nils Rooijmans\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/nilsrooijmans.com\/daily\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/nilsrooijmans.com\/daily\/wp-content\/uploads\/2024\/05\/NilsRooijmans_Green_Background_300x300.jpg\",\"contentUrl\":\"https:\/\/nilsrooijmans.com\/daily\/wp-content\/uploads\/2024\/05\/NilsRooijmans_Green_Background_300x300.jpg\",\"width\":300,\"height\":300,\"caption\":\"Nils Rooijmans\"},\"logo\":{\"@id\":\"https:\/\/nilsrooijmans.com\/daily\/#\/schema\/person\/image\/\"},\"description\":\"Google Ads Performance Architect with a passion for PPC Automation &amp; AI, in particular via Google Ads Scripts.\",\"sameAs\":[\"https:\/\/nilsrooijmans.com\/\",\"https:\/\/www.linkedin.com\/in\/nilsrooijmans\/\"],\"url\":\"https:\/\/nilsrooijmans.com\/daily\/author\/nils\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"error: 403 response code - Nils Rooijmans","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/nilsrooijmans.com\/daily\/error-403-response-code","og_locale":"en_US","og_type":"article","og_title":"error: 403 response code - Nils Rooijmans","og_description":"Here\u2019s a common issue when you\u2019re running the\u00a0famous link checker script: the script reports response code 403 for a number of URLs. The site loads fine, and checking the same URLs with your browser, FireBug, Screaming Frog or any other tool does not return any error. Yet still, the link checker script reports these damned\u00a0403 &hellip; Continue reading \"error: 403 response code\"","og_url":"https:\/\/nilsrooijmans.com\/daily\/error-403-response-code","og_site_name":"Nils Rooijmans","article_published_time":"2023-08-15T20:18:00+00:00","article_modified_time":"2023-11-24T09:59:47+00:00","og_image":[{"width":200,"height":186,"url":"https:\/\/nilsrooijmans.com\/daily\/wp-content\/uploads\/2024\/05\/NilsRooijmans_GreenBG_SQUARE_200x186.jpg","type":"image\/jpeg"}],"author":"Nils Rooijmans","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Nils Rooijmans","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/nilsrooijmans.com\/daily\/error-403-response-code#article","isPartOf":{"@id":"https:\/\/nilsrooijmans.com\/daily\/error-403-response-code"},"author":{"name":"Nils Rooijmans","@id":"https:\/\/nilsrooijmans.com\/daily\/#\/schema\/person\/645ba0bda90c1467f9d23d332d1f3aa0"},"headline":"error: 403 response code","datePublished":"2023-08-15T20:18:00+00:00","dateModified":"2023-11-24T09:59:47+00:00","mainEntityOfPage":{"@id":"https:\/\/nilsrooijmans.com\/daily\/error-403-response-code"},"wordCount":454,"publisher":{"@id":"https:\/\/nilsrooijmans.com\/daily\/#\/schema\/person\/645ba0bda90c1467f9d23d332d1f3aa0"},"articleSection":["Google Ads"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/nilsrooijmans.com\/daily\/error-403-response-code","url":"https:\/\/nilsrooijmans.com\/daily\/error-403-response-code","name":"error: 403 response code - Nils Rooijmans","isPartOf":{"@id":"https:\/\/nilsrooijmans.com\/daily\/#website"},"datePublished":"2023-08-15T20:18:00+00:00","dateModified":"2023-11-24T09:59:47+00:00","breadcrumb":{"@id":"https:\/\/nilsrooijmans.com\/daily\/error-403-response-code#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/nilsrooijmans.com\/daily\/error-403-response-code"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/nilsrooijmans.com\/daily\/error-403-response-code#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/nilsrooijmans.com\/daily"},{"@type":"ListItem","position":2,"name":"error: 403 response code"}]},{"@type":"WebSite","@id":"https:\/\/nilsrooijmans.com\/daily\/#website","url":"https:\/\/nilsrooijmans.com\/daily\/","name":"Nils Rooijmans Daily Newsletter - Google Ads","description":"Daily emails to boost your Google Ads Performance","publisher":{"@id":"https:\/\/nilsrooijmans.com\/daily\/#\/schema\/person\/645ba0bda90c1467f9d23d332d1f3aa0"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/nilsrooijmans.com\/daily\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/nilsrooijmans.com\/daily\/#\/schema\/person\/645ba0bda90c1467f9d23d332d1f3aa0","name":"Nils Rooijmans","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/nilsrooijmans.com\/daily\/#\/schema\/person\/image\/","url":"https:\/\/nilsrooijmans.com\/daily\/wp-content\/uploads\/2024\/05\/NilsRooijmans_Green_Background_300x300.jpg","contentUrl":"https:\/\/nilsrooijmans.com\/daily\/wp-content\/uploads\/2024\/05\/NilsRooijmans_Green_Background_300x300.jpg","width":300,"height":300,"caption":"Nils Rooijmans"},"logo":{"@id":"https:\/\/nilsrooijmans.com\/daily\/#\/schema\/person\/image\/"},"description":"Google Ads Performance Architect with a passion for PPC Automation &amp; AI, in particular via Google Ads Scripts.","sameAs":["https:\/\/nilsrooijmans.com\/","https:\/\/www.linkedin.com\/in\/nilsrooijmans\/"],"url":"https:\/\/nilsrooijmans.com\/daily\/author\/nils"}]}},"_links":{"self":[{"href":"https:\/\/nilsrooijmans.com\/daily\/wp-json\/wp\/v2\/posts\/162","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nilsrooijmans.com\/daily\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nilsrooijmans.com\/daily\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nilsrooijmans.com\/daily\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/nilsrooijmans.com\/daily\/wp-json\/wp\/v2\/comments?post=162"}],"version-history":[{"count":1,"href":"https:\/\/nilsrooijmans.com\/daily\/wp-json\/wp\/v2\/posts\/162\/revisions"}],"predecessor-version":[{"id":163,"href":"https:\/\/nilsrooijmans.com\/daily\/wp-json\/wp\/v2\/posts\/162\/revisions\/163"}],"wp:attachment":[{"href":"https:\/\/nilsrooijmans.com\/daily\/wp-json\/wp\/v2\/media?parent=162"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nilsrooijmans.com\/daily\/wp-json\/wp\/v2\/categories?post=162"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nilsrooijmans.com\/daily\/wp-json\/wp\/v2\/tags?post=162"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}