Analytics for third-party JavaScript widgets

I'm trying to find the best approach for analysis on third-party JavaScript widgets - that is, tools and content that apply to any number of arbitrary users, which include widgets in the form of HTML snippets with tags.

In the same area

Please note that widgets are not loaded into the iframe element, which has a document downloaded from an external site. Instead, they load content into the DOM of the main page - that is, they are treated like the same domain as the host.

Analytics for a fragment of the main page

So, in essence, I want to track statistics (for example, widgets, user clicks and user interactions inside a widget), but I want to track statistics only for a fragment of the main page, which is widgets. I donโ€™t want to track clicks on the main page that is outside the widget.

I want the statistics to be compared together, so that the statistics for the widget on site A will be aggregated with the widget data on site B and site C, etc.

Questions

  • Can I use Google Analaytics in the usual way that meets these requirements? Or is it impossible to separate GA from the rest of the data collected on the main page?
  • If you can use Google Analytics, will there be a problem if GA is already used on the main page (with a different GA profile identifier) โ€‹โ€‹or can they be safely saved from each other?
  • Are there any other analytics packages suitable for tracking widget statistics to meet these requirements?
  • Or, how else do you approach the problem of obtaining statistics for these widgets?
+6
javascript widget analytics google-analytics
source share
1 answer

GA can be used for this, although since it is a free tool, it is slightly limited compared to other tools. Other tools include Yahoo Web Analytics (YWA), Omniture SiteCatalyst, and Webtrends.

Most tracking tools out there have the ability to do custom communication and event tracking. Basically, what you need to do is find the right code snippet for custom link tracking and put it in a wrapper function that will be executed in the onclick event (or add an event listener, etc.).

The first thing you want to do is decide which "events" you want to have for the widget (s). You mentioned counting widgets. This is quite simple to do: just place a piece of custom code on the page on which the widget is embedded.

But besides this ... presses any combination of buttons as one event? Does each button mean a different event? etc. Also, are there any custom values โ€‹โ€‹that you want to associate with buttons, for example, a product identifier or description, or something else.

Another important thing to ask yourself when you decide what you want to track is "How effective is this data?" You canโ€™t keep track of very little, but there are many things that are not very useful for making real business decisions.

For example, it looks like you want to try to measure user interaction with widgets. Iโ€™m sure the idea is to find out how useful, attractive, etc ... they are for people, so you can figure out whether to develop them or throw money at them or throw them. Fair. But just remember to make events focused. Knowing how many times a user clicked a button is not very useful, because by itself it is not very effective. Knowing how many times people have completed a process or step, etc., is more effective.

Once you have made a list of what you want to track and when, then you can start creating your own code.

With GA, there are 2 main ways to track events and indicators: through steps / goals and through user variables. The way you set up steps / goals with GA is to map GA to the URL of the page. For example, if you have a newsletter subscription registration form, there may be signup.html on the form page, and signup_confirmation.html on the confirmation page. Then you set the target in the GA interface. The target will match signup_confirmation.html, and you could try to find signup.html. You can then see how many people viewed your form and completed it, or abandoned it.

You can use the same tracking method with events by clicking on the virtual page view on GA.

Here is an article that details how to click on the view virtual page:

http://www.google.com/support/analytics/bin/answer.py?hl=en&answer=55521

But basically, whenever an event occurs (e.g. widget view, button click, etc., you should execute the following javascript:

pageTracker._trackPageview (virtual URL here);

The main thing to note about this method is that you can organize / categorize / provide a hierarchy to your data by passing delimited values. This will help you collect data for different widgets / sites.

The second way to record events is with user variables. Using custom variables during events provides many opportunities for reporting and flexibility. Here is a link to use them:

http://code.google.com/apis/analytics/docs/tracking/gaTrackingCustomVariables.html

+8
source share

All Articles