Pass referrer to function

I’m attempting to pass the external referrer from one function to another however it always comes back undefined. Can someone help ?


  1. import {fetch} from ‘wix-fetch’;

  2. import {ok, WixRouterSitemapEntry} from ‘wix-router’;

  3. var baseRef

  4. function myRouter_Router (request) {

  5. baseRef = request.referrer;

  6. }

  7. export function mobile_number_beforeInsert (item, context) {

  8. return fetchRequest(item);

  9. }

  10. function fetchRequest (item,request){

  11. let referrerurl = request.baseRef;

  12. }

hi, i will like to make a website like this https://bestskateboard.net/ on wix can you help me with this