Skip to content

Commit fed74fc

Browse files
authored
Update Analytics.md
1 parent 2924987 commit fed74fc

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

.github/docs/Analytics.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ To make the initialization simple use `GoogleAnalyticsInitializer` component in
2222
## `Google Analytics` extension
2323
This is a JS wrapper for web analytics service offered by Google that tracks and reports website traffic, etc. inside the Google Marketing Platform.
2424

25-
### `PermaLinkElement` component
25+
### `GoogleAnalyticsInitializer` component
2626
A convenient wrapper component for `IGoogleAnalyticsService` to make Google Analytics initialize simple.
2727

2828
#### Properties
@@ -32,6 +32,10 @@ Google Analytics TrackingId provided on Google Analytics manage page.
3232
### `IGoogleAnalyticsService` service
3333
Injectable service to handle Google analytics `gtag.js`.
3434

35+
#### Properties
36+
- **`TrackingId`**: **`string TrackingId { get; set; }` - Required** <br />
37+
Google analytics uniquely Id which was used in `InitializeAsync(string)` method.
38+
3539
#### Functions
3640
- **`InitializeAsync()`**: **`ValueTask InitializeAsync(string trackingId)`** <br />
3741
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
4145
such as Google Ads or Google Analytics.
4246
- **`GetAsync()`**: **``** <br />
4347
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 />
4549
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 />
4751
Use the event command to send event data.
48-
- **`CustomEventAsync()`**: **``** <br />
52+
- **`CustomEventAsync()`**: **`ValueTask CustomEventAsync(string customEventName, GoogleAnalyticsCustomEventArgs eventData)`** <br />
4953
Use the event command to send custom event data.
5054

5155
# Configuration
@@ -88,9 +92,6 @@ public static async Task Main(string[] args)
8892
```
8993
@*Google Analytics initialize*@
9094
<GoogleAnalyticsInitializer TrackingId="<TrackingId here...>" />
91-
92-
@code {
93-
}
9495
```
9596

9697
#### Server hosted projects
@@ -111,9 +112,6 @@ public void ConfigureServices(IServiceCollection services)
111112
```
112113
@*Google Analytics initialize*@
113114
<GoogleAnalyticsInitializer TrackingId="<TrackingId here...>" />
114-
115-
@code {
116-
}
117115
```
118116

119117
#### Using `IGoogleAnalyticsService` service
@@ -126,7 +124,7 @@ For full features supported by Google Analytics please see [docs page](https://d
126124
@inject IGoogleAnalyticsService _googleAnalytincsService
127125
@implements IAsyncDisposable
128126
129-
@code{
127+
@code {
130128
protected override async Task OnAfterRenderAsync(bool firstRender)
131129
{
132130
if(firstRender)
@@ -155,7 +153,7 @@ For full features supported by Google Analytics please see [docs page](https://d
155153
Label = "Test label",
156154
Value = 1234
157155
});
158-
156+
159157
160158
public async ValueTask DisposeAsync()
161159
{

0 commit comments

Comments
 (0)