1

I need help with setting up Google Analytics Goal. Actually I have set it up but I have problem connecting the site with the goal. I have two optional goals - destination and event. Event goal is supposed fire when a contact form is submitted. The destination form is is exactly the same as a goal but it is fired when redirect url is visited. This url is provided after successful form submission so I think this is the better one.

I have set it up in the GA admin panel but I don't know what to do next. When adding event tracking I need to add the snippet of code in the anchor as an attribute. What should I do now?

Thanks

3
  • 1
    Just to clarify, when someone submits your contact form, to they get redirected to another URL in their browser or not?
    – zigojacko
    Jan 16, 2014 at 9:39
  • Yes but on the same page. They get section that was hidden but it extends the URL. I have tried to do the destination goal but it says that a code needs to be added to the destination page. Since it is the same page I am stuck here. Jan 16, 2014 at 11:46
  • OK, thanks for confirming. So in this case, you'll need to register an event in Google Analytics yes. I'll try and answer very soon for you.
    – zigojacko
    Jan 16, 2014 at 13:00

1 Answer 1

1

You'll need to add an onclick push event to the submit button of your contact form.

For example, something like:-

onClick="_gaq.push(['_trackEvent', 'contact', 'enquiry', 'contact form',, false]);"

As an example, this in context would be along the lines of:-

<input id=”contact-submit” class=”button” type=”submit” value=”Submit” onClick="_gaq.push(['_trackEvent', 'contact', 'enquiry', 'contact form',, false]);">

Then, in Google Analytics, you'll need to add the event to correspond with the code used above.

  1. Open up the profile you wish to set up the goal in.
  2. Click the gear icon in the upper right corner of the Google Analytics interface.
  3. Click the Goals tab (in the sub-navigation just below where your Profile is listed)
  4. Choose the Goal Set you wish to add the event to.
  5. Name your goal and select the Event radio button.
  6. Populate the following goal details:

Category | that matches | contact Action | that matches | enquiry Label | that matches | contact form Value | that matches |

  1. If you’ve added a Value in step 1, leave the “Use the actual Event Value” radio button selected.

  2. Click “Save” and you’re ready to go!

8
  • Thanks a lot Geoff! Your answer has really helped me. Now it works but now I have a problem with Mozilla Firefox 26.0 on Windows. On Mac OSX it works on all browsers but on FF 26.0 on Windows it doesn't. I wasn't able to find anything similar on this matter but it really is frustrating. If you want to look at yourself you can check it out here www.fundamentum.com There is a form at eh bottom of the page. You can inspect Send button to see the code. Thanks. Jan 22, 2014 at 13:51
  • No problem. Your code looks correct. I just submitted the form via Firefox on Windows 7. I can't see anything wrong frontend. Try clearing Firefox cache maybe.
    – zigojacko
    Jan 22, 2014 at 15:22
  • Firefox is fresh installed because I don't use it so it is not a matter of cache. Jan 23, 2014 at 13:51
  • What exactly isn't happening when using Firefox?
    – zigojacko
    Jan 23, 2014 at 14:20
  • A goal is not triggered and it is not showing up in Real-time Analytics. Well I don't know if it is not triggered but I know it is not showing up in GA. Jan 23, 2014 at 20:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.