1/** 2 * Note: this script is not processed by Babel. 3 * For IE compat purposes, do not use const, let, or other > ES5 features 4 */ 5var scriptTag = document.querySelector("[src*='analysis.js']"); 6var _paq = window._paq || []; 7_paq.push(["disableCookies"]); 8_paq.push(["setDomains", ["*.brave.com"]]); 9_paq.push(["setSecureCookie", true]); 10_paq.push(["setDoNotTrack", true]); 11if (navigator.brave?.isBrave) { 12 var brave_ua = navigator.userAgent.replace("Chrome", "Chrome(Brave)"); 13 _paq.push(["appendToTrackingUrl", "ua=" + brave_ua]); 14} 15if (scriptTag.dataset["is-404"] === "true") { 16 _paq.push(['setDocumentTitle', '404/URL = ' + encodeURIComponent(document.location.pathname+document.location.search) + '/From = ' + encodeURIComponent(document.referrer)]); 17} 18_paq.push(["setCustomDimension", 1, navigator.language]); 19_paq.push(["setCustomDimension", 2, navigator.language]); 20_paq.push(["trackPageView"]); 21_paq.push(["enableLinkTracking"]); 22(function () { 23 var matomoId = parseInt(scriptTag.dataset.matomoId); 24 var u = "https://analytics.brave.com/"; 25 _paq.push(["setTrackerUrl", u + "piwik.php"]); 26 _paq.push(["setSiteId", matomoId]); 27})(); 28 29document.addEventListener("DOMContentLoaded", function () { 30 var click_events = [ 31 [ 32 ".is-desktop .site-nav .nav-item__download", 33 [ 34 "trackEvent", 35 "Research", 36 "Download Button", 37 "Sticky Navigation (Desktop)", 38 ], 39 ], 40 [ 41 ".is-mobile .site-nav .nav-item__download", 42 [ 43 "trackEvent", 44 "Research", 45 "Download Button", 46 "Sticky Navigation (Mobile)", 47 ], 48 ], 49 [ 50 "body.home-page .desktop-download-button a", 51 [ 52 "trackEvent", 53 "Research", 54 "Download Button", 55 "New Home Download (Desktop)", 56 ], 57 ], 58 [ 59 "body.home-page .mobile-download-button a", 60 [ 61 "trackEvent", 62 "Research", 63 "Download Button", 64 "New Home Download (Mobile)", 65 ], 66 ], 67 [ 68 "body.home-page .brave-the-web-button a", 69 [ 70 "trackEvent", 71 "Research", 72 "Download Button", 73 "Brave the Web Download", 74 ], 75 ], 76 [ 77 "#footer-section a[href$='/download/']", 78 ["trackEvent", "Research", "Download Button", "Footer Link"], 79 ], 80 [ 81 "#btnDownload", 82 [ 83 "trackEvent", 84 "Brave Ads Trial", 85 "Download Button", 86 "Windows (Release)", 87 ], 88 ], 89 [ 90 "#btnDownload2", 91 [ 92 "trackEvent", 93 "Brave Ads Trial", 94 "Download Button", 95 "macOS (Release)", 96 ], 97 ], 98 [ 99 "#download-page .download-macOS.desktop", 100 ["trackEvent", "Brave Core", "Download Button", "macOS (Release)"], 101 ], 102 [ 103 "#download-page .download-win32.desktop", 104 ["trackEvent", "Brave Core", "Download Button", "Win32 (Release)"], 105 ], 106 [ 107 "#download-page .download-win64.desktop", 108 ["trackEvent", "Brave Core", "Download Button", "Win64 (Release)"], 109 ], 110 [ 111 "#download-page .download-DUM.desktop", 112 ["trackEvent", "Brave Core", "Download Button", "Linux (Release)"], 113 ], 114 [ 115 "#tips-download-header", 116 [ 117 "trackEvent", 118 "Rewards tips", 119 "Download Button Header", 120 "Nightly Tips Download", 121 ], 122 ], 123 [ 124 "#tips-download-footer", 125 [ 126 "trackEvent", 127 "Rewards tips", 128 "Download Button Footer", 129 "Nightly Tips Download", 130 ], 131 ], 132 [ 133 "#tips-creators-header", 134 [ 135 "trackEvent", 136 "Rewards tips", 137 "Creators Button", 138 "Tips Become a Creator", 139 ], 140 ], 141 [ 142 "#tips-creators-footer", 143 [ 144 "trackEvent", 145 "Rewards tips", 146 "Creators Button", 147 "Tips Become a Creator", 148 ], 149 ], 150 [ 151 "#tips-creators-tweet a[href='https://creators.brave.com/']", 152 [ 153 "trackEvent", 154 "Rewards tips", 155 "Creators Link", 156 "Tips Creator Tweet Widget", 157 ], 158 ], 159 [ 160 "#tips-creators-twitch a[href='https://creators.brave.com/']", 161 [ 162 "trackEvent", 163 "Rewards tips", 164 "Creators Link", 165 "Tips Creator Twitch Widget", 166 ], 167 ], 168 [ 169 "#tips-creators-youtube a[href='https://creators.brave.com/']", 170 [ 171 "trackEvent", 172 "Rewards tips", 173 "Creators Link", 174 "Tips Creator YouTube Widget", 175 ], 176 ], 177 [
178 "#home-download-button-hero", 179 [ 180 "trackEvent", 181 "Research", 182 "Download Button", 183 "Hero Download Button", 184 ], 185 ], 186 [ 187 "#wallet-download-button-hero", 188 [ 189 "trackEvent", 190 "Research", 191 "Download Button", 192 "Wallet Hero Download Button", 193 ], 194 ], 195 [ 196 "#wallet-download-button-lower", 197 [ 198 "trackEvent", 199 "Research", 200 "Download Button", 201 "Wallet Lower Download Button", 202 ], 203 ], 204 [ 205 "#firewall-vpn-download-button-hero", 206 [ 207 "trackEvent", 208 "Research", 209 "Download Button", 210 "Firewall VPN Download Button" 211 ], 212 ], 213 [ 214 "#rewards-page-download-button-hero", 215 [ 216 "trackEvent", 217 "Research", 218 "Download Button", 219 "Rewards Page Hero Download Button", 220 ], 221 ], 222 [ 223 "#rewards-page-download-button-lower", 224 [ 225 "trackEvent", 226 "Research", 227 "Download Button", 228 "Rewards Page Lower Download Button", 229 ], 230 ], 231 [ 232 "#news-page-download-button-hero", 233 [ 234 "trackEvent", 235 "Research", 236 "Download Button", 237 "Brave News Page Hero Download Button", 238 ], 239 ], 240 [ 241 "#top-nav-download-button-desktop", 242 [ 243 "trackEvent", 244 "Research", 245 "Download Button", 246 "Top Nav Download Button", 247 ], 248 ], 249 [ 250 "#top-nav-download-button-mobile", 251 [ 252 "trackEvent", 253 "Research", 254 "Download Button", 255 "Top Nav Download Button", 256 ], 257 ], 258 [ 259 "#top-nav-try-search-button", 260 [ 261 "trackEvent", 262 "Research", 263 "Try Search", 264 "Top Nav Search Button", 265 ], 266 ], 267 [ 268 "#home-download-button-lower", 269 [ 270 "trackEvent", 271 "Research", 272 "Download Button", 273 "Lower Hero Download Button", 274 ], 275 ], 276 [ 277 "#talk-download-button-hero", 278 [ 279 "trackEvent", 280 "Research", 281 "Download Button", 282 "Brave Talk Hero Download Button", 283 ], 284 ], 285 [ 286 "#talk-download-button-lower", 287 [ 288 "trackEvent", 289 "Research", 290 "Download Button", 291 "Brave Talk Lower Download Button", 292 ], 293 ], 294 [ 295 "#ms-store-download-badge", 296 [ 297 "trackEvent", 298 "Research", 299 "MS Store Download Badge", 300 "Microsoft store download badge", 301 ], 302 ], 303 [ 304 "#download-page-download-button-hero", 305 [ 306 "trackEvent", 307 "Downloads", 308 "Download Button", 309 "Download Page Download Button", 310 ], 311 ] 312 ]; 313 314 var tracked_buttons = []; 315 316 // Capture buttons with data-event-track attribute 317 document.querySelectorAll("[data-track-event]").forEach(function (button) { 318 if ( 319 button.dataset.trackEvent !== "false" && 320 button.dataset.eventCategory && 321 button.dataset.eventAction && 322 button.dataset.eventName 323 ) { 324 var config = [ 325 "trackEvent", 326 button.dataset.eventCategory, 327 button.dataset.eventAction, 328 button.dataset.eventName 329 ]; 330 if (button.dataset.eventValue) config.push(button.dataset.eventValue); 331 tracked_buttons.push([button, config]); 332 } 333 }); 334 335 // Capture buttons from array
336 click_events.forEach(function (config) { 337 var button = document.querySelector(config[0]); 338 if (!button) return; 339 if (tracked_buttons.some(v => v[0] === button)) { 340 return; 341 } 342 tracked_buttons.push([button, config[1]]); 343 }); 344 345 // Add tracking to all buttons 346 tracked_buttons.forEach(function ([ button, config ]) { 347 button.addEventListener("click", function (e) { 348 if (!!button.disabled) return; 349 _paq.push(config); 350 }); 351 }) 352});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.