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
AlanS
Member
 
Topic author
Posts: 27
Likes: 0 post
Liked in: 0 post
Joined: Thu Oct 10, 2013 1:20 am
Info

Google Analytics in PTP2

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

All,

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)

Thanks,

Alan

User avatar
benji33
Kolor Team
 
Posts: 3849
Likes: 4 posts
Liked in: 35 posts
Joined: Tue Apr 09, 2013 10:59 am
Location: France
Info

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
moyosa
New member
 
Posts: 3
Likes: 0 post
Liked in: 0 post
Joined: Mon Apr 14, 2014 11:02 pm
Info

Re: Google Analytics in PTP2

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

Anybody got this working:

http://krpano.com/plugins/userplugins/g ... tics/#demo

With PTP2? And can help me out?

no avatar
udrh
Member
 
Posts: 35
Likes: 0 post
Liked in: 1 post
Joined: Mon May 13, 2013 5:12 am
Location: Australia
Info

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"
      url="plugins/analytics.swf"
      url="plugins/analytics.js"
      preload="true"      
      account="UA-XXXXXXXX-1"
</plugin>


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
udrh
Member
 
Posts: 35
Likes: 0 post
Liked in: 1 post
Joined: Mon May 13, 2013 5:12 am
Location: Australia
Info

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.

http://krpano.com/forum/wbb/index.php?page=Thread&threadID=4324

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

no avatar
kingston345
New member
 
Posts: 8
Likes: 0 post
Liked in: 0 post
Joined: Sat Dec 21, 2013 1:24 am
Info

Re: Google Analytics in PTP2

by kingston345 » Mon Apr 06, 2015 11:08 pm

Hi,

I'm trying this out now and not having much success. Has there been any updates?

no avatar
udrh
Member
 
Posts: 35
Likes: 0 post
Liked in: 1 post
Joined: Mon May 13, 2013 5:12 am
Location: Australia
Info

Re: Google Analytics in PTP2

by udrh » Thu Apr 16, 2015 1:30 am

I've gone back to the drawing board with analytics. What I'd like to be able to do is create my own plugin. It would probably be a similar approach to the existing krpano plugin, but in HTML5 only, as I'm not sure what process I'd need to do for Flash.

Conceptually:
- A krpano plugin will be created to 'listen' for tour events. When they occur, it will send appropriate data to Google Analytics. (NOTE: I have no idea how to do the listening' bit yet, so if anyone has any advice, please let me know!)
- The events that the plugin listens for will be defined in a special file.
- An automated script will be developed to go through the built PTP2 xml tour files and create a file with the list of events.

At the moment, though, I've had success with directly sending event data. For example, you can call a javascript function inside the action for a hotspot:

Code: Select all
<action name="onclickspotpoint8" >
mainloadscene(pano2);
lookat(get(panoview.h), get(panoview.v), get(panoview.fov));

js(ga('send', 'event', 'current: pano1', 'hotspot: go to pano', 'destination: pano2'););

<action>

You will need to add the google analytics tracking code snippet you get from the GA website to the tour's html file (make it easy by adding it to a html template).

Check the Google analytics intro page for more info. https://developers.google.com/analytics/devguides/collection/analyticsjs/index


Return to Using Panotour / Panotour Pro

Who is online

Users browsing this forum: No registered users and 2 guests