I am attempting to make a log when someone goes to a certain page, but after I make the log, I navigate them away. Unfortunately this prevents the logs from also appearing even though I do the log before the navigation. Is there a way to make this work?
import wixLocation from ‘wix-location’ ;
import wixWindow from ‘wix-window’ ;
$w . onReady ( function () {
// Write your JavaScript here
console . log ( “Site visited from QR code.” );
wixWindow . getCurrentGeolocation ()
. then ( ( obj ) => {
let timestamp = obj . timestamp ; // 1495027186984
let latitude = obj . coords . latitude ; // 32.0971036
let longitude = obj . coords . longitude ; // 34.774391099999995
let altitude = obj . coords . altitude ; // null
let accuracy = obj . coords . accuracy ; // 29
let altAccuracy = obj . coords . altitudeAccuracy ; // null
let heading = obj . coords . heading ; // null
let speed = obj . coords . speed ; // null
console . log ( obj );
[wixLocation](wixLocation.to("myspotify) [.](wixLocation.to("myspotify) [to](wixLocation.to("myspotify) [(](wixLocation.to("myspotify) ["myspotify](wixLocation.to("myspotify) [u]page[/u] " );
wixLocation . to ( "/" );
} )
. catch ( ( error ) => {
let errorMsg = error ;
});
});