![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
client-analytics
Advanced tools
With this Open Source Analytics Library, we want to provide all developers with the ability to move to an auto-instrumented event world where we can count on data being produced with standardized fields.
With this Open Source Analytics Library, we want to provide all developers with the ability to move to an auto-instrumented event world where we can count on data being produced with standardized fields.
For a deeper look into the Library, please visit our documentation.
You can install Client Analytics package using yarn (or npm):
yarn add client-analytics
User Event Tracking: Easily track user interactions such as clicks, form submissions, page views, and custom events. Gain insights into how users are engaging with your application.
Performance Metrics: Monitor key performance metrics such as page load times, resource timings, and network latency. Identify bottlenecks and areas for optimization.
Web Vitals Monitoring: Specifically designed to help you track and analyze Core Web Vitals, including Largest Contentful Paint (LCP), First Input Delay (FID), and Cumulative Layout Shift (CLS).
Customizable Configuration: Configure the Client Analytics package to suit your application's specific tracking and reporting needs. Customize event types, tracked metrics, and reporting destinations.
Data Privacy: The library does not track any user information by default. you can choose to enable session tracking to associate events with a specific user session.
Intuitive API: Client Analytics offers a user-friendly API that integrates seamlessly into your application codebase. No complex setup required.
import { init } from 'client-analytics';
init({
platform: 'web',
projectName: 'analytics-example',
});
The Client analytics library provides multiple features. You can use all of them or only the ones you need.
import { initTrackPageview } from 'client-analytics';
// you can pass any object that implement the listen method
// in this case we use createBrowserHistory
const history = createBrowserHistory();
initTrackPageview({
browserHistory: history,
});
import { trackEvent } from 'client-analytics';
trackEvent({
//required parameters
action: 'click',
component: 'button',
name: 'increment',
// optional metadata
count: count + 1,
});
import { trackMetric } from 'client-analytics';
trackMetric({
//required parameters
metricName: 'button_click',
metricType: MetricType.count,
value: count + 1,
// optional metadata
tags: {
extra: 'metadata',
},
});
The Client Analytics library is composed of multiple modules that can be used independently. You can customize the library to suit your application's specific tracking and reporting needs. This is the list of modules that you can customize:
export type Storage = {
networkLayer: NetworkLayer;
metricScheduler: Scheduler<Metric>;
eventScheduler: Scheduler<Event>;
location: Location;
identity: Identity;
device: Device;
};
In order to customize the library, you need to create a custom storage object and pass it to the init function. An example of cusotmization can be found in our tests.
import { init, injectComponents } from 'client-analytics';
// this will override the network layer
const overrides = {
createNetworkLayer: () => {
return {
sendEvents: (events) => {
// here you can send the events to your backend
// or any other service
console.log('sendEvents', events);
},
sendMetrics: (metrics) => {
// here you can send the metrics to your backend
// or any other service
console.log('sendMetrics', metrics);
},
};
},
};
init(
{
platform: 'web',
projectName: 'analytics-example',
},
overrides
);
// or if you like closures
const customInit = injectComponents(overrides);
customInit({
platform: 'web',
projectName: 'analytics-example',
});
// both options are equivalent
We welcome contributions from the community! If you encounter any issues or have suggestions for improvements, please open an issue on our GitHub repository.
This project is licensed under the MIT License.
FAQs
With this Open Source Analytics Library, we want to provide all developers with the ability to move to an auto-instrumented event world where we can count on data being produced with standardized fields.
We found that client-analytics demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.