Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Our website ABC.com lists many events and each event listing has a registration button that links to an externally hosted form on XYZ.com. XYZ.com is controlled by a vendor. Each form (e.g. xyz.com/event01.html) does not have a separate thank you HTML, instead JavaScript is used to display a "Thank you" message within the same page.

What is the best approach to record a successful conversion from our website ABC.com through to xyz.com/event01.html?

I can not find any documentation on this.

share|improve this question
up vote 1 down vote accepted

Assuming that "controlled by a vendor" means you don't have access to the code on XYZ.com, then the best you can do is track the button clicks to XYZ.com as outbound links with events.

As indicated here, outbound links are not automatically tracked by Google Analytics, so you'd need to manually tag them using JavaScript, which will then allow you see them as one of the event categories:

Because links that lead away from your site are not automatically tracked by Google Analytics, you will need to manually tag all outbound links you want to track. To do this, you will add some custom JavaScript that uses the _trackEvent method to record these links and then modify the links you want to track.

With this structure in place, you could then see Outbound Links as one of the event categories and drill down to see which particular outbound links are the most popular.

The steps for tracking button clicks as outbound links covered in the example here (edited for your needs) are:

  1. Delay the outbound click by a fraction of a second (to provide the browser more time load the tracking code) by adding this JavaScript before your </head> tag:

    <script type="text/javascript">
    function trackOutboundLink(link, category, action) { 
    try { 
    _gaq.push(['_trackEvent', category , action]); 
    } catch(err){}
    setTimeout(function() {
    document.location.href = link;
    }, 100);
  2. Then you can log each button click by adding an onClick event to trigger the trackOutboundLink function above:

    <button onClick="trackOutboundLink('http://xyz.com/event01.html', 'Outbound Links', 
    'xyz.com'); return false;">Click me</button>

As specified there:

The example above uses the category label Outbound Links. This is a useful way to categorize all outbound links in the Event Tracking reports. It sets the specific name of the website as the second parameter in the call.

So change xyz.com above to whatever external site you want to attribute the button click to.

share|improve this answer
Yes "controlled by vendor" means that we do not have any control over the code. We already use event tracking to record the outbound link. Is there not any successful conversion code that we can use on an external site? – rlsaj Sep 29 '13 at 22:26
If you don't have access to the code on the external site, and the "Thank you" page doesn't return to your site either, then there's no way to use tracking code after the user leaves your site. – dan Sep 30 '13 at 0:21
If we were to have access to the code on the external site and we could change the "Thank you" page to return to our site, what are the options? – rlsaj Oct 2 '13 at 1:03
You'd add your tracking code to the "Thank you" page on your site and then be able to view successful registrations by each form by viewing the referral URLs. Alternatively, if you can specify a different URL to the "Thank you" page for each form, then you can use custom campaign parameters as generated here and view registrations by custom campaign. – dan Oct 2 '13 at 2:09
Thanks dan, makes perfect sense. – rlsaj Oct 2 '13 at 2:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.