Google Analytics in PTP2  

Share your tips and tricks here or get help with any Panotour 2.0 problem!
No bug reports (of any kind) in this forum!
no avatar
Posts: 23
Joined: Thu Oct 10, 2013 1:20 am

Google Analytics in PTP2

by AlanS » Wed Dec 11, 2013 3:27 pm


Just getting started both in PTP2 and in panoramics in general. So yah, I'm a newb.

I'd like to put my Google Analytics tracking code into my tours. I've read elsewhere on the forum to just 'put the tracking code in the html'. Can anybody offer advice on where exactly this goes? Can I directly edit the HTML file from within PTP2, or must I edit the html externally? There was another thread that I was not able to access (in the French section), that might have had the solution. Alas.

I am aware of the KRpano plugin, but seems editing the HTML and inserting small snippet of tracking code would be simplest. Would like to avoid adding to post production.

Another question: I publish both to flash and to HTML5. if the tracking code is in the root HTML file, will visits that using Flash also be tracked (I'm guessing so, since that's the landing html for both)



User avatar
Kolor Team
Posts: 3242
Joined: Tue Apr 09, 2013 10:59 am
Location: France

Re: Google Analytics in PTP2

by benji33 » Mon Dec 16, 2013 10:38 am

You can add manually code into the main html template. But it will store only the call of the visit page.
No plugin exists yet into Panotour to offer a full G.Analytics implementation, on each pano, actions etc...
But it's into our feature request list.

no avatar
New member
Posts: 3
Joined: Mon Apr 14, 2014 11:02 pm

Re: Google Analytics in PTP2

by moyosa » Mon Apr 14, 2014 11:04 pm

Anybody got this working: ... tics/#demo

With PTP2? And can help me out?

no avatar
Posts: 28
Joined: Mon May 13, 2013 5:12 am
Location: Australia

Re: Google Analytics in PTP2

by udrh » Wed Jun 25, 2014 5:07 am

I managed to get Google Analytics working well in PTP1.8.

I am currently working with PTP2 but have had only limited success. The plugin documentation is a bit confusing, especially for PTP users as we are working with a specific XML structure.

The plugin does work to some extent. You can verify that the plugin works by testing the following minimum code with an html5 build.

Add this code to the main tour xml file (with your GA account code)

Code: Select all
<plugin name="ga"

Copy the '/plugins' folder from the example (the one with the analytics.js) into the tour data directory.

Add a tracking event call to the main xml file (such as inside the 'startup' action).

Code: Select all
plugin[ga].trackevent(Category - Comment, Action - Tracking added, pano27, spotpoint29)

In Google Analytics, the event should show up in the 'Real-time' section.

This is about as far as I have got. I haven't managed to get any of the plugin 'pano' or 'event' subnodes working yet.

I feel like the plugin should automatically add the 'pano' and 'event' subnodes by itself, but this hasn't been working for me.

It might be that I need to manually call the plugin's 'addpano' and 'addevent' actions instead - I am still testing this aspect.

I will let you know if I can progress further.

no avatar
Posts: 28
Joined: Mon May 13, 2013 5:12 am
Location: Australia

Re: Google Analytics in PTP2

by udrh » Tue Jul 01, 2014 1:21 am

I've got stuck with the plugin - now even the direct call trackevent() isn't working for me.

It is likely that the plugin has not been updated to work with KRPano v1.17 (I'm not sure what the last supported version is).

Also note that the developer appears to be on hiatus at the moment.

I will leave it for the moment - I might come back to it later.

Return to Using Panotour / Panotour Pro

Who is online

Users browsing this forum: No registered users and 1 guest