Symmetrics
Know your website, not your users. It’s time to make the move away from Google Analytics. With Symmetrics, you own the data. Enjoy powerful visualization tools, full developer freedom, and happy users: Privacy is our top priority.
Start your free 7-day trial on https://getsymmetrics.com.
npm i symmetrics
Browser usage
Loading the signal
Retrieve your symmetricsId
from the Symmetrics website. Then import the script in your browser package:
;;
You can add an options
object as the second argument, like this:
;
Read more about signal options here.
Sending custom events
Ensure you’ve included and ran the above script before sending custom events.
;;
Read more about sending custom events here.
Server or non-browser usage
Retrieve your Symmetrics user ID and an authentication key from the Symmetrics website. Then import the package:
;const symmetrics = ;
The first argument is your Symmetrics user ID, the second is the authentication key. The third is an optional options object.
Options
timezoneOffset
(optional)
When using timestamps in queries, ensure the observer (client or server) timezone offset in relation to GMT is also provided. For GMT+2, the timezoneOffset
would be +7200000
, eg. two hours ahead.
const symmetrics = ;
You can set the current timezone offset like this:
const symmetrics = ;
This setting can be overridden per query.
query
: Performing queries
Write queries using JsonQl to extract the data you need.
;const symmetrics = ; // Using promisessymmetrics ; // Using asynctry const results = await symmetrics; console; catch error console;
Query options
A second argument queryOptions
can be passed to the query
function as an object.
timezoneOffset
(optional)
When using timestamps in queries, ensure the observer (client or server) timezone offset in relation to GMT is also provided. For GMT+2, the timezoneOffset would be +7200000
, eg. two hours ahead.
symmetrics;
You can add the current timezone offset like this:
symmetrics;
This setting overrides the top level client options timezoneOffset
.
signal
: Sending custom events
Use the built-in signal
function to send custom events.
;const symmetrics = ; // Using promisessymmetrics ; // Using asynctry const results = await symmetrics; console; catch error console;
Read more about sending custom events here.
Apps
apps.tweets
: Retrieving tweets about your websites
;const symmetrics = ; // Using promisessymmetricsapps ; // Using asynctry const results = await symmetricsapps; console; catch error console;
You can also provide an options
object with startTimestamp
and/or endTimestamp
to filter the output.
symmetricsapps;