{"id":434,"date":"2017-08-10T12:22:35","date_gmt":"2017-08-10T12:22:35","guid":{"rendered":"http:\/\/support.gaconnector.com\/?p=434"},"modified":"2025-07-15T00:17:15","modified_gmt":"2025-07-15T00:17:15","slug":"how-to-fix-size-of-a-request-header-field-exceeds-server-limit-error","status":"publish","type":"post","link":"https:\/\/gaconnector.com\/docs\/how-to-fix-size-of-a-request-header-field-exceeds-server-limit-error\/","title":{"rendered":"How to fix &#8220;Size of a request header field exceeds server limit&#8221; error"},"content":{"rendered":"<p>One of the cookies created by the GA Connector script (gaconnector_pages_visited_list, and occasionally gaconnector_all_traffic_sources) can grow too large if a visitor browses many pages.<\/p>\n<p>On some servers, this produces errors such as:<\/p>\n<ul>\n<li>Size of a request header field exceeds server limit<\/li>\n<li>400 Bad Request<\/li>\n<li>Or similar<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"aligncenter size-medium wp-image-958\" src=\"https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/08\/0fd166c12bce0741e5a5258dba3f5eab-300x142.png\" alt=\"Bad Request\" width=\"300\" height=\"142\" srcset=\"https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/08\/0fd166c12bce0741e5a5258dba3f5eab-300x142.png 300w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/08\/0fd166c12bce0741e5a5258dba3f5eab-60x28.png 60w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/08\/0fd166c12bce0741e5a5258dba3f5eab-150x71.png 150w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/08\/0fd166c12bce0741e5a5258dba3f5eab.png 698w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>To fix this issue, you just need to add some code that removes this cookie:<\/p>\n<pre class=\"lang:default decode:true \">$(document).ready(function() {\r\n  gaconnector.setCallback(function(fields) {\r\n     document.cookie = \"gaconnector_pages_visited_list=;expires=Thu, 01 Jan 1970 00:00:01 GMT;domain=yourdomain.com;path=\/\";\r\n  });\r\n});<\/pre>\n<p>Just make sure to replace &#8220;yourdomain.com&#8221; with your top-level domain name.<\/p>\n<p>If the problem persists, review your server configuration (for example, Nginx <em>large_client_header_buffers<\/em> or Apache <em>LimitRequestFieldSize<\/em>) to ensure the header-size limits are appropriate.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the cookies created by the GA Connector script (gaconnector_pages_visited_list, and occasionally gaconnector_all_traffic_sources) can grow too large if a visitor browses many pages. On some servers, this produces errors such as: Size of a request header field exceeds server limit 400 Bad Request Or similar To fix this issue, you just need to add [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,22],"tags":[],"_links":{"self":[{"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/posts\/434"}],"collection":[{"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/comments?post=434"}],"version-history":[{"count":6,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/posts\/434\/revisions"}],"predecessor-version":[{"id":3623,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/posts\/434\/revisions\/3623"}],"wp:attachment":[{"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/media?parent=434"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/categories?post=434"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/tags?post=434"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}