WordPress.org

Ready to get started?Download WordPress

Forums

Google Analytics for WordPress
JQuery undefined when tracking comments and loading in the footer (1 post)

  1. IanRr
    Member
    Posted 1 year ago #

    This comment tracking code outputs a few lines above where my theme is calling, in the footer, a CDN-hosted script with the handle 'jquery' (we are unregistering the WP's stock 'jquery' script)...

    <script type="text/javascript">
    jQuery(document).ready(function () {
    	jQuery('#commentform').submit(function () {
    		_gaq.push(
    			['_setAccount', 'UA-*******-2'],
    			['_trackEvent', 'comment', 'submit']
    		);
    	});
    });
    </script>

    We don't know what "jQuery" is yet, so:

    Uncaught ReferenceError: jQuery is not defined

    Is anyone else having this issue, or is there something silly I'm doing wrong? I think I can workaround it if I really need to (I don't) but it seems like a bug.

    I will also accept convincing arguments that jQuery should be in the header: must be convincing enough for my boss :)

    http://wordpress.org/extend/plugins/google-analytics-for-wordpress/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic