close panorama

Google Analytics Plugin analytics.swf, analytics.js Version 1.3 (Beta 2)
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.
  • Easy events tracking.
  • Easy intergration with SWFAddress Plugin.
  • One codebase works the same on desktops and devices.
  • HTML5 version of the plugin is free.

Plugin documentation topics:

Description

This plugin helps you to integrate Google Analytics tracking functionality into your virtual tour. It allows you to track pano visits as well as any custom event (krpano event, user interaction etc). Google Analytics supports Real Time tracking, which makes it easier to debug and see what you visitors are doing. Improve your virtual tour and user experience by using this handy plugin!

Demo & Downloads

Online demo (Automatic Flash or HTML5)
Important note! The HTML5 version of Google Analytics plugin (analytics.js) is free and included in the download package.

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 on your local computer.
  • Updates - All updates for the Google Analytics Plugin are free.
    Please, follow the instruction at this page to get an update.
Warning! Advanced krpano XML knowledge required in order for plugin to work correctly with your virtual tour. Please, download examples, examine their code and make sure that you'll be able to integrate plugin properly by our own before buying a plugin.
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 online demo as the template for your virtual tour 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"
	account="UA-XXXXXXXX-1"
	debug="false"
	prefix="/virtualtour"
>
   <pano name="pano1"
	 xmlurl="pano1.xml"
	 scene="scene1"
	 pageurl="/pano1/"
   />
   <event name="event1"
	  xmlurl="pano1.xml"
	  scene="scene1"
	  target=""
	  data=""
   />
   ...
</plugin>

Plugin Attributes

  • 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 in krpano log panel.
    • Default: false.
  • account
    • A string value, specifying your Google Analytics account.
    • 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 virtual tours and other pages on your website in the Google Analytics administration panel.
  • 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 navigates to specific panorama.
  • Add one subnode for each scene or XML file with panorama.
  • It is possible to add and remove pano subnodes at runtime using the addpano and removepano actions.

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

<pano> Attributes

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

Plugin Subnodes - <event>

  • With the <event> subnode it is possible to associate event tracking request with any krpano attribute.
  • Each event subnode can be global linked or panorama-specific. For example, a Fullscreen button, which is usually always present on the screen, is the example of a global linked event. And a hotspot within specific pano is the example of panorama-specific event.
  • Add one subnode for each event trigger.
  • It is possible to add and remove event subnodes at runtime using the addevent and removeevent actions.

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

<event> Attributes

  • name
    • The name of the event.
    • Should start with letter.
  • 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 attribute.
    • Must be defined.
  • data
    • A string value, specifying parameters, which would be passed to trackevent method when this event will be fired.
    • May contain up to five parameters, separated by comma.
    • Must be defined.

Plugin Actions

Actions documenation:

  • addpano(name, xmlURLOrScene, isScene, pageURL)
    • Adds pano subnode at runtime
    • name - a name of pano subnode
    • xmlURLOrScene - a scene name or URL of XML file with panorama
    • isScene - a boolean flag, which indicates whether the value of second paramter is scene name or URL of xml file
    • pageURL - a page URL for associated panorama
    • Example:
      plugin[ga].addpano(pano0, scene0, true, /pano1/);
  • removepano(name)
    • Removes pano subnode at runtime
    • name - a name of pano subnode
    • Example:
      plugin[ga].removepano(pano0);
  • removeallpanos()
    • Removes all pano subnodes
    • Example:
      plugin[ga].removeallpanos();
  • addevent(name, xmlURLOrScene, isScene, target, data, global)
    • Adds event subnode at runtime
    • name - a name of event subnode
    • xmlURLOrScene - a scene name or URL of XML file with panorama
    • isScene - a boolean flag, which indicates whether the value of second paramter is scene name or URL of xml file
    • target - a target object and attribute
    • data - an event data, separated by comma, to be sent as parameters to trackevent action
    • global - an optional boolean flag, indicating whether the target object is global-linked or panorama-specific
    • Example:
      plugin[ga].addevent(event0, scene0, true, plugin[fs_button].onclick, 'UI,FullScreen');
  • removeevent(name)
    • Removes event subnode at runtime
    • name - a name of event subnode
    • Example:
      plugin[ga].removeevent(event0);
  • removeallevents()
    • Removes all event subnodes
    • Example:
      plugin[ga].removeallevents();
  • 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 prepended to the url. True by default.
    • Example:
      plugin[ga].trackpageview(/pano1/);
  • trackevent(category, action, label, value, nonInteraction)
    • Sends event tracking request to Google Analytics tracker.
    • Use this method to track interaction and non-intercation events.
    • 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.
    • nonInteraction - an optional boolean flag, indicating that event hit will not be used in bounce-rate calculation.
      Example:
      plugin[ga].trackevent(Video Player, Play);
      plugin[ga].trackevent(UI, Button click, Fullscreen button);
    Check the Events Tracking Guide for more details.

Examples

Example xml code:
<krpano version="1.0.8">
	<plugin name="ga"
		url="plugins/analytics.swf"
		url="plugins/analytics.js"
		preload="true"
		
		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 I can 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: You can check the forum discussion thread or subscribe to newsletter at this page.
  • Q: How do I know the version of my plugin?
    A: You can open swf file in a browser, open krpano viewer log panel or trace version attribute of the plugin to find a version code.

Best Practices & Troubleshooting

Every plguin user should understand that the example code should be adopted to the each specific virtual tour in order to work properly. Here are some tips which should help you to avoid errors.
  • When you testing locally, no real tracking requests will be sent to google until you upload and test your tour on the web.
  • Check the integration section.
  • Configure Flash Player security settings using this guide if you are testing locally.
  • Make sure to upload the purchased version on webserver instead of the demo. Demo version of the plugin will only work locally.

Changelog

v1.3 (Beta 1)
* [Added] Support for krpano v1.16+
* [Removed] mode attribute
* [Added] addpano, removepano, removeallpanos actions
* [Added] addevent, removeevent, removeallevents actions
* [Improved] All new codebase for the plugin

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