To use the location module, import wixLocationFrontend from the wix-location-frontend module:
The setter methods in wix-location-frontend can only be used when browser
rendering happens,
meaning you can only use them in frontend code after the page is ready.
You can use the getter methods for both backend or browser rendering.
The URL is broken into:
For premium sites, the URL of the incoming call has the following format:
https://www.domain.com/myPrefix/myPath?myQuery=myValue
https://www.domain.commyPrefixmyPathmyQuery=myValueExample:
https://domain.com/animals/elephant?species=african-elephant
https://domain.com/animals. Only for routers and dynamic pages.elephantspecies=african-elephantFor free sites, the URL of the incoming call has the following format:
https://user_name.wixsite.com/mysite/myPrefix/myPath?myQuery=myValue
https://user_name.wixsite.com/mysitemyPrefixmyPathmyQuery=myValueExample:
https://user_name.wixsite.com/zoo/animals/elephant?species=african-elephant
https://user.wixsite.com/zooanimals. Only for routers and dynamic pages.elephantspecies=african-elephantLearn more about wix-location-frontend in Getting Started and on Wix Learn.