
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@siteminder/canvas-analytics-js
Advanced tools
Configurable lightweight analytics utility for web
npm install @siteminder/canvas-analytics-js --save
Here is a quick example to get you started, it's all you need:
const config = {
serverUrl: "http://localhost:3040/api/v1/collect",
session: 'cd3',
trackers: [
{
target: {
selectorType: "direct",
object: window,
eventType: "load"
},
hit: {
type: "pageview",
data: {
cd2: "propertyId"
}
}
},
{
target: {
selectorType: "direct",
object: window,
eventType: "hashchange"
},
hit: {
type: "pageview"
}
},
{
target: {
selectorType: "querySelector",
matcher: "#testBtn",
eventType: "click"
},
hit: {
type: "event",
data: {
ec: "tester-category",
ea: "tester-action",
el: "tester-label",
ev: 1000
}
}
}
]
};
const analytics = new Analytics(config);
analytics.init();
Configuration
Config(Object)
|- session(string): this field is optional. When it's enabled, a uuid string will be injected to hit.data object
|- target(Object)
|--- selectorType(string): "querySelector" / "direct"
|--- matcher(string): when querySelector is chosen: valid CSS selector(s) syntax
|--- object(Object): when direct is chosen: window / document or other similar DOM object
|--- eventType(string): all supported DOM event handlers e.g. onclick
|- hit(Object)
|--- type(string): "pageview", "event"
|--- data(Object): any kind of data you want to pass to your severs like a ga compatible object
Current custom dimensions used as data keys in Analytic API;
Methods
init() - init the pluginCaveat
Please put the canvas-analytics-plugin ahead of its bootstrap code snippet.
You are welcome to use the following pattern to load the code:
<script src="./dist/analytics.umd.js" defer async></script>
<script src="./your-bootstrap-code.js" defer async></script>
in the file ./your-bootstrap-code.js
...
const config = {...}
const analytics = new Analytics(config);
analytics.init();
...
# install
npm install
# compile
npm run compile
# run app
npm run dev
npm run dev:browser
# test
npm run test
Detailed changes for each release are documented in the release notes.
Detailed commit guidelines are documented in the Commit Messages Guidelines
FAQs
Canvas Analyti
The npm package @siteminder/canvas-analytics-js receives a total of 49 weekly downloads. As such, @siteminder/canvas-analytics-js popularity was classified as not popular.
We found that @siteminder/canvas-analytics-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 130 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.