Google Analytics krpano plug-in, PTP 1.8 - just getting started  

Share your tips and tricks here or get help with any Panotour problem!
No bug reports (of any kind) in this forum!
User avatar
ATXcloud
Member
 
Posts: 135
Joined: Mon Jun 06, 2011 6:06 am
Location: AUSTIN, TX USA

Google Analytics krpano plug-in, PTP 1.8 - just getting started

by ATXcloud » Sat Aug 24, 2013 10:11 pm

Just getting started with GA. I've read all the documentation on Krpano plugin & forum posts, and did a search and read everything here as well.

Curious if anyone using ptp1.8 got the krpano plug-in to work.
Howdy from Deep in the Heart of Texas!

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

by udrh » Wed Aug 28, 2013 3:20 am

Hi,

I have had some success in using the Analytics plugin.

The analytics.xml file contains the list of the panoramas, hotspots and menu items that you want to track. This adds a fair amount of post-build editing to each tour. I am in the process of developing a python script that automates the construction of the 'analytics.xml' file.

The 'pano' function adds each panorama as a new page in the 'pages' section in GA, while the 'events' adds it to the 'events' section. I decided to primarily use the 'events', rather than the 'pano' function, as I wanted to see which hotspots users were clicking on, rather than which panos they ended up on (and I could infer the result anyway, by noting the link details in the data field).

The event data takes parameters as 'Category, Action, Label'.

The code below is the approach I've taken to integrate with PTP 1.8 file structure.

Code: Select all
   
<krpano>
<plugin name="ga"
        url="plugins/analytics.swf"        | analytics source file
        alturl="plugins/analytics.js"    | analytics source file
       
        keep="true"
        preload="true"
        debug="true"

        account="{account details}"        |GA tracking id
        prefix="/virtualtour"    |the page ‘path’ name that the panos will be filed under in GA
>

|| add in individual panos
    <pano name="startpano"        |name (I can't remember if this field is actually used or not)
        xmlurl="test.xml"            |target of xml file
        pageurl="/startpano/"    |the page ‘path’ name that the pano is filed under in GA
    />

|| each item to be tracked will need to be added individually
    <event name="hotspot0"                   | name (again, not sure if this is used. It might need to be the same name as the target.)
        xmlurl="test0.xml"                         | target xml file
        target="hotspot[spot0].onclick"    | target element action in the xml file
        data="Hotspot,pano link,spot0 - Hall 1"         | Passed to ‘TrackEvent’ function. Parameters are: Category, Action, Label, Value, nonInteraction(bool)
    /> 

|| UI buttons can also be added   
    <event name="leftclick"
        global="true"        | not specific to the current pano
        target="plugin[left].onclick"
        data="UI,Button click,Left button"
    />


</plugin>

<!-- Actions -->
<action name="activatepano">
if (%1 != null, if (get(action[mainloadpano].content) !== null, if (%2 == xml, mainloadpano(%HTMLPATH%/%1), mainloadpano(%1)), if (%2 == xml, loadpano(%HTMLPATH%/%1,null,MERGE,BLEND(1)), loadscene(%1,null,MERGE,BLEND(1))); wait(blend); ));
</action>
<action name="add_scenes_to_analytics">
for (set(i,0), i LT scene.count, inc(i), if (get(scene[get(i)].url), copy(data[a.url].content, scene[get(i)].url), copy(data[a.url].content, scene[get(i)].name)); plugin[ga].addPano(get(scene[get(i)].name), get(scene[get(i)].name), true, get(data[a.url].content)); );
</action>
</krpano>

Anyway, hope this helps give you a start.

Cheers,
Michael

no avatar
itsrichphoto
Member
 
Posts: 70
Joined: Thu Apr 18, 2013 10:56 pm
Location: OC, California

by itsrichphoto » Fri Aug 30, 2013 7:07 pm

i just put the google analytics script on the html page instead...
Richard Hart
Commercial and portrait photographer OC California
http://www.richhartphoto.com

User avatar
ATXcloud
Member
 
Posts: 135
Joined: Mon Jun 06, 2011 6:06 am
Location: AUSTIN, TX USA

by ATXcloud » Tue Sep 03, 2013 4:48 pm

udrh,

Excellent! Thank you. Got it working and excited about learning more about how people in the wild explore my tours.
Howdy from Deep in the Heart of Texas!


Return to Using Panotour / Panotour Pro 1.8

Who is online

Users browsing this forum: No registered users and 2 guests