get Client Browser Parametersutility
utility
Gathers client browser values commonly used for analytics
Anchor to getClientBrowserParametersget Client Browser Parameters()
get Client Browser Parameters()
If executed on server, this method will return empty string for each field.
ClientBrowserParameters
navigationApi
string
Navigation api: .
Use to collect this value.
navigationType
string
Navigation type: .
Use to collect this value.
path
string
Value of window.location.pathname
.
Use to collect this value.
referrer
string
Value of window.document.referrer
.
Use to collect this value.
search
string
Value of window.location.search
.
Use to collect this value.
title
string
Value of document.title
.
Use to collect this value.
uniqueToken
string
Shopify unique user token: Value of cookie.
Use to collect this value.
url
string
Value of window.location.href
.
Use to collect this value.
userAgent
string
Value of .
Use to collect this value.
visitToken
string
Shopify session token: Value of cookie.
Use to collect this value.
Was this section helpful?
Example code
import * as React from 'react';
import {useEffect} from 'react';
import {getClientBrowserParameters} from '@shopify/hydrogen';
export default function App({Component, pageProps}) {
useEffect(() => {
getClientBrowserParameters();
});
return <Component {...pageProps} />;
}