You will recieve your password to this address. Address is not made public.

Your preferred username that is used when logging in.

Google Analytics plugin Created Oct 8, 2009

This thread is solved

Views: 8809     Replies: 55     Last reply Aug 26, 2011  
You must login first before you can use this feature

3232design

Posts: 30

Registered:
Sep 10, 2009

Google Analytics plugin

Posted: Oct 8, 2009

Cross-posting from the 'requested features' thread. Hope that's OK.

Here's a link to the plugin and source:

http://www.flwoutdoors.com/GoogleTracker.zip

It's a 3.1.3 plugin, and should work with either regular or commercial flowplayer. Call the plugin like this:

plugins: { gatracker: { url: "/path/to/flowplayer.GoogleTracker.swf", google_id: "UA-xxxxxxx-x", debug: false} }

Where the google_id is your Google ID. If debug is true, the plugin won't send tracking info to Google but will instead draw what it would have sent over the video.

This tracks onStart (start(1)), Play, Pause, Stop, and Finish. Also replays (start(2)). It fires two events for each, just because of the way I needed to use it. You could pretty easily modify the source and recompile to do whatever you need it to. Just be sure to have the analytics.swc in your flexdir's /frameworks/libs directory when you compile.

This also works when compiled into flowplayer, so you can compile all of the options right into the flowplayer.swf file for embedding, which was the original problem on this thread.

If the embed code includes the parameter "AllowScriptAccess=always" then this movie will also report what website and page it's embedded into. Note that this site tracking won't work for Myspace, which changes the AllowScriptAccess to "never" when you embed it. Oh well, can't win 'em all.

Hope it's useful for you.

Edge
Vizmu Media ------------------- http://vizmu.com/

Posts: 576

Registered:
Nov 29, 2008

» Google Analytics plugin

Posted: Oct 13, 2009

Reply to: Google Analytics plugin, from 3232design
WOW!

Very nice! I was waiting for google analytics to work with remote embedding b4 allowing it.

I'll test it out later for sure gj man.

3232design

Posts: 30

Registered:
Sep 10, 2009

» Google Analytics plugin

Posted: Oct 19, 2009

Reply to: Google Analytics plugin, from 3232design
New version:http://www.flwoutdoors.com/GoogleTracker-1.1.zip

  • Fixes a bug that threw an error in IE 8 on start
  • Only one event tracked per event now, the name of the event is the Embedded URL (or 'Unknown' if allowscriptaccess is not 'always')
  • Cleaned up the code comments a little to make it clearer how it works

It's called the same way as before:


plugins: { gatracker: { url: "/path/to/flowplayer.GoogleTracker.swf", google_id: "UA-your-google-ID", debug: false} }

Where the URL is where the plugin sits (optional, defaults to 'flowplayer.GoogleTracker.swf'), google_id is your Google Analytics ID (required, will throw an error if not supplied), and debug (true or false, optional, but defaults to true if not supplied).

And tracks into Google Analytics the following event info:


"http://website.com/page_flowplayer_is_embedded_on", "Play", "http://yoursite.com/video_clip_name", "time_in_seconds");

As before, you should be able to compile this plugin right into your flowplayer.swf and supply all of the parameters in your BuiltInConfig.as to use for external website object tag embedding and tracking. Remember to set AllowScriptAccess=always on your object tag's params and attributes or the Embedded URL will not be tracked.

If anyone has any input on how to improve this plugin, please let me know and I'll update it.

kennyl

Posts: 2

Registered:
Nov 18, 2009

» » Google Analytics plugin

Posted: Dec 9, 2009

Reply to: » Google Analytics plugin, from 3232design
I have compiled the OpenAdStreamer along with your GATracker which is fantastic. However, as shows are played with the OpenAdStreamer, I'm only getting the onClipStart event each time a new clip is started in the playlist. Pause, Stop, and Complete never send to google while I test it with firebug. Any thoughts on this would be greatly appreciated.

Thanks for the great work!

jaltuve

Posts: 21

Registered:
Jun 13, 2008

GATracker on 3.1.5

Posted: Dec 18, 2009

Reply to: » Google Analytics plugin, from 3232design
Hi, can someone confirm it works on 3.1.5? I tried it (the latest 1.1 version) and all I can see is the progress indicator looping!

3232design

Posts: 30

Registered:
Sep 10, 2009

» GATracker on 3.1.5

Posted: Dec 18, 2009

Reply to: GATracker on 3.1.5, from jaltuve
I compiled this version using 3.14. I'd imagine it's all the same for 3.15, but you might need to recompile the plugin. I haven't downloaded the latest code yet (just got on the notify list) but when I get a chance I'll update it and make sure it still works.

Anssi
Flowplayer Flash & video streaming developer

Posts: 1194

Registered:
Jul 24, 2007

» » Google Analytics plugin

Posted: Dec 18, 2009

Reply to: » Google Analytics plugin, from 3232design
Great stuff! This has been here since October and only now i discover this. Anyway simply great that we have this here. Hopefully we can make this 'official' with demos etc.

Edge
Vizmu Media ------------------- http://vizmu.com/

Posts: 576

Registered:
Nov 29, 2008

» » » Google Analytics plugin

Posted: Dec 18, 2009

Reply to: » » Google Analytics plugin, from Anssi
The standard setup for it dosen't seem to work with 3.1.5. But I haven't debugged it at all yet.

Anssi if you we're able to get it working in 3.1.5 give a shout as I said I only tried a quick minimal install. I'll test it further when I have a free minute. Its ideal for embedding.

jaltuve

Posts: 21

Registered:
Jun 13, 2008

» » » » Google Analytics plugin

Posted: Dec 18, 2009

Reply to: » » » Google Analytics plugin, from edge
I agree, with allowscriptaccess set to always in the OBJECT embed code, tracking player events in external pages will be very useful.

Abbey

Posts: 20

Registered:
Sep 11, 2009

compiling plugin with flowplayer

Posted: Jan 18, 2010

Reply to: » » Google Analytics plugin, from Anssi
Hey Anssi,

I tried following your directions at:http://flowplayer.org/plugins/flash/analytics.html

You will need the analytics.swc library from gaforflash in your ant external libraries path if you want to compile Analytics into your flowplayer.swf. Supply all of the gatracker parameters in your BuiltInConfig.as to use for external website object tag embedding and tracking. See here for more information on how to compile plugins into the player.

But it's too vague for me to figure out. I always get BUILD FAILED. Can someone help me compile flowplayer + analytics plugin? I can compile flowplayer + controlbar just fine, but having trouble adding analytics.

I downloaded all the source code via SVN and my workspace folders are like this:

flowplayer.analytics
flowplayer.controls
flowplayer.core
flowplayer.devkit
gaforflash

flowplayer.analytics/build.xml:

<project name="Google Analytics plugin for Flowplayer" default="build">

	<property file="../flowplayer.devkit/plugin-build.properties" ></property>
	<import file="../flowplayer.devkit/plugin-build.xml"></import>
	<property name="flowplayer_lib" value="../core/build/flowplayer.swc" ></property>
    <property name="library-path" value="lib" ></property>

    <property name="version" value="3.1.5" ></property>
    <property name="basename" value="flowplayer.analytics" ></property>
    <property name="plugin-binary" value="${basename}.swf" ></property>
    <property name="plugin-binary-versioned" value="${basename}-${version}.swf" ></property>
    <property name="plugin-main-class" value="org/flowplayer/analytics/GoogleTracker.as" ></property>

</project>

flowplayer.core/build.properties has:

plugin.buildfiles=flowplayer.controls/build.xml,flowplayer.analytics/build.xml,gaforflash/build.xml
plugin-classes=../flowplayer.controls/src/actionscript ../flowplayer.analytics/src/actionscript ../gaforflash/src/com/google/analytics/
controls-dir=../flowplayer.controls
plugin-swc=../flowplayer.controls/src/flash ../gaforflash/fla

flowplayer.core/src/actionscript-builtin/BuiltInConfig.as

package {
    import org.flowplayer.controls.Controls;
    import org.flowplayer.analytics.GoogleTracker; 

    public class BuiltInConfig {
        private var controls:org.flowplayer.controls.Controls;
        private var gatracker:org.flowplayer.analytics.GoogleTracker;

        public static const config:Object = {
            "plugins":{
                "controls":{"url":"org.flowplayer.controls.Controls"},
                "gatracker":{"url":"org.flowplayer.analytics.GoogleTracker"}
                }
            }
        }
    }

Anssi
Flowplayer Flash & video streaming developer

Posts: 1194

Registered:
Jul 24, 2007

» compiling plugin with flowplayer

Posted: Jan 18, 2010

Reply to: compiling plugin with flowplayer, from Abbey
Can you please post the whole compilation error that you get.

Does the ../gaforflash/fla directory contain the nalytics.swc library?

Abbey

Posts: 20

Registered:
Sep 11, 2009

» » compiling plugin with flowplayer

Posted: Jan 18, 2010

Reply to: » compiling plugin with flowplayer, from Anssi
I tried 3232design idea of changing plugin-swc to plugin-libs... that didn't work for me.

Here are screenshots of the errors:

  1. ant build-biz
  2. ant build-biz -v
  3. gaforflash folder (has analytics_flash.swc)

Thanks for your help!

Anssi
Flowplayer Flash & video streaming developer

Posts: 1194

Registered:
Jul 24, 2007

» » » compiling plugin with flowplayer

Posted: Jan 19, 2010

Reply to: » » compiling plugin with flowplayer, from Abbey
I have now added a directory called 'lib' to the Subversion repository. Please update and you'll get this directory to your plugin. This folder contains the analytics library analytics_flash.swc. I had changed the build.xml file to look for this folder and now your build was failing because of this.

Here's the directory in SVN:http://code.google.com/p/flowplayer-plugins/source/browse/flash/#flash/analytics/trunk/lib

Abbey

Posts: 20

Registered:
Sep 11, 2009

» » » » compiling plugin with flowplayer

Posted: Jan 19, 2010

Reply to: » » » compiling plugin with flowplayer, from Anssi
Thanks Anssi! I still got build failed with this error:


--snippet--
build-biz:

prepare:

compile-commercial:
   [echo] Building binary flowplayer.commercial.swf
   [exec] Loading configuration file D:\x64home\flex\frameworks\flex-config.xml
   [exec] D:\x64eclipse\workspace\gaforflash\src\com\google\analytics\AnalyticsTracker.as: Error: A file found in a source-path must have the same package structure '', as the definition's package, 'com.google.analytics'.
   [exec]

BUILD FAILED

--snippet--

So what I did was copy the com folder in the gaforflash project to the /src/actionscript folder inside the flowplayer.analytics project. Here is a screenshot. After I did that, it compiled without errors.

Anssi
Flowplayer Flash & video streaming developer

Posts: 1194

Registered:
Jul 24, 2007

» » » » » compiling plugin with flowplayer

Posted: Jan 19, 2010

Reply to: » » » » compiling plugin with flowplayer, from Abbey
Do you have the sources of the google analytics library in the build path? If so remove the google sources completely. The required classes are in the analytics_flash.swc library.

Abbey

Posts: 20

Registered:
Sep 11, 2009

» » » » » » compiling plugin with flowplayer

Posted: Jan 19, 2010

Reply to: » » » » » compiling plugin with flowplayer, from Anssi
I don't have any google sources, but the error is in GoogleTracker.as. You can see my current build.properties from the last screenshot. And here is the error message I get when I deleted the com folder. Is it because of the import com.google.analytics.GATracker; inside GoogleTracker.as ?

Abbey

Posts: 20

Registered:
Sep 11, 2009

GoogleTracker.as Error

Posted: Jan 25, 2010

Reply to: » » » » » » compiling plugin with flowplayer, from Abbey
So if you didn't see the screenshot above, here is the error:

[exec]...GoogleTracker.as(35): col: 24 
Error: Type was not found or 
was not a compile-time constant: GATracker.
[exec]
[exec]     private var _tracker:GAtracker;  // the actual tracker object
[exec]                          ^

How can I debug/test to see if it's actually finding the /lib/analytics.swc? Because I don't think it is. For me at least, I have to copy the com folder to get it to work.

3232design

Posts: 30

Registered:
Sep 10, 2009

» GoogleTracker.as Error

Posted: Jan 25, 2010

Reply to: GoogleTracker.as Error, from Abbey
I had to put my analytics.swc in my flex folder's frameworks/libs/ directory to get it to see them.

Abbey

Posts: 20

Registered:
Sep 11, 2009

I found the solution!

Posted: Feb 1, 2010

Reply to: » GoogleTracker.as Error, from 3232design
The answer was to modify flowplayer.core build.xml

It starts on line number 42 if you want to view it on googlecode.

I had to add ../flowplayer.analytics/lib to plugin-libs.

So now it looks like this:

<condition property="plugin-libs" value="${controls-dir}/src/flash/${plugin-skin} ../flowplayer.analytics/lib" else="">
    <available file="${controls-dir}/build.xml" />
</condition>

Anssi, is this a bug?

3232design

Posts: 30

Registered:
Sep 10, 2009

» GoogleTracker.as Error

Posted: Feb 3, 2010

Reply to: GoogleTracker.as Error, from Abbey
That usually means it can't find the analytics.swc, as that's where the GATracker object is defined. Re-check your library paths and make sure the analytics.swc is in there.

3232design

Posts: 30

Registered:
Sep 10, 2009

» compiling plugin with flowplayer

Posted: Jan 18, 2010

Reply to: compiling plugin with flowplayer, from Abbey
Should this line:
<property name="flowplayer_lib" value="../core/build/flowplayer.swc" ></property> 
read
<property name="flowplayer_lib" value="../flowplayer.core/build/flowplayer.swc" ></property> 
?

EDIT: Never mind, I don't think that affects the embedded plugins. I changed the flowplayer.core/build.properties line that starts with "plugin-swc" to read 'plugin-libs'. Not sure if that's the best way to do it, but it worked.

3232design

Posts: 30

Registered:
Sep 10, 2009

GoogleTracker new version -- 3.1.5

Posted: Dec 21, 2009

Reply to: Google Analytics plugin, from 3232design
I've compiled a new version of GoogleTracker. This has several updates:

  • Works with 3.1.5 player.
  • Tracks more events: Start, Play, Pause, Resume, Seek, Finish, Mute, Unmute, Full Screen, Exit Full Screen.
  • External function doPlayerTrackEvent(eventLabel:String) allows you to send the plugin custom events (the player will output to Google Analytics the embedded URL (if any), the eventLabel you passed in, the clip url, and the time in seconds when you fire the function).

The setup is the same as previous versions.


plugins: { 
     gatracker: { 
          url: "/path/to/flowplayer.GoogleTracker.swf", 
          google_id: "UA-your-google-ID", 
          debug: false
     } 
} 


In the future To Do list:
  • allow custom event label names
  • specify which events should fire and which should not
  • get a demo page working

jaltuve

Posts: 21

Registered:
Jun 13, 2008

» GoogleTracker new version -- 3.1.5

Posted: Dec 22, 2009

Reply to: GoogleTracker new version -- 3.1.5, from 3232design
Hi 3232design,

I really appreciate your contribution, thank you very very much.. I'll test it now, will report back if I find any problems

jaltuve

Posts: 21

Registered:
Jun 13, 2008

» » GoogleTracker new version -- 3.1.5

Posted: Dec 22, 2009

Reply to: » GoogleTracker new version -- 3.1.5, from jaltuve
:(

I'm getting a player initialization type error #1009 which means:

Cannot access a property or method of a null object.

I didn't test any further, but I only replaced the old tracker with this one. the old tracker will simply display the progress indicator going in circles. this new 3.1.5 version is not letting the player initialize.

3232design

Posts: 30

Registered:
Sep 10, 2009

» » » GoogleTracker new version -- 3.1.5

Posted: Dec 22, 2009

Reply to: » » GoogleTracker new version -- 3.1.5, from jaltuve
Usually when I get #1009's it's because flowplayer isn't finding a plugin like controls, or one of my paths is screwed up. Do you have the page up somewhere I can look at it?

3232design

Posts: 30

Registered:
Sep 10, 2009

» » » GoogleTracker new version -- 3.1.5

Posted: Dec 22, 2009

Reply to: » » GoogleTracker new version -- 3.1.5, from jaltuve
The only two required attributes of GoogleTracker are the url of the plugin and your google id. Missing either of those two attributes will cause the plugin to fail. I have discovered another little bug in the code, so you can download the very latest here, but it shouldn't affect this problem.

Here's my current minimal code, using the stock flowplayer-3.1.5.swf straight off flowplayer.org:


<a 
    href="http://flashy.flowplayer.org/video/flowplayer-700.flv" 
    style="display:block;width:425px;height:300px;" 
    id="player"> 
</a>

<script language="JavaScript"> 
flowplayer("player", "/flowplayer-3.1.5.swf", {	
	plugins:{
		gatracker: {
			url: "/flowplayer.GoogleTracker.swf",
			debug: true,
			google_id: "UA-xxxxxxxx-x" // your google id here
		}
	}
}); 

</script>

jaltuve

Posts: 21

Registered:
Jun 13, 2008

» » » » GoogleTracker new version -- 3.1.5

Posted: Dec 22, 2009

Reply to: » » » GoogleTracker new version -- 3.1.5, from 3232design
Hi!

I'll test in a while.. my config file is quite complex :) I use Ad Delivery and almost every thing is customized (button, controls, etc) and I use the commercial version of FlowPlayer.

you can check the config file, it's dynamically generated the first time, and mod_cached after that for 1 hour (for performance)

http://www.venetubo.com/emb_v3_dev/3453/0/1/0/config_player_rev99.js

if you pass gatracker to the above config it will automatically enable the commented gatracker line. So, if you change the config to:

http://www.venetubo.com/emb_v3_dev/3453/0/1/0/config_player_rev99.js?gatracker=1 and pass it to the player like this:

http://www.venetubo.com/images/flash/v3/flowplayer/flowplayer.commercial-3.1.5.swf?config=http://www.venetubo.com/emb_v3_dev/3453/0/1/0/config_player_rev99.js?gatracker=1 it will NOT work.. however, if you make gatracker 0 it will work..

see:

http://www.venetubo.com/images/flash/v3/flowplayer/flowplayer.commercial-3.1.5.swf?config=http://www.venetubo.com/emb_v3_dev/3453/0/1/0/config_player_rev99.js?gatracker=0

jaltuve

Posts: 21

Registered:
Jun 13, 2008

» » » » » GoogleTracker new version -- 3.1.5

Posted: Dec 22, 2009

Reply to: » » » » GoogleTracker new version -- 3.1.5, from jaltuve
The above examples, now use the updated version you sent. Now, I don't see the initialization error, but the progress bar doing circles

jaltuve

Posts: 21

Registered:
Jun 13, 2008

» » » » » » GoogleTracker new version -- 3.1.5

Posted: Dec 23, 2009

Reply to: » » » » » GoogleTracker new version -- 3.1.5, from jaltuve
I think I know what the error might be. check out this test page:

http://www.venetubo.com/foros/BETA-testing-Venetubo-Video-Ads-P346318.html

Two exact embeds. the first one has gatracker DISABLED, second one has it enabled.

It seems there is a 'conflict' between the Video Ads plugin (Open Ads Streamer) and yours, because when NO pre-roll ads are shown your Plugin does seem to work. it could also be a bug in the Video Ads plugin.. I already reported it, but it seems is not being actively developed anymore or they ignore bug reports.

Evidently, I tested your plugin in a plain configuraion with no other plugins enabled and it worked.

3232design

Posts: 30

Registered:
Sep 10, 2009

» » » » » » » GoogleTracker new version -- 3.1.5

Posted: Dec 23, 2009

Reply to: » » » » » » GoogleTracker new version -- 3.1.5, from jaltuve
There are two of these javascript errors on the page:

Unable to post message tohttp://googleads.g.doubleclick.net. Recipient has originhttp://www.venetubo.com.

That googleads.g.doubleclick.net bothers me. I wonder if that 'googleads' part means they're using the same gaforflash swc for their ad tracking that Google uses for its analytics? It's possible the bug is in Google Analytics vs Google Ads. I've gotten reports that the gatracker plugin doesn't report events during preroll ads (though this is the first time I've seen it actively block the player completely) which could be because there are two complete sets of the GATracker.swc libraries loaded. Are you serving ads derived from Google? Do you know if the Open Ads Streamer uses the Google Flash libraries? I'll do some checking into that. I would have assumed that each plugin's library space was scoped locally, but now I'm not so sure. If that's the case, the only workaround I can think of is to hack a custom Google swc and change the variable and method names, which is suboptimal.

This is total conjecture, as I only know how the Analytics tracking works. I'm not as familiar with how video ads do their internal tracking.

EDIT:
One thing I found was this:
http://code.google.com/p/gaforflash/issues/detail?id=45

It returns the same error you've described, which seems to suggest that when it comes to Google's own sites, there is a bug in the GATracker.swc.

jaltuve

Posts: 21

Registered:
Jun 13, 2008

» » » » » » » » GoogleTracker new version -- 3.1.5

Posted: Dec 23, 2009

Reply to: » » » » » » » GoogleTracker new version -- 3.1.5, from 3232design
I created two test cases:

http://www.venetubo.com/images/flash/v3/flowplayer/example/tracker.html

http://www.venetubo.com/images/flash/v3/flowplayer/example/notracker.html

basic, minimalistic player pages w/ad serving. One uses gatracker, the other doesn't.

I don't think its a conflict with the google flash libraries, the Video Ads plugin doesn't use them and the errors you saw in the other page were simply GoogleAd manager errors (ad serving)

I'll do some more testing to see if I can isolate the problem using some alternative methods.

I will leave the above test pages intact so we can test further if you want me to install another compiled debug only copy of your plugin to see what might be happening.

3232design

Posts: 30

Registered:
Sep 10, 2009

» » » » » » » » » GoogleTracker new version -- 3.1.5

Posted: Dec 23, 2009

Reply to: » » » » » » » » GoogleTracker new version -- 3.1.5, from jaltuve
The gatracker test page appears to work. Was it one of the other plugins from the full config that had a conflict, or did gatracker only break when the first clip was a preroll ad?

jaltuve

Posts: 21

Registered:
Jun 13, 2008

» » » » » » » » » » GoogleTracker new version -- 3.1.5

Posted: Dec 23, 2009

Reply to: » » » » » » » » » GoogleTracker new version -- 3.1.5, from 3232design
It works, as long as no pre-roll ad is scheduled to be delivered (I disabled pre-rolls for now)

so, this is defiitely some kind of conflict.
both gatracker and the video ads plugin are accesing/reading/listening to an event or preventing one from firing.. not sure, the thing is that it appears to be some kind of 'exclusive' access where one kicks the other out. I wonder if plugin loading order has anything to do with this.

jaltuve

Posts: 21

Registered:
Jun 13, 2008

» » » » » » » » » » » GoogleTracker new version -- 3.1.5

Posted: Dec 23, 2009

Reply to: » » » » » » » » » » GoogleTracker new version -- 3.1.5, from jaltuve
Ok, I re-activated the pre-roll. and set up this page:

http://www.venetubo.com/images/flash/v3/flowplayer/example/test.html

It works! with pre-roll.. I think its definitely a BUG with the Ad Streamer plugin and the way it handles playlists.

The above example doesn't use playlists, but the 'shows' property in the Video Ads plugin. So, your plugin is perfectly fine. is conflicting, but because of something the Video Ads plugin is doing wrong.

Anssi
Flowplayer Flash & video streaming developer

Posts: 1194

Registered:
Jul 24, 2007

» » » » » » » » » » GoogleTracker new version -- 3.1.5

Posted: Dec 23, 2009

Reply to: » » » » » » » » » GoogleTracker new version -- 3.1.5, from 3232design
When I test the tracker.html page i get following that shows in Flash debug player. This comes right after the page has loaded.


TypeError: Error #1009: Cannot access a property or method of a null object reference.
	at org.flowplayer.analytics::GoogleTracker/doTrackEvent()
	at MethodInfo-5()
	at EventListener/notify()
	at org.flowplayer.model::EventDispatcher/_dispatchEvent()
	at org.flowplayer.model::EventDispatcher/http://flowplayer.org/core/internal::doDispatchEvent()
	at org.flowplayer.model::Clip/onClipEvent()
	at EventListener/notify()
	at org.flowplayer.model::EventDispatcher/_dispatchEvent()
	at org.flowplayer.model::EventDispatcher/http://flowplayer.org/core/internal::doDispatchEvent()
	at org.flowplayer.model::ClipEventDispatcher/dispatch()
	at ImageController/onLoadComplete()
	at MethodInfo-2193()
	at org.flowplayer.controller::ResourceLoaderImpl/onLoadComplete()

jaltuve

Posts: 21

Registered:
Jun 13, 2008

» » » » » » » » » » » GoogleTracker new version -- 3.1.5

Posted: Dec 23, 2009

Reply to: » » » » » » » » » » GoogleTracker new version -- 3.1.5, from Anssi
Here's how to check that it's definitely a bug in the Open Ads Plugin:

Check:

http://www.venetubo.com/images/flash/v3/flowplayer/example/test.html

it should work...

now try this one:

http://www.venetubo.com/images/flash/v3/flowplayer/example/tracker.html

it will fail.

The ONLY difference being:

In the 'test' example, I use the 'shows' property (which is like the equivalent of playlists) for video streams in the Video Ads Plugin.

In the 'tracker' example, I use FlowPlayer's playlist property.

so, its pretty obvious there is an error in the way the 'Video Ad Streamer' handles playlists. I already reported the bug, and provided test cases for the developer including some detailed information.

Edit: In some cases, if the second example works, it is because NO pre-roll was scheduled to be run. (OpenX is kinda funny, because it seems to have a mind of its own when delivering remant)

3232design

Posts: 30

Registered:
Sep 10, 2009

New version of GoogleTracker plugin -- 3.152

Posted: Dec 23, 2009

Reply to: Google Analytics plugin, from 3232design
There's a new version of the GoogleTracker (again). Get it here.

  • Added a configuration object (labels) to change the events labels before runtime
  • Added another external javascript function called 'setLabelName()' to change any event's label on the fly
  • Updated the existing external function, now called 'trackEvent()' to track custom events in addition to the ones GoogleTracker already tracks by host page, the current clip's file name, and player time

Now, the plugin declaration can look like this:
plugins:{
	gatracker: {
		labels: {
			start: "Start",	
			begin: "Play",	
			pause: "Pause",	
			resume: "Resume",	
			seek: "Seek",	
			stop: "Stop",	
			finish: "Finish",	
			mute: "Mute",	
			unmute: "Unmute",	
			fullscreen: "Full Screen",	
			fullscreenexit: "Full Screen Exit"	
		},
		url: "/flowplayer.GoogleTracker.swf",
		debug: true,
		google_id: "UA-xxxxxxx-x" // your Google id here
	}
}
The labels object contains all of the events that GoogleTracker will track. You can change one, all, or none of them. The labels object is not required, and if not supplied will just use the label names listed above as the default label names for those events.

If you set the label name to false, GoogleTracker will not track that event. For example, if you don't want to track mute or unmute events, the labels object would look like this:
labels: {
	mute: false,	
	unmute: false	
}

You can turn on or off a specific event type with the 'setLabelName()' function below by passing in a new event label or false, respectively.

You can call the external functions like this:
$f().getPlugin("gatracker").setLabelName("pause", "NewPauseName"); // will change the default label name of the pause event to 'NewPauseName'	
$f().getPlugin("gatracker").setLabelName("pause", false); // will stop tracking pause events
$f().getPlugin("gatracker").trackEvent("My Custom Event Name");

Note that by using the trackEvent function, you can track events outside Flowplayer using the movie's current time. For example, if somebody clicks on a button on the page, you could track exactly what time in which movie they clicked that button.

jaltuve

Posts: 21

Registered:
Jun 13, 2008

» New version of GoogleTracker plugin -- 3.152

Posted: Dec 25, 2009

Reply to: New version of GoogleTracker plugin -- 3.152, from 3232design
3232design,

Thanks again! I've decided to install the tracker in my production environment, so far it seems to be working fine, however (and probably this is a Google Analytics error) but every single 'event' generated from the plugin seems to be counting as a 'visit' to my site. Any idea why this happens? Google Analytics now show a huge number of visits (almost double) but I'm not sure why this happens.

Thanks, and merry xmas

3232design

Posts: 30

Registered:
Sep 10, 2009

New version: 3.15.3

Posted: Dec 30, 2009

Reply to: » New version of GoogleTracker plugin -- 3.152, from jaltuve
Jaltuve,

Try this version (3.15.3). It adds Bridging mode, which may take care of your double reporting. What it does is bypasses the internal analytics.swc library and uses the page's existing ga.js and pageTracker object instead of creating a new internal instance.

You call it like this:

	gatracker: {
		url: "flowplayer.GoogleTracker.swf",
		tracking_mode: "Bridge",
		bridge_object: "window.pageTracker"
	}

The new parameter tracking_mode is optional and defaults to AS3, and everything still works as before. However, if you change tracking_mode to "Bridge" then the google_id is no longer required, and you have to pass in the bridge_object you're already using on the page via ga.js.

I haven't tested to see if it reduces the page hits, but it should since we're not creating a new pageTracker object internally anymore in Bridge mode, just passing the events to the existing ga.js pageTracker object. Please let me know if this works for you.

jaltuve

Posts: 21

Registered:
Jun 13, 2008

» New version: 3.15.3

Posted: Dec 30, 2009

Reply to: New version: 3.15.3, from 3232design
3232design,

Thanks again. tried the new update, however I get a ga.js not found. Check this test page:

http://www.venetubo.com/images/flash/v3/flowplayer/example/newtracker.html

jaltuve

Posts: 21

Registered:
Jun 13, 2008

» » New version: 3.15.3

Posted: Dec 30, 2009

Reply to: » New version: 3.15.3, from jaltuve
be sure to hard refresh the page to see the latest version or simple bust the cache via query string arguments.

3232design

Posts: 30

Registered:
Sep 10, 2009

» » » New version: 3.15.3

Posted: Jan 9, 2010

Reply to: » » New version: 3.15.3, from jaltuve
Sorry it's been so long, the holidays dug a hole and stuffed me in it. I've dug out now.

Did you get this fixed? I don't see the ga.js error, but I also don't see any events being tracked. Is it possible it's because the js code creating the variable 'pageTracker' doesn't occur until after the swf is loaded? My initial guess is that the player starts loading before the page is finished, and ga.js isn't included on the page until the bottom.

I'll try a test over here and see if I can duplicate it, and maybe find a solution.

naro

Posts: 5

Registered:
Aug 19, 2009

Problems with analytics plugin

Posted: Jan 9, 2010

Reply to: New version: 3.15.3, from 3232design
Hi, I'm trying to get this plugin working. I've tried several versions, "official" one athttp://flowplayer.org/plugins/flash/analytics.html and version mentioned in this thread but there are still some problems.

The most important one is, there is no video displayed when playback is started, flowplayer is displayed but instead of video there is gray area only. GA events are displayed correctly (in debug mode). I've tried a lot of versions, including custom build, build inside flowplayer, but there is still the same problem. Player on the official page mentioned above works fine though. I've tried to duplicate it (using online versions of player and plugin) but the problem is still the same. If video is paused and resumed, video automagically appears.

Any ideas?

My test code:

<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <script type="text/javascript" src="http://static.flowplayer.org/js/flowplayer-3.1.4.min.js"></script>
    <link rel="stylesheet" type="text/css" href="style.css">
    <title>GA test</title>
</head><body>
    <div id="page">
        <h1>GA Flowplayer test</h1>
        <p>...</p>
        <a  
             href="http://flashy.flowplayer.org/video/flowplayer-700.flv"  
             style="display:block;width:520px;height:330px"  
             id="player"></a> 
    
        <script>
                $f("player", "http://releases.flowplayer.org/swf/flowplayer-3.1.5.swf", {
                    plugins:{
                        gatracker: {
                            url: "flowplayer.analytics-3.1.5.swf",
                            debug: true,
                            trackingMode: "AS3",
                            googleId: "UA-5877901-1" // your Google Analytics id here
                        }
                    }
                });
            
        </script>
</body>
</html>

Another problem I experienced is autoStart - if clip is autostarted, GA does not fire "Start" event. Could be this fixed, please ?

3232design

Posts: 30

Registered:
Sep 10, 2009

» Problems with analytics plugin

Posted: Jan 9, 2010

Reply to: Problems with analytics plugin, from naro
The problem is likely a Flash Security sandbox violation. When you put that code on a web server and run it via http it works just fine: the video plays and it tracks the autostart 'Start' event. When you run it locally ('file:///vidpage.html') it breaks because the Flash player doesn't trust local files unless you explicitly tell it to. You can add your local location to your Flash trusted locations here:

http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04a.html

If you do that, the code will work locally. Analytics will complain ('Protocol mismatch: SWF=http:, DOM=file:') because the player swf is embedded via the internet from flowplayer.org but the file is local and not on a webserver. Once you add your local file location to your Flash trusted locations it works just fine.

naro

Posts: 5

Registered:
Aug 19, 2009

» » Problems with analytics plugin

Posted: Jan 10, 2010

Reply to: » Problems with analytics plugin, from 3232design
Thanks, it works fine now :)

digumo

Posts: 1

Registered:
Mar 20, 2010

Using Bridge mode within a playlist?

Posted: Mar 20, 2010

Reply to: » Problems with analytics plugin, from 3232design
Hey 3232design, (or anyone here smart enough to help me out).

I'm trying to use the analytics in conjunction with a playlist. I'm also not using the older ga js.

1) Will the analytics.swf work using bridge mode with the newer ga method. (I'm using the swf from flowplayer.org)

2) when trying it on my server both via AS3 and Bridge, I receive tracking events (only Start events using AS3) but the video shows as gray (no picture) as mentioned above.

Can anyone help me figure out how to use this within a playlist? I've got gatracker currently commented out but you can find it here.

http://infostructor.com/masteringviews/watchvideos.html

wojciechk

Posts: 1

Registered:
Jan 20, 2010

bug: doesn"t send requests to GA

Posted: Jan 20, 2010

Reply to: New version of GoogleTracker plugin -- 3.152, from 3232design
Hey, thanks for the plugin!

I couldn't get it to work properly though. When compiled into the player with debug mode it would display all events. With debug mode disabled it wouldn't make any requests to Google Analytics.

I quickly hacked it to work. I edited this line in doTrackEvent function:

_tracker.trackEvent(_embeddedURL, _eventLabel, _clip.completeUrl + (_clip.isInStream ? ": instream" : ""), _player.status.time );

I casted last parameter to int:


_tracker.trackEvent(_embeddedURL, _eventLabel, _clip.completeUrl + (_clip.isInStream ? ": instream" : ""), int(_player.status.time) );

Now the plugin does make requests to Google Analytics. Is this a known issue?

3232design

Posts: 30

Registered:
Sep 10, 2009

» bug: doesn"t send requests to GA

Posted: Jan 20, 2010

Reply to: bug: doesn"t send requests to GA, from wojciechk
It wasn't a known issue before, but I'll add that to the code. Thanks!

howied

Posts: 2

Registered:
Jan 20, 2010

» Google Analytics plugin

Posted: Jan 20, 2010

Reply to: Google Analytics plugin, from 3232design
Hi and thanks a lot for the effort you've put in this plugin. Well done.

Now the thing is that I'm having some small problems getting the tracking to show on google analytic.

I've tried to run in debug mode as true, and I see each and every tracking on the screen. Then when I switch the debug on false nothing comes to analytic's.


trackingMode:"AS3",
debug: false,
google_id: "UA-6482000-4"

Any idea what that might be? ...although it's working in debug mode!

Abbey

Posts: 20

Registered:
Sep 11, 2009

» » Google Analytics plugin

Posted: Jan 20, 2010

Reply to: » Google Analytics plugin, from howied
It took me about 24 hours for it show up under Content > Events. Have you waited a day or two?

howied

Posts: 2

Registered:
Jan 20, 2010

» » » Google Analytics plugin

Posted: Jan 20, 2010

Reply to: » » Google Analytics plugin, from Abbey
Hey Abbey. Thank you for the quick response.

I haven't waited that long for this one, only been about 2 - 3 hours since I started testing with debug off.

But hey we never know right, so guess as everything seems fine when using debug mode, I could give this a little more waiting time.

3232design

Posts: 30

Registered:
Sep 10, 2009

» » » » Google Analytics plugin

Posted: Jan 20, 2010

Reply to: » » » Google Analytics plugin, from howied
If you're using it embedded, it may be a bug in the code. Check here for a possible workaround.

Ben

Posts: 2

Registered:
Mar 30, 2011

» Google Analytics plugin

Posted: Mar 30, 2011

Reply to: Google Analytics plugin, from 3232design
Hi,

I know this is an old post but I am pretty desperate for some help.

I am having the exact same problem as stated in post #5, which is:

"There is no video displayed when playback is started, flowplayer is displayed but instead of video there is gray area only. GA events are displayed correctly (in debug mode). I've tried a lot of versions, including custom build, build inside flowplayer, but there is still the same problem. Player on the official page mentioned above works fine though. I've tried to duplicate it (using online versions of player and plugin) but the problem is still the same. If video is paused and resumed, video automagically appears."

I have read the responses but I am not trying to play it from the local host. This problem occurs for me when I embed it into Facebook. Any ideas on why this would be and how I could fix it?

Thanks!