I would like to track how often users download files using Google Analytics events, but even though the events seem to have been sent, .gif tracking doesn't seem to work.
To upload files, users must fill out a short form. The information entered into this form is checked by the checkSubmit() function (which returns false when the information entered is invalid or incomplete, true when the information is good for sending). After sending, the user is redirected to the file.
<script> function checkSubmit() { β¦ if(dataIsGood) { _gaq.push(['_trackEvent', 'Download', 'the_filename.xxx']); return true; </script> <form action="/form/emailcaptureform" method="post" onSubmit="return checkSubmit();"> β¦ </form>
In the Chrome console, the Google Analytics Tracking Tracker says that the event tracking beacons are loading, but the console says that it failed to load the __utm.gif resource
This only happens with events that were clicked just before the form was submitted . Events elsewhere on my site, including the Form event that was triggered when the form information does not fit (in the else block above)
The Google Analytics snippet works by accepting _trackPageview and _trackEvent s.
The request URL for __utm.gif is well-formed : copying and pasting the URL from the gadebug output file into the location bar returns __utm.gif without a hitch.
The event is ejected without problems when pressed from another element. For example:
<a href="#" onClick="_gaq.push(['_trackEvent', 'Download', the_filename.xxx']);">Event!</a>
Clicking the event pauses for a few seconds, and returning true does not seem to affect adding a pause before submitting the form.
Do you have any solutions or suggestions?
javascript forms form-submit google-analytics
lucasrizoli Feb 08 2018-11-11T00: 00Z
source share