Skip to content

Commit

Permalink
Add analytics tag for code search link
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 688446076
  • Loading branch information
Profiler Team authored and copybara-github committed Oct 22, 2024
1 parent 6a1c3a6 commit 4bf2203
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions plugin/trace_viewer/tf_trace_viewer/tf-trace-viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,13 @@
const codeSearchLinkElement = document.createElement('div');
codeSearchLinkElement.innerHTML = `Code Search: <a href="${url}" target="_blank">${text}</a>`;
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': `${toolName}_link`
});
});
},

createCrossToolLink: function(toolName, toolLabel, params, text) {
Expand Down

0 comments on commit 4bf2203

Please sign in to comment.