dapr / dapr/docs

Update Google Analytics custom event sending

Open
#4,503 0 comments 0 reactions 1 assignee Assigned to @marcduiker View on GitHub
website/functionality
Dominant language
SCSS
Stars
1k
Forks
794
Avg merge
2d 8h
Merged PRs (30d)
7

Description

**Describe the bug**
Currently the docs site uses this notation for sending custom events:

```js
ga('send', 'event', 'Tabs', 'Clicked', 'How-To: Save and get state - tabs-3-go')`
```

Example:
```html
Go

```

This notation is deprecated and needs to be replaced with:

```js
gtag('event', '', {

});
```

More info [here](https://developers.google.com/analytics/devguides/collection/ga4/events?client_type=gtag)

**Steps to reproduce**
1. Go to any page with (tab)links: such as https://docs.dapr.io/developing-applications/building-blocks/state-management/howto-get-save-state/.
2. Click on one of the language tabs: `Java`
3. There will be an error logged in the browser dev console:

![Image](https://github.com/user-attachments/assets/315229a7-4f1a-4306-9e1c-932d648db78c)

**Expected behavior**
No errors related to Google Analytics when clicking on buttons or links.

**Desktop (please complete the following information):**
- OS: Windows
- Browser: Edge
- Version: 132.0.2957.115

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.