close panorama

Google Analytics Plugin analytics.swf, analytics.js for Flash and HTML5
by Jaydee - info@jaydee.ru

  • Integrates Google Analytics functionality in your virtual tour.
  • Allows to track pano visits and events.
  • Both scenes and external files with panoramas are supported.
  • Can work either in automatic or manual mode.
  • Easy events tracking.
  • One codebase works the same on desktops and devices.
  • HTML5 version of the plugin is free.

Plugin documentation topics:

Description

The purpose of this plugin is to integrate Google Analytics functionality into your virtual tour. It allows you to track pano visits as well as any custom event (krpano event, user interaction etc). Plugin can work either in automatic or manual mode. In automatic mode, plugin tracks pano visits and linked events as user views different panoramas. In manual mode, you can track pano visits and events only when it's needed, no automatic tracking requests will be sent. Improve your virtual tour and user experience by using this handy plugin!

Demo & Downloads

Online demo (Automatic Flash or HTML5)
Google Analytics v1.2 (demo version of the plugin & source code for online demo)
Important note! The HTML5 version of the plugin (analytics.js) is free and included in the demo version.

Buy / Order

  • The Google Analytics Plugin is an additional Commercial Plugin.
  • To use it a full version must be bought.
  • Without buying a full version you will be able to use plugin only in debug mode.
  • Updates - All updates for the Google Analytics Plugin are free.
    Please, follow the instruction on this page to get an update. You need to know the email address, which you used to buy the plugin. You will receive a zip with updated version in a couple of minutes. If you forget or don't own that address anymore, please write me a short email.
Buy now!

The order transaction and the full version delivering will be done by the Share‑It E‑Commerce provider.

Note - the "Extended Download" / "Erweiterter Download" option for 6.99 USD/EUR in the Share-It order form is not needed but enabled by default! It can be removed by clicking the "Trash"-button!

* VAT: Depending on your location or company status VAT may be added to the price. In the Share‑It order form select your country and enter your VAT/UID number to remove the VAT. The correct price will be shown on the next page in the order form.

Integration

Using the source code of the demo as the template is highly recommended.

  • Sign up for Google Analytics account for your domain at this page.
  • Then, include analytics.xml file from the demo package into your root XML file by using the include tag.
    <include url="analytics.xml"/>
  • After that, you should copy required plugin files (analytics.swf, analytics.js) and change analytics.xml according to your tour requirements and architecture.

Syntax / XML Usage Example

<plugin name="ga" 
        url="plugins/analytics.swf"
	alturl="plugins/analytics.js"
	keep="true"
	preload="true"
	mode="auto"
	account="UA-XXXXXXXX-1"
	debug="false"
	prefix="/virtualtour"
	parsepaths="true"
>
   <pano name="pano1"
	 xmlurl="pano1.xml"
	 scene="scene1"
	 pageurl="/pano1/"
   />
   <event name="event1"
	  xmlurl="pano1.xml"
	  scene="scene1"
	  global="false"
	  target=""
	  data=""
   />
   ...
</plugin>

Plugin Attributes

  • mode
    • A string, containing mode of the plugin. Possible values:
      • auto
      • manual (default)
    • Can't be changed at runtime.
  • debug
    • A boolean value, specifying whether plugin will work in debug mode.
    • Set this parameter to true, if you want to see the tracking requests log and other useful information for debugging. Note that in HTML5 version you should open krpano log panel to view the debugging info, while in flash version the debug HUD will appear on the top of krpano viewer.
    • Default: false.
  • account
    • A string value, specifying your Google Analytics account code.
    • Must be defined.
  • prefix
    • A string to be added at the beginning of all pageurl attributes of pano subnodes.
    • Use this to easily distinguish between the panoramas and other pages on your website in the Google Analytics admin panel.
  • parsepaths
    • A boolean value, specifying whether to parse placeholders (e.g. %SWFPATH%) in the xmlurl attribute of pano and event subnodes.
    • Default: true.
  • version
    • A string, containing current version of the plugin.
    • Read only.

Plugin Subnodes - <pano>

  • With the <pano> subnode it is possible to define what page tracking request should be sent to Google Analytics tracker when user views specific panorama.
  • Add one subnode for each scene or XML file with panorama.
  • Should be used with automatic mode only.

The <pano> node with the example of attributes values:
<pano name="pano1"
      xmlurl="pano1.xml"
      scene="pano1"
      pageurl="/pano1/"
      />

<pano> Attributes

  • name
    • The name of the pano.
  • xmlurl
    • A URL of XML file, which should be linked to specific page visit request.
    • May contain any of path placeholders (e.g. %SWFPATH%).
  • scene
    • A scene name, which should be linked to specific page visit request.
  • pageurl
    • A page URL, which should be sent to Google Analytics tracker when user opens linked panorama.

Plugin Subnodes - <event>

  • With the <event> subnode it is possible to link specific event tracking requests to any krpano attribute or event.
  • Each event subnode can be global linked or panorama-specific. For example, a Fullscreen button, which is usually always presented on the screen, is the example of a global linked event. And a hotspot on a specific panorama is the example of panorama-specific event.
  • Add one subnode for each event trigger.
  • Should be used with automatic mode only.

The <event> node with the example of attributes values:
<event name="pano1"
       xmlurl="pano1.xml"
       scene="pano1"
       global="false"
       target=""
       data=""
      />

<event> Attributes

  • name
    • The name of the event.
  • xmlurl
    • A URL of XML file, which has the event trigger, specified in target attribute.
    • May contain any path placeholders (e.g. %SWFPATH%).
  • scene
    • A scene name, which has the event trigger, specified in target attribute.
  • global
    • A boolean value, specifying whether this event is global or panorama-specific.
    • Default: false.
  • target
    • A string value, specifying a trigger for this event.
    • Event tracking code will be automatically added at the end of this trigger.
    • Must be defined.
  • data
    • A string value, specifying parameters, which will be passed to trackevent method when this event will be fired.
    • May contain up to four parameters, separated by comma.
    • Must be defined.

Plugin Actions

All actions:

Actions documenation:

  • trackpageview(url, addPrefix)
    • Sends page view tracking request to Google Analytics tracker.
    • Use this method to track panorama visit.
    • url - a url of panorama, to be sent as page url to Google Analytics tracker.
    • addPrefix - an optional boolean flag, specifying whether the prefix attribute value should be added to the url. True by default.
    • Example:
      plugin[ga].trackpageview(/pano1/);
  • trackevent(category, action, label, value)
    • Sends event tracking request to Google Analytics tracker.
    • Use this method to track user behaviour, which is not related to a particular pano visit, such as interaction with user interface or any other.
    • category - a string value, specifying general event category.
    • action - a string value, specifying action for the event.
    • label - an optional string value, specifying descriptor for the event.
    • value - an optional numeric value, associated with the event.
      Examples:
      plugin[ga].trackevent(Video Player, Play);
      plugin[ga].trackevent(UI, Button click, Fullscreen button);

Examples

Example xml code:
<krpano version="1.0.8">
	<plugin name="ga"
		url="plugins/analytics.swf"
		url="plugins/analytics.js"
		preload="true"
		
		mode="auto"
		account="UA-XXXXXXXX-1"
		>
		<pano name="pano1"
		      scene="p1"
		      pageurl="/pano1/"
		      />
		<pano name="pano2"
		      scene="p2"
		      pageurl="/pano2/"
		      />
		<event name="event1"
		       global="true"
		       target="plugin[fullscreen_button].onclick"
		       data="UI,Button click,Fullscreen button"
		       />
	</plugin>
	
	<plugin name="fullscreen_button">
		onclick="switch(fullscreen);"
		...
		/>
	
	<scene name="p1">
		...
	</scene>
	
	<scene name="p2">
		...
	</scene>
</krpano>

FAQ

  • Q: Where can I ask questions about the plugin and its usage?
    A: Please, post your questions and feature requests in the related forum discussion thread.
  • Q: How do I get update for the plugin?
    A: See the Updates section for instructions.
  • Q: How do I get notified about future updates?
    A: Please, check forum discussion thread to get notified about updates. Email newsletter subscription will be available soon.
  • Q: How do I know the version of my plugin?
    A: Try to open swf file in a browser, open krpano viewer's log panel or trace version attribute of the plugin and find the version code. If you still can't see version code, you probably have an old version of the plugin. Please, check the Updates section to get the updated version.

Troubleshooting

Here are some tips which should help you to avoid errors.
  • Make sure you have integrated plugin correctly.
  • If you are testing your tour locally, make sure to configure Flash Player security settings using this guide.
  • If you cannot hide debugging HUD by setting debug parameter to false - you probably using the demo version. Make sure to upload the purchased version on your webserver.

Changelog

v1.2
* [Added] HTML5 version of the plugin
* [Added] event subnode for easy events tracking
* [Improved] GA account now can be changed at runtime
* [Improved] Minor improvements and bugfixes
* [Removed] ontrackerready attribute
* [Removed] isready attribute

v1.1
* [Improved] auto|xml and auto|scenes modes are removed.
New auto mode supports using both scenes and external XML files
simultaneously
* [Added] version attribute
* [Improved] Some minor improvements

v1.0
* initial plugin release