Web Browser - For Web Developers - How To Resolve 400 Bad Request Errors on MSU Websites

Summary

This article is aimed at Web Developers for MSU websites with guidance how to resolve ongoing 400 Bad Request errors.

Body

Objective

Following these steps will reduce the cookie data that gets passed to msu.edu and prevent recurring 400 Bad Request errors on the affected site.

Environment

MSU.edu Websites

Before You Begin

There are two ways to resolve this issue:

  • RECOMMENDED - Reduce the amount of cookie data being passed to msu.edu. See the Steps section below for instructions.
  • Increasing server configuration to allow bigger header/cookie size

Steps

  1. Remove unused site trackers such as Hotjar and Clarity.
  2. For sites that use Google Tag Manager. Default uses parent “msu.edu” as the domain, instead of your domain.
    • For GTM users, go to Tag Configuration from the dashboard.
    • Find or add “cookie_domain” parameter.Value = [your web domain]
      Screenshot
  3. For sites that use gtag.js
    • Add the cookie_domain attribute seen in the screenshot above
    • Example: gtag('config', 'GA_TRACKING_ID', {'cookie_domain': 'YOUR_DOMAIN'});
  4. For sites that use analytics.js
    • You should upgrade your script as it is using the older UA JS.Then follow the gtag.js directions.
  5. Test the domain is set correctly using a plugin tool, such as EditThisCookie
    Screenshot

Additional Info

The HyperText Transfer Protocol (HTTP) 400 Bad Request response status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.

Details

Details

Article ID: 2037
Created
Thu 11/14/24 11:09 AM
Modified
Thu 11/14/24 11:38 AM

Related Articles

Related Articles (1)

When attempting to visit an MSU website, you receive a 400 Bad Request error, the verbiage of which may change depending on the web browser you are using. Clear cookies and cache to resolve. Report recurring issues to the IT Service Desk to initiate corrective action.

Related Services / Offerings

Related Services / Offerings (1)