Add a google analytics event for clicked tabs

Signed-off-by: Nick Greenfield <nigreenf@microsoft.com>
This commit is contained in:
Nick Greenfield 2022-01-05 14:49:45 -08:00
parent d75af6898c
commit 587622de2e
1 changed files with 2 additions and 2 deletions

View File

@ -10,7 +10,7 @@
<!-- Generate the IDs for the <a> and the <div> elements -->
{{- $tabid := printf "%s-%s-tab" $guid $entry | anchorize -}}
{{- $entryid := printf "%s-%s" $guid $entry | anchorize -}}
<a class="nav-link{{ if eq ($.Scratch.Get "first") true }} active{{ end }}"
<a onclick="ga('send', 'event', 'Tabs', 'Clicked', '{{ $.Page.Title }} - {{ $entryid }}');" class="nav-link{{ if eq ($.Scratch.Get "first") true }} active{{ end }}"
id="{{ $tabid }}" data-toggle="tab" href="#{{ $entryid }}" role="tab"
aria-controls="{{ $entryid }}" aria-selected="{{ $.Scratch.Get "first" }}">
{{ . }}
@ -24,4 +24,4 @@
<!-- Inner content - generated by codetab shortcode -->
<div class="tab-content" id="{{- $guid -}}-content">
{{ .Inner }}
</div>
</div>