From bc91c0c57db765a03d752179ebf11cb76d69cf6c Mon Sep 17 00:00:00 2001 From: Profiler Team Date: Tue, 22 Oct 2024 13:15:07 -0700 Subject: [PATCH] Add analytics tag for code search link PiperOrigin-RevId: 688665216 --- plugin/trace_viewer/tf_trace_viewer/tf-trace-viewer.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugin/trace_viewer/tf_trace_viewer/tf-trace-viewer.html b/plugin/trace_viewer/tf_trace_viewer/tf-trace-viewer.html index ed7d729d..21f7adc5 100644 --- a/plugin/trace_viewer/tf_trace_viewer/tf-trace-viewer.html +++ b/plugin/trace_viewer/tf_trace_viewer/tf-trace-viewer.html @@ -607,6 +607,13 @@ const codeSearchLinkElement = document.createElement('div'); codeSearchLinkElement.innerHTML = `Code Search: ${text}`; this._eventDetails.appendChild(codeSearchLinkElement); + codeSearchLinkElement.addEventListener('click', () => { + window.gtag && window.gtag('event', 'tv-code-search-click', { + 'screen_name': 'trace viewer', + 'event_category': 'click', + 'event_label': 'code_search_link' + }); + }); }, createCrossToolLink: function(toolName, toolLabel, params, text) {