I'm going to walk you through how to set up a Google Analytics goal for any link on your site. There are a ton of potential uses for this, including using this method to track when visitors:
  • Sign up for your newsletter
  • Subscribe to your Aweber email list
  • Subscribe to your site's RSS feed
  • Leave a comment on your site
  • Click an 'order' link for any of your products
  • etc.
I'm going to use this blog as a live example for this post by outlining how I track when any of my visitors subscribe to my RSS feed. In case I have changed the design of this blog by the time you read this, here's a screenshot of what my RSS subscription box looks like on the right sidebar of my blog: As you can see, there are two ways for you to subscribe to my RSS feed -- by either subscribing in an RSS reader or entering your email address to get posts straight to your inbox. I'm going to show how to a) create an RSS subscription goal in Google Analytics, and b) assign that goal to both sign up methods. You can then take this and apply it to track any click/action on your site. Let's get started. 1. Log in to Google Analytics, select Goals from the left-hand menu and then click Set up goals and funnels. set-up-goals2 2. Under the Conversion Goals and Funnel section, click Edit next to Goal 1. edit-goal2 Here's how you fill out the form: enter-goal-info Active Goal: On Match Type: Head Match Goal URL: This URL does not have to actually exist, we are only going to use it for tracking purposes. You can name it anything you want, although I suggest using a name that resembles the goal to make your reports easier to read. I used /goal/rss.html. Make sure it doesn't point to an actual page on your site, because that could mess up your data. Whatever you call it, write it down as you'll need it in the next step. Goal name: Describe your goal as simply as possible. Case sensitive: Unchecked, don't worry about this. Goal value: This is the monetary value of your goal. If you're tracking email list sign ups and know that each person on your list is worth $10 to you, then you would enter 10.0. For our purposes, we are tracking an RSS subscription that doesn't have a concrete dollar value. In this case, I recommend setting this at 1.0. This allows you to take a quick glance at future reports and know that each conversion equals a single instance of your goal being accomplished. 3. Scroll to the bottom and click Save Changes. 4. Now you have to get your hands dirty and make a quick edit to your site's HTML. Open the HTML file containing code for the link(s) you want to track. For example, here is the HTML for my RSS subscription via feed reader link:
<a rel="alternate" type="application/rss+xml" href="http://feeds.feedburner.com/InternetMegaphone">Subscribe in a RSS reader</a>
To tell Google Analytics to trigger my goal any time this link is clicked, I add this piece of code:
onclick="javascript: pageTracker._trackPageview('/goal/rss.html');"
The final product looks like this:
<a onclick="javascript: pageTracker._trackPageview('/goal/rss.html');" rel="alternate" type="application/rss+xml" href="http://feeds.feedburner.com/InternetMegaphone">Subscribe in a RSS reader</a>
You can also add the code to any button on your site. Here's what it looks like when I add the same goal code to the Subscribe button to track RSS email subscriptions:
<input onclick="javascript: pageTracker._trackPageview('/goal/rss.html');" type="submit" value="Subscribe" />
Simply replace /goal/rss.html with the code for your goal. You can repeat this process as many times as you'd like (without exceeding Google Analytics' maximum of 4 goals per profile). If you have any questions, please post them in the comments and I'll get back to you!

Share with others...

Comments (6)

Track comments via RSS 2.0 feed. Feel free to post the comment, or trackback from your web site.

  • Richard on Sep 14, 2009

    hi…i’m working on my new site to track my contact us form submission with google analytics.this is the url of my site
    (http://www.lucknowchicken.com/home.html)

    I want when use click on submit button , google analytics works and send the tracker info about the user who submit the form.

    could you plz tell me how to use google analytics for my form submission.

    1.
    ——————————————-
    i’m using this code on my send message button

    ——————————————-

    2.
    ——————————————-
    and this bit of code before the in the end of the page which google analytics genrate .

    var gaJsHost = ((“https:” == document.location.protocol) ? “https://ssl.” : “http://www.”);
    document.write(unescape(“%3Cscript src=’” + gaJsHost + “google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E”));

    try {
    var pageTracker = _gat._getTracker(“UA-10646217-1″);
    pageTracker._trackPageview();
    } catch(err) {}

    ——————————————-

  • Richard on Sep 14, 2009

    hi…i’m working on my new site to track my contact us form submission with google analytics.this is the url of my site
    (http://www.lucknowchicken.com/home.html)

    I want when use click on submit button , google analytics works and send the tracker info about the user who submit the form.

    could you plz tell me how to use google analytics for my form submission.

    1.
    ———————————————————————————————–
    i’m using this code on my send message button

    ———————————————————————————————–

    2.
    ———————————————————————————————–
    and this bit of code before the in the end of the page which google analytics genrate .

    var gaJsHost = ((“https:” == document.location.protocol) ? “https://ssl.” : “http://www.”);
    document.write(unescape(“%3Cscript src=’” + gaJsHost + “google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E”));

    try {
    var pageTracker = _gat._getTracker(“UA-10646217-1″);
    pageTracker._trackPageview();
    } catch(err) {}

    ———————————————————————————————–

  • John Jorgensen on Sep 14, 2009

    Richard,

    Some of your code got lost, but see if my post here can help you: http://www.internetmegaphone.com/how-to-track-form-submissions-with-google-analytics-goals/

  • Richard on Sep 15, 2009

    Hi ,thanks for replying me .I watched your tutorial but the problem with my contact page is that i don’t have any thank you page (thank_you.html or any sucessfully completion message page)

    my contact form is ajax form which shows the thank you message in the same page when user hit the send message button, i don’t have any sucessfully completion message page.

    I have single html page (contact.html) with few .php .js and .css pages.

    ——————————————-
    This piece of code i’m using on the send message button in contact.html page……..

    ——————————————-

    and this piece of code on the buttom of my contact.html page before the

    var gaJsHost = ((“https:” == document.location.protocol) ? “https://ssl.” : “http://www.”);
    document.write(unescape(“%3Cscript src=’” + gaJsHost + “google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E”));

    try {
    var pageTracker = _gat._getTracker(“UA-10668231-1″);
    pageTracker._trackPageview();
    } catch(err) {}

    ——————————————-

    this is my web site link…….

    http://www.lucknowchicken.com/contact.html

    if you can help me to fix my form working with google analytics then please help me so that i can make my form online on my web site.

  • Richard on Sep 15, 2009

    ——————————————-
    This piece of code i’m using on the send message button in contact.html page……..

    <!– code on send message button start here

    code on send message button ends here –>

    ——————————————-

  • Richard on Sep 15, 2009

    again same problem ..not displaying the orignal source code here…plz open my web site link

    http://www.lucknowchicken.com/contact.html

    and view source and serch for onClick .

    Thank you.

Leave a Comment

Share This Post

Subscribe Subscribe to RSSStay up to date with my blog

Twitter Follow me!Follow me or get followed

Facebook FacebookCheck my Facebook profile

linkedIn linkedInAdd me on linkedIn

Hi, I'm John Jorgensen

Hello! I'm an internet marketing consultant / geek living in Manhattan Beach, California. I also grill a mean steak. Have an online marketing question? Contact me.