I am trying to create a campaign page that gest redirected to from the home page just on the first enter on the website using a cookie that gets deleted when the browser is deleted but i can't figure out how to return a 302 status code to not affect my SEO. Or does this way of redirect not affect SEO and there should be no problem. This is my code
<html>
<head>
<title></title>
<meta charset="utf-8">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script type="text/javascript" src="https://example.com/splash/js/cookie.js"></script>
<script type="text/javascript">
$(function() {
var COOKIE_NAME = 'isOnBoardingCompleted';
var OnBoarded = Cookies.get(COOKIE_NAME);
if (!OnBoarded) {
Cookies.set(COOKIE_NAME, true);
// send to on-boarding screen
window.location = "https://www.example.com/campaign";
}
});
</script>
</head>
<body></body>
</html>