WoWInterface (
-   Minion (
-   -   Download button still doesnt work... (

Phanx 08-11-14 11:19 AM

Download button still doesnt work...
... when Google Analytics isn't loaded.
<div class="dwnldBtn"><a onclick="ga('send', 'event', 'Downloads', 'Minion-Win', { 'hitCallback': function() { document.location = ''; }}); return false;" href=""></a></div>
That "return false" is the problem. If GA really requires hardcoded onclick handlers, you can at least wrap it in a check so it doesn't break the link when GA isn't available:
<div class="dwnldBtn"><a onclick="if(window.gaGlobal){ga('send', 'event', 'Downloads', 'Minion-Win', { 'hitCallback': function() { document.location = ''; }}); return false;}" href=""></a></div>
This currently affects the download button itself, and the links right below it for downloading for other operating systems.

Dolby 08-11-14 11:39 AM

Thanks Phanx, I'll try that. :)

ravagernl 08-11-14 11:55 AM

Alternative, using error catching:

<div class="dwnldBtn"><a onclick="try{ga('send', 'event', 'Downloads', 'Minion-Win', { 'hitCallback': function() { document.location = ''; }}); return false;}catch(e){}" href=""></a></div>

Phanx 08-11-14 01:21 PM

That won't work, because the inline JavaScript on the page defines a default "ga" function if the real script fails to load, to avoid throwing errors. The current onclick handler is valid scripting and will run without error, it just won't result in the link actually being followed, because the fallback "ga" function doesn't execute the "hitCallback" function, or do anything else with any of the values passed to it.

Phanx 09-22-14 04:06 PM

Download button still does not work if Google Analytics is not loaded.

All times are GMT -6. The time now is 10:44 AM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2019 MMOUI