Comments (8)
It actually looks pretty easy to do as the code is structured nicely.
I think I can do a fix easilty and share it back. How Do I compile just the SWF plugin for analytics? I can't see anything in the readme for the project or in the Flowplayer docs.
from flash.
They use the swc libraries of the GA code.
Original project was here
https://code.google.com/archive/p/gaforflash/
New project
https://github.com/zwetan/as3-universal-analytics
from flash.
@danrossi ah - good shout. Is that big thing to do ? I was looking at doing it via the Bridge instead of using Measurement protocol.
It sounds like it would be the easiest option and ideal just to update the flash plugin to use universal as you say above.
from flash.
Just had a look - and unfortunately flash is not my strong point.
I know GA and Measurement protocol really well - so I can advise on the implementation if someone can do the Flash piping.
from flash.
by quickly looking at the sources it seems the analytics is done trough a plugin
https://github.com/flowplayer/flash/tree/master/plugins/analytics
I would suggest to create another analytics plugin (maybe? I'm not sure)
keeping the same structure/logic
but replacing com/google/analytics
packages with the ones of as3-universal-analytics
then you would have to change the logic and api calls in org/flowplayer/analytics
(maybe another name? org/flowplayer/uanalytics
or whatever to not confuse the 2 plugins)
in the main class GoogleTracker
(maybe rename that too?)
for example
import libraries.uanalytics.tracking.AnalyticsTracker;
import libraries.uanalytics.tracker.WebTracker;
public class GoogleTracker extends Sprite implements Plugin {
//...
private var _tracker:AnalyticsTracker; // ideally use the interface
private function instantiateTracker():void {
try {
_tracker = new WebTracker( "UA-12345-67" ); // for web
//_tracker = new AppTracker( "UA-12345-57" ); // for AIR
// or any custom tracker/sender that implement the interface
// more logic if needed
} catch(e:Error) {
_model.dispatchError(PluginError.ERROR, "Unable to create tracker: " + e);
}
}
}
private function doTrackEvent(eventName:String, trackViewDuration:Boolean = false, event:ClipEvent = null):void {
if (_tracker == null) {
instantiateTracker();
}
var clip:Clip = Clip(event ? event.target : _player.currentClip);
var time:int = trackViewDuration ? (_viewDurationMillis / 1000) : int(_player.status ? _player.status.time : 0);
// follow the doc from the interface
// eg. event( category:String, action:String, label:String = "", value:int = -1 ):Boolean;
_tracker.event( category, eventName, clip.completeUrl + (clip.isInStream ? ": instream" : ""), time );
}
see interface libraries.uanalytics.tracking.AnalyticsTracker
from that it's writing logic for the configuration and other custom settings you may need.
from flash.
It seems it needs a complete refactor to use the new library.
from flash.
it is a different library implementing a different protocol
even if it is still Google Analytics
from flash.
yes I tried to have a go this weekend.
so far after about 5hours, ihave got my head round it but am fighting against my lack of knowledge on flash to really progress.
i think the ideal method - is just to update the _gaq calls and change them to ga( calls via the Javascript bridge until someone who knows more flash can find time to update.
from flash.
Related Issues (20)
- Support multi-channel of audio HOT 7
- Flowplayer logs HOT 3
- Incorrect byte range request
- js controls: do not work on iPad HOT 8
- LiveRail Plugins SWF doesnt works with HTTPS HOT 1
- Is there a way to configure options globally in a page? HOT 1
- Switching a playback in midstream shows only a black screen (audio works) HOT 10
- playhead does not move with controlbar autoHide unset HOT 1
- RTMP: onBeforeFinish fired twice
- Error: Call to a possibly undefined method UpButton
- Pause event fired on video finish
- allow exceptions for external plugins
- Live audio doesnt play in IE10
- Flowplayer Flash: Corner case issue with playback of short videos
- A bug in "get playerBaseUrl" or a bug in "getDomainEnd" ?
- Flowplayer bypasses Adobe Flash Media server protection HOT 1
- How can I use class instead of ID? I have more than one HOT 8
- i want to use httpstreaming
- Javascript API throws "invalid exception" during RTMP livestream
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flash.