Jump to content

Google Analytics track form submissions using jQuery


foevah

Recommended Posts

I have added the following jQuery after the google analytics code:

$(document).ready(function() {
$("#pre-book").attr("onSubmit", "pageTracker._trackEvent('Signup Forms','AMF Signup','Newsletter',2.0);");
});

 

this picks up the form with id pre-book and it adds the onSubmit code to it:

onsubmit="pageTracker._trackEvent('Signup Forms','AMF Signup','Newsletter',2.0);"

 

i did this yesterday and submitted my details into the form but when I look in google analytics event tracking overview this hasn't been detected?

 

does anyone know what I am doing wrong?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.