@leancodepl/gtag 9.6.5 → 9.7.0

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 CHANGED
@@ -23,34 +23,34 @@ Creates a type-safe Google Tag Manager data layer push function.
23
23
  ### Basic Event Tracking
24
24
 
25
25
  ```typescript
26
- import { mkgtag } from '@leancodepl/gtag';
26
+ import { mkgtag } from "@leancodepl/gtag"
27
27
 
28
- const gtag = mkgtag<{ event: 'page_view'; page_title: string }>();
28
+ const gtag = mkgtag<{ event: "page_view"; page_title: string }>()
29
29
 
30
30
  gtag({
31
- event: 'page_view',
32
- page_title: 'Home Page',
33
- });
31
+ event: "page_view",
32
+ page_title: "Home Page",
33
+ })
34
34
  ```
35
35
 
36
36
  ### Custom Events with Callbacks
37
37
 
38
38
  ```typescript
39
- import { mkgtag } from '@leancodepl/gtag';
39
+ import { mkgtag } from "@leancodepl/gtag"
40
40
 
41
41
  interface CustomEvent {
42
- event: 'button_click';
43
- element_id: string;
42
+ event: "button_click"
43
+ element_id: string
44
44
  }
45
45
 
46
- const gtag = mkgtag<CustomEvent>();
46
+ const gtag = mkgtag<CustomEvent>()
47
47
 
48
48
  gtag({
49
- event: 'button_click',
50
- element_id: 'signup-button',
51
- eventCallback: (containerId) => {
52
- console.log('Event sent to container:', containerId);
49
+ event: "button_click",
50
+ element_id: "signup-button",
51
+ eventCallback: containerId => {
52
+ console.log("Event sent to container:", containerId)
53
53
  },
54
54
  eventTimeout: 2000,
55
- });
56
- ```
55
+ })
56
+ ```
package/index.cjs.js CHANGED
@@ -2,10 +2,10 @@
2
2
 
3
3
  /**
4
4
  * Creates a type-safe Google Tag Manager data layer push function.
5
- *
5
+ *
6
6
  * Returns a function that pushes events to the GTM data layer with type safety.
7
7
  * Handles cases where GTM is not initialized by safely checking for dataLayer existence.
8
- *
8
+ *
9
9
  * @template T - Event object type extending { event: string }
10
10
  * @returns Function that accepts data layer arguments and pushes to GTM
11
11
  * @example
package/index.esm.js CHANGED
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * Creates a type-safe Google Tag Manager data layer push function.
3
- *
3
+ *
4
4
  * Returns a function that pushes events to the GTM data layer with type safety.
5
5
  * Handles cases where GTM is not initialized by safely checking for dataLayer existence.
6
- *
6
+ *
7
7
  * @template T - Event object type extending { event: string }
8
8
  * @returns Function that accepts data layer arguments and pushes to GTM
9
9
  * @example
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leancodepl/gtag",
3
- "version": "9.6.5",
3
+ "version": "9.7.0",
4
4
  "license": "Apache-2.0",
5
5
  "publishConfig": {
6
6
  "access": "public",