Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I track multiple Google Analytics events at once?

I am using Event Tracking on our conversion form to pass the values of a few drop-downs to Google Analytics as events. Our conversion form is an inquiry form for our online degree programs. I only want to pass the values of the fields on form submit, so I have added the following code to the code that runs on successful submission of the form:

 $("#App,#InquiryForm").validate({    
   submitHandler: function (form) {
 $(".button").attr("value", "Please wait...");
 $(".button").attr("disabled", "disabled");

 _gaq.push(
     ['_trackEvent', 'Inq Form Academic Level', 'Academic Level', $('#AcademicLevel').val()],
     ['_trackEvent', 'Inq Form Delivery Time', 'Delivery Time', $('#CourseDeliveryTime').val()],
     ['_trackEvent', 'Inq Form Program Type', 'Program Type', $('#ProgramType').val()],
     ['_trackEvent', 'Inq Form Program', 'Program', $('#ProgramofInterest').val()]
);

 form.submit();
},

The purpose of this is to be able to segment our traffic that converted by what they were interested in. (e.g. What was the browsing behavior of visitors who inquired about our undergraduate degrees vs those that inquired about our graduate degrees).

Unfortunately, only the first event tracking script is running successfully, not the last three (regardless of what order I place them in - the first one is always the only one that is successful).

If you can help me to get this working, that would be fantastic! If not, perhaps some alternate suggestions to get at the data I need?

Thanks

like image 472
Cail Desrochers Avatar asked Mar 05 '12 19:03

Cail Desrochers


People also ask

Can you have multiple Google Analytics on one page?

Creating separate Google Analytics tags. You have to create separate GTM tags for each property. You cannot use a single tag to send data to multiple properties. If you want to send page views to two different properties, you will have to create two pageview tags.

How do I see all events in Google Analytics?

If you have already set up event tracking, then you can see the values of the 'event action' in Google Analytics by following the steps below: Step-1: Navigate to Behavior > Events > Top Events reports of your GA reporting view. Note: Google Analytics report 'event action' as a dimension in its reports.

Can I have multiple Google Analytics?

If you are using Analytics to track a single website, account organization is simple: you will have one account for your website. For setting up Analytics accounts to manage multiple websites, keep in mind the following: Each Analytics account can have up to 100 properties and each property can have up to 25 views.


1 Answers

I tested pushing multiple events with one push and it worked fine. It may be submitting the form before all the _trackEvents are pushed.

Try adding a setTimeout to the form.submit() to give the _gaq.push time to send all of them.

setTimeout(function(){ form.submit(); }, 200);

Install Chrome and the Google Analytics Debugger. Look in the console (control, shift, j) for the event tracking processing.

enter image description here

If you don't see all of your events tracking there, then something is up maybe with the form values.

like image 127
jk. Avatar answered Oct 10 '22 10:10

jk.