### Foresight is an analytics library that allows for declarative event tracking.
* Lightweight (<3kb minified and gzipped)
* Lightweight (<4kb minified and gzipped)
* Declarative event tracking
* Performant
...
...
@@ -92,6 +92,23 @@ The above markup would send the following event data when the `div` enters the v
---
### Tracking custom metrics and custom dimensions
Custom metrics and dimensions can be tracked by attaching additional HTML attributes
under the `data-track:metrics:<metric_name>` or `data-track:dimensions:<metric_name>` namespace. The value of the attribute will be the value of the metric/dimension. You can have multiple custom metrics/dimensions per element.
The follow example will send a value of `1` to the custom metric in the `metric1` index.
***[gtag.js](https://developers.google.com/analytics/devguides/collection/gtagjs/custom-dims-mets)** — `metric_name` should be the name provided in `custom_map`