@@ -22,7 +22,7 @@ To make the initialization simple use `GoogleAnalyticsInitializer` component in
22
22
## ` Google Analytics ` extension
23
23
This is a JS wrapper for web analytics service offered by Google that tracks and reports website traffic, etc. inside the Google Marketing Platform.
24
24
25
- ### ` PermaLinkElement ` component
25
+ ### ` GoogleAnalyticsInitializer ` component
26
26
A convenient wrapper component for ` IGoogleAnalyticsService ` to make Google Analytics initialize simple.
27
27
28
28
#### Properties
@@ -32,6 +32,10 @@ Google Analytics TrackingId provided on Google Analytics manage page.
32
32
### ` IGoogleAnalyticsService ` service
33
33
Injectable service to handle Google analytics ` gtag.js ` .
34
34
35
+ #### Properties
36
+ - ** ` TrackingId ` ** : ** ` string TrackingId { get; set; } ` - Required** <br />
37
+ Google analytics uniquely Id which was used in ` InitializeAsync(string) ` method.
38
+
35
39
#### Functions
36
40
- ** ` InitializeAsync() ` ** : ** ` ValueTask InitializeAsync(string trackingId) ` ** <br />
37
41
Initialize Google analytics by registering gtag.js to the HTML document. ** Should be called once.
@@ -41,11 +45,11 @@ Allows you to add additional configuration information to targets. This is typic
41
45
such as Google Ads or Google Analytics.
42
46
- ** ` GetAsync() ` ** : ** ``** <br />
43
47
Allows you to get various values from gtag.js including values set with the set command.
44
- - ** ` SetAsync() ` ** : ** ``** <br />
48
+ - ** ` SetAsync() ` ** : ** ` ValueTask SetAsync(ExpandoObject parameters) ` ** <br />
45
49
Allows you to set values that persist across all the subsequent gtag() calls on the page.
46
- - ** ` EventAsync() ` ** : ** ``** <br />
50
+ - ** ` EventAsync() ` ** : ** ` ValueTask EventAsync(GoogleAnalyticsEventTypes eventType, ExpandoObject eventParams) ` ** <br />
47
51
Use the event command to send event data.
48
- - ** ` CustomEventAsync() ` ** : ** ``** <br />
52
+ - ** ` CustomEventAsync() ` ** : ** ` ValueTask CustomEventAsync(string customEventName, GoogleAnalyticsCustomEventArgs eventData) ` ** <br />
49
53
Use the event command to send custom event data.
50
54
51
55
# Configuration
@@ -88,9 +92,6 @@ public static async Task Main(string[] args)
88
92
```
89
93
@*Google Analytics initialize*@
90
94
<GoogleAnalyticsInitializer TrackingId="<TrackingId here...>" />
91
-
92
- @code {
93
- }
94
95
```
95
96
96
97
#### Server hosted projects
@@ -111,9 +112,6 @@ public void ConfigureServices(IServiceCollection services)
111
112
```
112
113
@*Google Analytics initialize*@
113
114
<GoogleAnalyticsInitializer TrackingId="<TrackingId here...>" />
114
-
115
- @code {
116
- }
117
115
```
118
116
119
117
#### Using ` IGoogleAnalyticsService ` service
@@ -126,7 +124,7 @@ For full features supported by Google Analytics please see [docs page](https://d
126
124
@inject IGoogleAnalyticsService _googleAnalytincsService
127
125
@implements IAsyncDisposable
128
126
129
- @code{
127
+ @code {
130
128
protected override async Task OnAfterRenderAsync(bool firstRender)
131
129
{
132
130
if(firstRender)
@@ -155,7 +153,7 @@ For full features supported by Google Analytics please see [docs page](https://d
155
153
Label = "Test label",
156
154
Value = 1234
157
155
});
158
-
156
+
159
157
160
158
public async ValueTask DisposeAsync()
161
159
{
0 commit comments