@hanzo/ui 0.5.17 → 0.5.19
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/next/analytics/gtag.ts +18 -5
- package/package.json +3 -1
package/next/analytics/gtag.ts
CHANGED
|
@@ -1,14 +1,27 @@
|
|
|
1
|
-
|
|
1
|
+
// specific to site. In GA Console, under each Data Stream
|
|
2
|
+
export const GA_TRACKING_ID = process.env.NEXT_PUBLIC_GA_MEASUREMENT_ID
|
|
2
3
|
|
|
3
4
|
// https://developers.google.com/analytics/devguides/collection/gtagjs/pages
|
|
4
5
|
export const pageview = (url: string) => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
if (GA_TRACKING_ID) {
|
|
7
|
+
window.gtag('config', GA_TRACKING_ID, {
|
|
8
|
+
page_path: url,
|
|
9
|
+
})
|
|
10
|
+
}
|
|
8
11
|
}
|
|
9
12
|
|
|
10
13
|
// https://developers.google.com/analytics/devguides/collection/gtagjs/events
|
|
11
|
-
export const event = ({
|
|
14
|
+
export const event = ({
|
|
15
|
+
action,
|
|
16
|
+
category,
|
|
17
|
+
label,
|
|
18
|
+
value
|
|
19
|
+
}: {
|
|
20
|
+
action: string
|
|
21
|
+
category: string
|
|
22
|
+
label: string
|
|
23
|
+
value: string
|
|
24
|
+
}) => {
|
|
12
25
|
window.gtag('event', action, {
|
|
13
26
|
event_category: category,
|
|
14
27
|
event_label: label,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/ui",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.19",
|
|
4
4
|
"description": "Library that contains shared UI primitives, support for a common design system, and other boilerplate support.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/",
|
|
@@ -91,6 +91,8 @@
|
|
|
91
91
|
"@mdx-js/esbuild": "^3.0.0",
|
|
92
92
|
"@mdx-js/loader": "^3.0.0",
|
|
93
93
|
"@mdx-js/react": "^3.0.0",
|
|
94
|
+
"@types/facebook-pixel": "^0.0.30",
|
|
95
|
+
"@types/gtag.js": "^0.0.19",
|
|
94
96
|
"@types/lodash.merge": "^4.6.9",
|
|
95
97
|
"@types/mdx": "^2.0.9",
|
|
96
98
|
"@types/react": "^18.2.48",
|