Skip to content

Commit 21d04ef

Browse files
committed
fix: build, update trackEvent docs, update lockfiles
1 parent 6731773 commit 21d04ef

8 files changed

Lines changed: 26 additions & 178 deletions

File tree

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v18.19.0

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ Custom events enable tracking visitor actions that are not predefined in the exi
190190
import { CustomEvent } from '@piwikpro/react-piwik-pro'
191191
```
192192
#### Methods
193-
* `trackEvent(category: string, action: string, name?: string, value?: number) ` - Tracks a custom event, e.g. when a visitor interacts with the page.
193+
* `trackEvent(category: string, action: string, name?: string, value?: number, dimensions?: Object) ` - Tracks a custom event, e.g. when a visitor interacts with the page.
194194

195195
### Site search Service
196196
Site search tracking gives you insights into how visitors interact with the search engine on your website - what they search for and how many results they get back.

example/package-lock.json

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/src/pages/CustomEventPage.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,15 @@ const CustomEventPage: FunctionComponent = () => {
4545
variant='contained'
4646
onClick={() => {
4747
setFinish(true)
48-
CustomEvent.trackEvent('user_data_form', 'submit')
48+
CustomEvent.trackEvent(
49+
'user_data_form',
50+
'submit',
51+
'success',
52+
10,
53+
{ dimension1: 'value1' }
54+
)
4955
enqueueSnackbar(
50-
"CustomEvent.trackEvent('user_data_form', 'submit')",
56+
"CustomEvent.trackEvent('user_data_form', 'submit', 'success', 10, { dimension1: 'value1' })",
5157
{ variant: 'success' }
5258
)
5359
}}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"predeploy": "cd example && yarn install && yarn run build",
2424
"deploy": "gh-pages -d example/build",
2525
"format":"prettier src/**/*.ts --list-different",
26-
"format:fix":"npm run format -- --write"
26+
"format:fix":"npm run format -- --write",
27+
"typecheck": "tsc --noEmit"
2728
},
2829
"peerDependencies": {
2930
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",

src/index.ts renamed to src/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// NOTE: .tsx file extension is required for microbundle-crl to pick up and build the lib
12
import * as PiwikPro from './core'
23

34
export * as PageViews from './services/pageViews/pageViews.service';

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"noImplicitThis": true,
1313
"noImplicitAny": true,
1414
"strictNullChecks": true,
15-
"suppressImplicitAnyIndexErrors": true,
15+
"skipLibCheck": true,
1616
"noUnusedLocals": false,
1717
"noUnusedParameters": false,
1818
"allowSyntheticDefaultImports": true

yarn.lock

Lines changed: 12 additions & 164 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)