Google analytics goal complete when lead capture?


is there a way to set up a goal in google analytics and trigger it when a form is filled out on an unbounce landing page?


37 replies

Hi Ryan and Finge,

I just tried setting up an event on my form submit button and it didn’t seem to work. I’ve found that a better way to track the event is to change the Universal Analytics tag on the form confirmation dialogue page to fire as an event, instead of a pageview.

To do that, you change the line “ga(‘send’, ‘pageview’);” to " ga(‘send’, ‘event’, ‘Category’, ‘Action’, ‘Label’);".

From there, you can make a goal based off that event if you like. (Admin -> Goals -> Event).

I hope that helps!

Hmm. So far as I know, you shouldn’t have to define it. Once you add the tracking it should populate in GA automatically thanks to the “send” parameter. I’d recommend posting in the Google Analytic’s support forum as well. I poked through the even tracking posts but couldn’t see anything that quite describes your situation Finge. Nonetheless, you can find a list of event tracking related issues here and you might notice something I didn’t.

If you do puzzle it out though, I’d love to hear what the solution was.

Userlevel 6
Badge +4

Ok - so the next question. How do I define this target in GA? I have created a custom goal using event as the goal. Category, label and value are left blank, but in action/event I added ‘click’. However it’s not recording my events?

…that, unfortunately, I can’t say for sure. In my own experience using KISSmetrics the answer is unfortunately yes and up till now, I haven’t found a proper solution. I’ve poked around to see if Universal Analytics supports URL goal tracking but haven’t seen anything yet. If they do, that would help avoid those mis-attributed clicks.

Userlevel 6
Badge +4

Thanks, Ryan! And what if the customer clicks with some required fields not filled out. Will the click be counted as a conversion/goal?

Hi Finge,

Your best bet is to track the form submit action as an event. To make this work with Unbounce and Google’s Universal Analtyics, you’ll use their jquery method to tie the action to your button.

So, if, for example, your form’s button ID were #lp-pom-button-16, then you’d replace #button in their example with #lp-pom-button-16, like this:

ga('send', 'event', 'button', 'click', 'nav-buttons');   
}); ```   
 
That should do the trick.
Userlevel 6
Badge +4

How can I have goals tracked in Google Analytics now with the new Universal Analytics?

I assume I add the script to the landing page, but what do I add on the confirmation page?

And - is it possible to set up as an event instead?

It shouldn’t as far as I know. If you try it and notice anything different with the results though, let us know!

This is a helpful thread and just tried this.

My Unbounce landing pages are set up on a subdomain (expample: http://info.site.com/)

Will this throw things off because GA asks for a relative URL for the destination url but I had to use the full URL since it is on a subdomain - http://info.site.com/formsubmit

I’d also like to know/wonder whether since the introduction of GA Events that can be tracked as goals (can’t remember exactly when this came into force but I think in the last 3 months) that anyone has implemented track Event in their form confirmation pages?

Also, as per Jon above I’d also like to know whether GA integration is on the horizon anytime soon? I have many ads that I’d like to implement something similar to what’s been described above but don’t want to proceed to find out that integration is nearly here.

I’d also like to know/wonder whether since the introduction of GA Events that can be tracked as goals (can’t remember exactly when this came into force but I think in the last 3 months) that anyone has implemented track Event in their form confirmation pages?

Also, as per Jon above I’d also like to know whether GA integration is on the horizon anytime soon? I have many ads that I’d like to implement something similar to what’s been described above but don’t want to proceed to find out that integration is nearly here.

Any update on full Google Analytics integration? it would make life so much easier

Nope, the tracking of the form confirmation page view would only happen upon a successful form submission (i.e. all validation passing).

Would this technique register a pageview even if the form failed validation? As in, if someone tries to submit the form without filling out any of the fields, will it still track a pageview?

possible, but that won’t let you segment the funnel and understand which audience converts best.

Hmm, you are now at the edge of my GA knowledge - but how about keeping it simple and just having two goals, one for each of your two paths?

hi cooper
isn’t it possible to use segments to make an ad hoc funnel? e.g. if you have an event like /video/play and you know people end up at the page /product, can’t you make 2 segments? one with /video/play + /product and another one with /video/play and then compare the two? of course it would be better if google just supported events in the funnels. another problem is that the funnel view doesn’t support segmentation …

Virtual Pageview is what you want - the reason is that Google Analytics does not (currently) allow you to use Events to indicate Goal completions. It seems likely that they will allow this someday, as supporting only virtual pageviews causes distortions in statistics like Pages/Visit, but for now you must use Virtual Pageviews to trigger Goal completions.

one thing i’m still unclear about is whether it should trigger as a virtual pageview or as an event in GA …

Yes it certainly is! Great to get an idea of how extensively everyone wants to use GA first so we can build the integration accordingly.

Yep, you were right, I just didn’t wait long enough - all is well now, I’m seeing conversions in GA, and I’m happy! Well, mostly happy - it’d be nice if UnBounce made this all easier to set-up - which I think is on your To Do list : )

Great to hear guys, happy to hear it’s working out!

I had this question too and followed Carter’s tips and GA is successfully tracking the goal. Thanks!

did you wait 24h? it might take a while for GA to capture the data.
did you set up your goal as described above? you might want to use a regex match instead of head match, like .*formsubmit.*

Hi All,
Good timing on this discussion - I needed to do this just today!

I’ve set it all up as directed, and I’m seeing both my landing page and my /formsubmit page show up in my Google Analytics tracking, but for some reason the /formsubmit is not triggering a Goal Conversion in GA. Would you say that is a question for Google, not for UnBounce?

Reply