Special-Case Goals and Funnels


This article covers how to how to handle goal pages and funnel steps on third-party sites and on Flash pages.


Goals for Downloads

Because a link to a downloadable file is not actually a web page, your URL goal will not work correctly if you merely supply it with a download link. To track a download as a goal, you will first need to configure the download link in one of two ways:

If you configure the link as a virtual pageview, the overall pageview count for your website will be inflated by the number of clicks on that link, so for this reason we recommend using Event Tracking to configure download links. This section illustrates both methods.
  • Virtual URL Goal

    To track the download link as a pageview count, assign a virtual URL to the download link on the web page. For example, the link to your download might look like:<a href="http://www.example.com/downloads/specSheet.pdf" onclick="_gaq.push(['_trackPageview', '/downloads/specSheet.pdf');">


    Once you create the virtual URL, you can supply that same URL as the value for the goal URL. For details on how to use virtual pageviews in your tracking code, see Virtual Pageviews in the Asynchronous Migration Examples guide, which shows examples for all versions of the tracking code.


  • Event Goal

    To track the download link as an event, add an onClick event to the link that uses _trackEvent(). For example, the link to your download might look like:

    <a href="http://www.example.com/downloads/specSheet.pdf"onclick="_gaq.push(['_trackEvent', 'category', 'action', 'opt_label', opt_value]);">


    Once you modify the link, you can create an Event Goal in your profile with a category condition set to the one defined for the link. For details on how to use this in your tracking code, see Event Tracking in the Asynchronous Migration Examples guide, which shows how to do this in all versions of the tracking code. For background information on Event Tracking itself, see Event Tracking in this Help Center.

Goals and Funnel Steps on Third-Party Sites

You can track a goal or funnel-step page only if it contains the Google Analytics tracking code. However, in addition to tracking goals and funnels on your own site, you may want to track them on third-party sites. For example, you might want to track visitor activity on a 3rd-party shopping cart site and set goals on those pages.

If you refer visitors to a third-party page on which you cannot alter the code, then you can track the outbound link as a goal or funnel step. For more infomation, see Tracking Outbound Links.

If you refer visitors to a third-party page on which you can change the code, then you can track the visits to that page. For more information, see the Ecommerce section.


Goals and Funnels for Flash Pages

As with download links, you can set up goals for Flash pages in one of two ways:
  • Using a virtual pageview
    With the virtual pageview, you will use the _trackPageview() function to assign a path/page name to the link. This method is useful if you want to create virtual directory structures for your Flash site and to get actual pageview tallies for each click on a link. In addition, you can also set up Funnel steps for your goal if you use the virtual pageview method. For details, see Virtual Pageviews in the Asynchronous Migration Examples guide, which shows how to use _trackPageview() in all versions of the tracking code.
  • Using Event Tracking
    With Event Tracking, you use the _trackEvent() function to set up categories, actions, and labels for the Flash content you want to track. After you set up event tracking for your Flash page, you will then configure an Event Goal in your profile with a category condition set to the one that you created for the Flash links. For in-depth information about tracking Flash events, seehttp://code.google.com/apis/analytics/docs/tracking/flashTrackingIntro.html.


While _trackPageview()is appropriate for identifying Flash events as goals or funnel steps, it is not appropriate for tracking Flash events (like playing a video) outside that context. When you implement _trackPageview(), you run the risk of artificially inflating your pageviews.

If you want to track Flash events simply as events, use the _trackEvent() function.
Comments