Linking w/ code to anchor on separate page

Does anyone know a way to use Corvid to link to an anchor on another page? I have buttons on my homepage that I’d like to link to specific anchors on a different page.

Currently, the code I’m playing with looks like this:

export function hoverBox2_click(event) {
    wixLocation.to('/exchanges').then( () => {
       $w("#anchor1").scrollTo();
       }
    }

but it keeps telling me the anchor name is invalid, because it doesn’t exist on the homepage.

Any solutions?? Thanks in advance!

You can use the Wix-Storage

import {session} from 'wix-storage';

export function hoverBox2_click(event) {
session.setItem("location", "anchor");
    wixLocation.to('/exchanges');
  }

On your exchange page →

import {session} from 'wix-storage';

$w.onReady(function () {
 let value = session.getItem("location");
 if (value) {
 $w("#anchor1").scrollTo();
 }
});