wixWindow.referrer; returning null

I’musing thiscode to get the referret but it is returning null

let referrer = wixWindow.referrer;  // "http://somesite.com"
console.log(referrer);

Look at this link: https://www.wix.com/code/reference/wix-window.html#referrer

Try something like this as stated on that link:

Get the previous page within a Wix site

This example demonstrates how to use session storage to know which page is the page a site visitor previously visited. The code below needs to be placed in the Site tab so that it runs on all your site’s pages. The code retrieves the URL of the page a visitor previously visited from session storage. It then stores the URL of the vistor’s current page in session storage. When the visitor navigates to another page, this stored URL is retrieved as the previous page URL.

// In Site tab

import {session} from 'wix-storage';
import wixLocation from 'wix-location';

let previousPageURL;

$w.onReady(function () {
  previousPageURL = session.getItem("page");
  session.setItem("page", wixLocation.url);
});

This is another back button code example from Yisrael (Wix Mod):

This example shows how to implement a Back Button to allow the site visitor to return to the previously viewed site page. This feature will only work for a published site and will not work in the Editor.​

Note that the code is added to the Site tab of the code so that it is available on all pages.

// For full API documentation, including code examples, visit http://wix.to/94BuAAs
// For full API documentation, including code examples, visit http://wix.to/94BuAAs
import wixWindow from 'wix-window';
import {session} from 'wix-storage';
import wixLocation from 'wix-location';

let previousPageURL;

$w.onReady(function () {

    previousPageURL = session.getItem("page");
    console.log(previousPageURL);
    session.setItem("page", wixLocation.url);
    $w("#btnBack").link = previousPageURL;
    $w("#btnBack").target = "_self";
});