mirror of
https://github.com/techno-tim/littlelink-server.git
synced 2024-11-21 05:15:22 +01:00
fix: umami tracking (#603)
* fix: umami tracking * fix: umami tracking test
This commit is contained in:
parent
88c4e48e38
commit
2440d47294
@ -164,12 +164,12 @@ Generated tracking code should look like:
|
||||
<script async defer data-website-id="00000000-1111-2222-3333-444444444444" src="https://your-umami-app.com/umami.js"></script>
|
||||
```
|
||||
|
||||
Use `data-website-id` as environment variable `UMAMI_WEBSITE_ID`. Take the inital root host of `src` as `UMAMI_APP_URL`, and the name of the script (i.e. `umami.js` or `script.js`) as `UMAMI_SCRIPT_NAME`.
|
||||
Use `data-website-id` as environment variable `UMAMI_WEBSITE_ID`. Take the initial root host of `src` as `UMAMI_APP_URL`, and the name of the script (i.e. `umami.js` or `script.js`) as `UMAMI_SCRIPT_NAME`.
|
||||
|
||||
Sample event for YouTube button.
|
||||
|
||||
```javascript
|
||||
window.umami('youtube-button');
|
||||
window.umami.track('youtube-button');
|
||||
```
|
||||
|
||||
#### Matomo
|
||||
|
@ -27,7 +27,7 @@ Use `data-website-id` as environment variable `UMAMI_WEBSITE_ID`. Take the inita
|
||||
Sample event for YouTube button.
|
||||
|
||||
```javascript
|
||||
window.umami('youtube-button');
|
||||
window.umami.track('youtube-button');
|
||||
```
|
||||
|
||||
### Matomo
|
||||
|
@ -6,7 +6,9 @@ describe('umami.js', () => {
|
||||
const originalWindow = { ...window };
|
||||
windowSpy.mockImplementation(() => ({
|
||||
...originalWindow,
|
||||
umami: mockedUmami,
|
||||
umami: {
|
||||
track: mockedUmami,
|
||||
},
|
||||
}));
|
||||
it('should call umami with event', () => {
|
||||
trackUmamiEvent('youtube-button');
|
||||
|
@ -1,3 +1,3 @@
|
||||
export function trackUmamiEvent(event) {
|
||||
window.umami(event);
|
||||
window.umami.track(event);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user