@formo/analytics 1.11.5 → 1.11.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
Add the following to your
|
|
7
|
+
Add the following to your page:
|
|
8
8
|
|
|
9
9
|
```html
|
|
10
10
|
<script>
|
|
@@ -84,9 +84,6 @@ const HomePage = () => {
|
|
|
84
84
|
const analytics = useFormoAnalytics();
|
|
85
85
|
|
|
86
86
|
useEffect(() => {
|
|
87
|
-
// Track a page view when the component is mounted
|
|
88
|
-
analytics?.page();
|
|
89
|
-
|
|
90
87
|
// Track a custom event
|
|
91
88
|
analytics?.track('custom_event', { key: 'value' });
|
|
92
89
|
}, [analytics]);
|
|
@@ -196,7 +193,6 @@ const YourComponent = () => {
|
|
|
196
193
|
const track = async () => {
|
|
197
194
|
try {
|
|
198
195
|
console.log('Tracking page hit...');
|
|
199
|
-
analytics.page(); // Track the page view
|
|
200
196
|
analytics.track('custom_event', { key: 'value' }); // Track a custom event
|
|
201
197
|
} catch (error) {
|
|
202
198
|
console.error('Failed to track page hit', error);
|