docs icon indicating copy to clipboard operation
docs copied to clipboard

Update Google Analytics custom event sending

Open marcduiker opened this issue 10 months ago • 0 comments

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

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

Example:

<a onclick="ga('send', 'event', 'Tabs', 'Clicked', 'How-To: Save and get state - tabs-3-go');" class="nav-link" id="tabs-3-go-tab" data-toggle="tab" href="#tabs-3-go" role="tab" aria-controls="tabs-3-go" aria-selected="false">Go
  </a>

This notation is deprecated and needs to be replaced with:

gtag('event', '<event_name>', {
  <event_parameters>
});

More info here

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

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

marcduiker avatar Jan 24 '25 09:01 marcduiker