|
91 | 91 | // event to be correlated in Google Analytics. |
92 | 92 | <text> |
93 | 93 | window.nuget.sendAnalyticsEvent('@category', '@action', @Html.Raw(Json.Encode(Model.SearchTerm)), @Model.PageIndex); |
94 | | - window.nuget.sendAiMetric('BrowserSearchPage', @Model.PageIndex, { |
| 94 | + window.nuget.sendMetric('BrowserSearchPage', @Model.PageIndex, { |
95 | 95 | SearchId: '@searchId', |
96 | 96 | SearchTerm: @Html.Raw(Json.Encode(Model.SearchTerm)), |
97 | 97 | IncludePrerelease: '@Model.IncludePrerelease', |
|
103 | 103 | } |
104 | 104 |
|
105 | 105 | $(function () { |
106 | | - var emitAiClickEvent = function () { |
107 | | - if (!window.nuget.isAiAvailable()) { |
108 | | - return; |
109 | | - } |
110 | | -
|
| 106 | + var emitClickEvent = function () { |
111 | 107 | var $this = $(this); |
112 | 108 | var data = $this.data(); |
113 | 109 | if ($this.attr('href') && data.track) { |
114 | | - window.nuget.sendAiMetric('BrowserSearchSelection', data.trackValue, { |
| 110 | + window.nuget.sendMetric('BrowserSearchSelection', data.trackValue, { |
115 | 111 | SearchId: '@searchId', |
116 | 112 | SearchTerm: @Html.Raw(Json.Encode(Model.SearchTerm)), |
117 | 113 | IncludePrerelease: '@Model.IncludePrerelease', |
|
132 | 128 | $.each($('a[data-track]'), function () { |
133 | 129 | $(this).on('mouseup', function (e) { |
134 | 130 | if (e.which === 2) { // Middle-mouse click |
135 | | - emitAiClickEvent.call(this, e); |
| 131 | + emitClickEvent.call(this, e); |
136 | 132 | } |
137 | 133 | }); |
138 | 134 | $(this).on('click', function (e) { |
139 | | - emitAiClickEvent.call(this, e); |
| 135 | + emitClickEvent.call(this, e); |
140 | 136 | }); |
141 | 137 | }); |
142 | 138 | }); |
|
0 commit comments