We’ve all seen websites with hotel reservations, affiliate marketing, and webinar signups where in order to make a purchase or become a lead, a visitor needs to go to a third-party page. Well, I have worked with a few like that and in every case tracking is the first thing that needs to be addressed. After all, if we do not know how many people completed the CTA, how could we claim that the campaign is a success?
This kind of tracking has an undeserved reputation of being difficult to implement. But in reality, all you need is Google Analytics code on your site and a little bit (honestly!) of coding.
But before you get started, do yourself a favor and check the following:
1. Make sure you are using the newer version of GA on your site. The on-page script I am using will not work with old Urchin code.
2. If your site is in PHP, GA’s new code may have a syntax conflict. This does not mean you can’t use the new code. It just means that you need to modify it to be
<script src=”http://www.google-analytics.com/ga.js“type=”text/javascript“>
</script>
<script type=”text/javascript“>
var pageTracker = _gat._getTracker(“UA-XXXXXXX-X”);
pageTracker._trackPageview();
</script>
3. Make sure you have access to your website and can make code changes (DUH!).
Now, you are ready to get started.
Step 1. Set up the goal.
Let’s say, the goal is to track when a user clicks on your RSS subscribe button. Note: when they click on the button, there’s no guarantee that they’ll actually subscribe. Let’s also assume that at www.example.com we have just one type of subscription and it is a big RSS button in the upper right.
1. GA Settings Page is your first stop. Click “Edit” for www.example.com.
![]()
- From the Conversion Goals and Funnel table, click “Edit” next to one of the not configured Goals.
- Now, set the URL of the goal to be a non-existent page. For example: http://www.example.com/goal/example.
- Name your goal something like “RSS subscription”.
- Use head match as your match type.
- Done
Step 2. Tracking the clicks on the RSS button.
This is the part where you will be coding (just a little bit) and adding a javascript to track the onclick event on the RSS button. To track the button clicks, we need GA to register a “visit” to the fake page we created (http://www.example.com/goal/example).
Now, we need to add the on-click tracking code to the RSS button. This is the code to use:
<a href=”/goal/example” onclick=”javascript:pageTracker._trackPageview (‘example’);”target=”blank”>
Step 3. Looking at your data.
Note: it may take time for the data to show so do not get discouraged if you are not seeing it within the first 72 hours.
You should see your RSS button clicks as a goal you set up:

Enjoy!







This is great info.
Many marketers are not aware that button clicks can be tracked so this will help many of them.
Will this method work on a Submit button?
It should work on any clickable button.
Thanks for the great info! i never thought it would be as simple as this ^^,
This may be a stupid question – but can the on-click tracking code …be put directly in the html?
I work as a web editor in a cms, so I don´t do the coding, I only have access to the html on the content (text/pictures) that I myself put up.
I want to track clicks on a button that leads out of the site.
Is there any way to track button submissions without using Google Analytics?