Oli Gardner
posted this on October 21, 2010 04:33 pm
The following video and article will teach you everything you need to know to embed Google Analytics tracking into your Unbounce landing pages.
That's it!
Google Analytics will then begin tracking metrics for your landing pages.
Event Tracking
To enable event tracking in Unbounce, follow these steps in the comments section.
Customizing Your Reports
Since the data collected from this integration is handled within your Google Analytics account, check Google's site for information on building customized reports.
Comments
A little confused on this: You're recommending that it be placed "Before body end tag" but Google recommends placing within the <head> block and I notice that is an option in the drop down. Why would Google recommend one thing and you guys another?
Thanks,
Adam
Sorry Adam, that's an error. You should place it in the head as per Google and our first set of instructions at the top (for the Asynchronous method). We'll get this updated.
Cool thanks for the quick feedback
Just some feedback: If I'm using Google Analytics, chances are I'm using them on ALL variants, and perhaps ALL campaigns. It'd be so much nicer if I could add it on an account or campaign level, instead of having to do this for EACH page.
Thanks for the feedback Wes. That's been a fairly common comment, so we'll definitely be considering it for a future update.
Oli, do I need to change my analytics settings from "A single domain (default)" to "One domain with multiple subdomains" ? The top graphic shows a script that is set for the multiple subdomains. thanks!
Hi Michelle,
This page should help you out
Will adding Google analytics override the Unbounce conversion rate chart, or will they work in tandem?
Hi Jeff - they will both work in tandem.
Will GA be able to distinguish between variants? Will GA just be showing me the average results for all variants at a single URL or will I be able to distinguish between the performance of each variants through GA?
Hi Jared! Sorry we don't have a complete guide for customizing GA for use with Unbounce, that's definitely something we want to get around to. If you want to track individual variants, you can customize your GA code, specifically the 'trackPageview' method, to include the variant information in the opt_pageURL parameter. So, if you're using the async GA code, perhaps something like:
The specific format will depend on how you're using GA and how you'd like your reporting to work. Hope that helps!
Since the lead-gen landing pages have a pop-up "Thank You" message and do not redirect to a different page, how do you set up Goals in Google Analytics?
Hi Fred,
If you click on the form (not the button) you'll be able to choose where to go next (you can redirect to a different URL if you like) - just set it in the dropdown in the right-hand panel. This will let you set up a path of pages for your GA goals.
Hey Fred, I should add that the "Thank You" message is served up as a separate URL. Just right-click and "View Frame Information" to see the URL that is requested. You can either use that as your goal, or you can customize the GA script you embed on the form confirmation page...
How do I push to Google Analytics when someone clicks on a button in unbounce?
Hi Owen,
Here are a couple steps you can take to track button clicks using Google Analytics.
1. You will need the button id, from the editor click on the button and on the right panel near the bottom in advanced you will see the id. For example it should look something like #lp-pom-button-66
2. Now we need to add a small code snippet to the button, to do this click on the Javascript tab in the footer of the page builder and add a new script with the following code.
<script>
$( '#lp-pom-button-66' ).click( function() {
_gaq.push(['_trackEvent', 'Form', 'Submit', 'Email Submit Form']);
});
</script>
Make sure you replace what is inside the $() with your button id that you collected for step 1.
That should about do it.
If your not sure what the labels mean inside the push function a good article can be found at http://code.google.com/apis/analytics/docs/tracking/eventTrackerGuide.html
Let me know if that helped
Slan
Hey folks -
So according to Unbounce analytics, I have a few views so far. According to GA, however, I don't have any. Why is that?
Zeb
Hi Zeb,
It could be that Google did not publish the report yet, It may take up to 24 hours to update.
http://support.google.com/googleanalytics/bin/answer.py?hl=en&answer=55541
We should have a video posted soon which will demonstrate how to enable goal tracking with Google Analytics for your landing pages. In the mean time, all you should need to set it up is the URL of your thank-you page which by default is the form confirmation dialog.
Your page's form confirmation URL is based on the page's variant letter but is otherwise the same for any of your pages. For example, if you had two variants, A and C, the URLs for each page's form confirmation dialog would be:
Hi there,
I need to track across multiple domains. My shopping cart is on another domain.
For my links going to my cart, I need to use the following structure:
<a href="http://www.my-example-blogsite.com/intro"
onclick="_gaq.push(['_link', 'http://www.my-example-blogsite.com/intro.html']); return false;">
See my blog</a>
How can I do it with Unbounce?
Thanks
I fund a way, I just forgot to re-publish the page :) (newbie mistake)
http://www.seomoz.org/ugc/google-analytics-cross-domain-tracking-ma...
It functions and we are now able to track the across multiple domain.
You guys should crank out one of these how to's for adding the Google ReMarketing code for Adwords. Should be similar.
@Joel - glad to hear you were able to puzzle it out. Thank you for letting us know!
@Adriel - We're always looking for ways to improve our resources and appreciate your feedback. Thank you!
This really needs to be a lot easier - I thought the USP for Unbounce was that you didn't need to be technical to manage and create landing pages, but now to track it in GA I have to get our marketing team to remember to add the right tracking code to each new page, in the right place, and I can forget about getting them to customise the tag to track variants.
Slan - I set up google analytics for the domain URL and I I added the code snippet above for button click tracking to all the sub-pages where I have buttons (in this case I'm using unbounce to guide people through a sequence of about 10 A/B tests), but I can't figure out how to set up the tracking in google analytics. I'm staring at the goals page and the event tracking guide but this will take me forever to figure out. What is the next easy step?
Hi Suzan,
Are you asking on how to set up goals in Google Analytics? I find that this step-by-step to be a good reference. http://support.google.com/analytics/bin/answer.py?hl=en&answer=1032415. If I have misunderstood your question or this did not help please let me know.
Slan
Thx Slan, I read this page but what it doesn't help with is the specifics for goal tracking for button clicks. Up above in this thread you give instructions for how to add the code snippet on the unbounce side, what do I need to do on the GA side? I'm assuming I need to set up an event, but this is too generic to help me:
Event: Specify an Event as a Goal. In order to set this kind of goal, you must first set up Event Tracking. Under Goal Details, configure a combination of Event conditions (e.g., the Event Category, Action, Label, or Value). You must select at least one condition. Choose a Goal Value for the Event. The actual Event Value is the value you assigned to the Event when you set it up. The Constant Value can be entered manually in this field.
And this is too complex to help me: https://developers.google.com/analytics/devguides/collection/gajs/e...
And I don't think the URL tracking will work because I use the same URL as the landing page across multiple variants of the same page, but I want to see the clicks by variant, not the total clicks to the URL.
Thx
Hi Suzan,
I agree it is a bit confusing since there is so much on the GA side of things but once you get the hang of it I promise it's not so bad.
So basically what you need to do is tell GA what type of goal you want to set up. These can range from clicking on a link, to the amount of time that a user spends on your page and even specific events that happen such as submitting a form etc. So within your account on the left side menu you will find goals by following that you can create a goal and Google will give you a few basic questions to set that up.
It's hard for me to go into specifics since I am not sure what exactly it is you want to do. What I recommend before you start is to ask your self what information it is that is important for you and your business to help you convert. To me it sounds like what you need is to set up a funnel which is a part of goals that help you understand at what point your users are engaged and what part they drop off at. I highly recommend getting familiar with this. A very good and short read is this article
http://analytics.blogspot.ca/2009/05/how-to-setup-goals-in-google-analytics.html
It will help you understand the basics of setting up GA including funnels.
I hope that helps :)
Slan
Hey Guys -
Let's say I want to track my unbounce pages, as subdomains, in GA. And I also want the reports to be aggregated into a single view, so that the hosted pages are a subdomain that are tracked in the same GA view. Is this doable? Is it a matter of setting up the right profiles in GA?
Thanks,
Matt
Hi team,
You guys are doing great work. I like your product but I'm very impressed with how dedicated you are to making Unbounce easy and user friendly. Keep it up!
Quick question: if using a custom domain name, while setting up GA do I use the unbounce or my custom domain?
Thanks,
Michael
Hi Michael - thank you so much! If you're using your own domain, be sure to configure GA to use your custom domain so it fits with your existing reports. The only extra point is that if you're using a custom subdomain, you'll want to ensure you've selected the tracking for subdomains option in GA.
Matt - You sure can and yes, it's a matter of the configuration in GA. Truthfully, I'm not familiar enough with that aspect of GA though I did track down a post about tracking multiple subdomains in GA that should coach you through it.
I was pulling my hair out trying to get the GA goals working on the email form submission..... tried
/a-form_confirmation.html
no luck..... anyway, I eventually got their in the end after a few hours.
Make sure you add the GA code snippet to ALL pages, not just your main page. In this case, the success lightbox is a page, and thus needs the GA code added to HEAD, just like the front page.
Hopefully this saves someone else some angst.
Cheers
ps. Ryan - I love the site - thanks.
Hey Wesley - glad to hear it and thanks for the heads up. I'll update the video asap.
Hello, thank you for the info. But I want to put a code, like a google event, when the customer click on the CTA button. How ?
Hi Alban - You can tie a google event to your CTA using a little bit of javascript but don't worry, there's no programming required. Just check out this comment above from Slan on our product team. He explains exactly how to set it up.
Thank you Ryan but there is no "script button" on my editor. I looked at the video and I can see them in the demo, on top, next to the delete button, but not on mine. Strange...
Hey Alban - we released an update to our page builder just a couple weeks ago and you managed to catch outdated info in that comment. The Google Analytics integration steps are still the same but rather than clicking the Scripts button in the toolbar, you'll click the Javascript tab in the footer of the editor: http://support.unbounce.com/entries/513757-Can-I-use-custom-JavaScr...
...thanks for pointing out the issue. We'll hop in a fix it up ASAP.
Do I put the event script Slan put in the comments into the Header, Before Body End Tag, or After Body Tag in the Javascripts section?
Hi Kevin,
You'll want to put the code into the head tag. Google does a great job making sure that it does not slow your page down by doing all its magic as your page is loading.
I hope that helps,
Slan
Has the script that should be inputed changed since 2012? I have placed the code into the Header and changed the button code and set up the Google Event using the same fields (Form, Submit, Email Submit Form) but the events are not being tracked.