-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Osvaldas Valutis
authored
Jan 23, 2023
1 parent
ea9a5b9
commit 4dca9ed
Showing
5 changed files
with
52 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,24 @@ A collection of analytics helper functions. | |
## Supported analytics services | ||
|
||
- Plausible | ||
- Ahoy | ||
|
||
### Plausible | ||
|
||
Make sure the API object is available at `window.plausible`. It usually is if the snippet was inserted via `<script>`. | ||
|
||
### Plausible | ||
|
||
Make sure the API object is available at `window.ahoy`. If you use it as NPM module you can expose the object like this: | ||
|
||
```js | ||
import ahoy from "ahoy.js" | ||
|
||
window.ahoy = ahoy | ||
``` | ||
|
||
|
||
### | ||
|
||
## Usage | ||
|
||
|
@@ -47,7 +65,8 @@ JSX | |
## Development | ||
|
||
1. Create `.env` and set variables of analytics services you prefer to test: | ||
- `PLAUSIBLE_DOMAIN` | ||
- `PLAUSIBLE_DOMAIN=something.site` | ||
- `AHOY_SCRIPT_URL=https://unpkg.com/[email protected]/dist/ahoy.js` | ||
2. `$ yarn install` | ||
3. `$ yarn dev` | ||
3. [localhost:1234](http://localhost:1234) | ||
|
@@ -64,7 +83,7 @@ _Defaults:_ | |
enableAutoEventAnalytics({ | ||
attributeName = `event-analytics`, | ||
sourceNode = document, | ||
services = [`plausible`], | ||
services = [`plausible`, `ahoy`], | ||
debug = false, | ||
}) | ||
``` | ||
|
@@ -111,7 +130,7 @@ _Defaults:_ | |
```js | ||
analyticizeEvent({ | ||
data, | ||
services = [`plausible`], | ||
services = [`plausible`, `ahoy`], | ||
debug = false | ||
}) | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "@oddcamp/analytics", | ||
"description": "Odd Camp analytics helpers library", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"author": "Odd Camp <[email protected]>", | ||
"license": "MIT", | ||
"main": "src/index.js", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters