Integration with quala for analytics
For more information see the docs.
Click to expand
npm install analytics
npm install @analytics/quala
The @analytics/quala
package works in the browser and server-side in Node.js. To use, install the package, include in your project and initialize the plugin with analytics.
Below is an example of how to use the browser plugin. You must pass writeKey
to the plugin.
import Analytics from "analytics";
import qualaPlugin from "@analytics/quala";
const analytics = Analytics({
app: "awesome-app",
plugins: [
qualaPlugin({
writeKey: "123-xyz",
}),
// ... more plugins
],
});
/* Track a page view */
analytics.page();
/* Track a custom event */
analytics.track("cartCheckout", {
item: "pink socks",
price: 20,
companyId: "123-xyz",
});
/* Identify a visitor */
analytics.identify("user-id-xyz", {
firstName: "bill",
lastName: "murray",
companyId: "123-xyz",
});
After initializing analytics
with the qualaPlugin
plugin, data will be sent into Quala whenever analytics.page, analytics.track, or analytics.identify are called.
See additional implementation examples for more details on using in your project.
The @analytics/quala
package works in the browser and server-side in Node.js