Hi,
we want to replace google-analytics with Piwik on our own servers. But, we have a lot of websites which are fully made in flash (AS2,AS3) where i implemented the google-eventTracking and pageTracking. Now i want to do the same for piwik, so that we can recognize what a user is doing on the site.
My first try was to call a java-script function, which is written into the index.html, so that a flash on(release) event calls that function:
<!-- Piwik -->
<script type="text/javascript">
...
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 2);
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
function home() {
piwikTracker.trackLink("home"); // otherwise
piwikTracker.trackPageView("home");
}
...
</p></noscript>
<!-- End Piwik Tag -->
2nd try was to call the pageTracker directly out of flash getURL(“java script:piwikTracker.trackPageView(’/home.html’);”);
didnt work.
Has anyone same problem or a workaround? Am i right in this forum? I did not find any help topics but a lot of support tickets which are tagged as invalid.
For example musiic-party.de //full flash pages with working GA tracking and implemented function for piwik
When you used the getURL method, did you put the javascript code (containing var piwikTracker = Piwik.getTracker(…)) before your flash content? it is important to put the JS instanciation before.
What technique were you using to tag your flash content with GA?
trackLink takes 3 parameters, only the 3rd (custom_data) is optional.
At minimum, you need to also specify the link type (2nd parameter) as either ‘download’ or ‘link’. (If you write a custom plugin, you can, of course, define your own link types.)
And matthieu the GA and Piwik Code placed before every flash element. I think im not using an special technique, just the easy way and customize if needed: pageTracker._trackEvent(“Category”, “Action”, “Label”, “Value”);
[quote=mkuehl @ Jan 26 2010, 02:14 PM]…
Flash-Code: getURL(“java script:home();”);
didnt work.
…[/quote]
it strikes me as odd that you are using “java script:” instead of “java script:” , is that valid in flash?
If it is, try something like alert in your javascript event, that should tell you if it is called at all.
Ok I got something to work but not quite what I was expecting:
On my flash website I setup an action button to do the following:
on (release) {
getURL(“javascript:piwikTracker.trackPageView(’/folder/File Downloaded ');”);
getURL(“http://domain.org/folder/file.rar”, “_blank”);
}
While testing it, the page title counted one hit for “folder/File Downloaded”
I guess I could track downloads that way but the ideal solution would be to actually trigger the Downloads under Actions because that would trigger a goal.
So instead of using “javascript:piwikTracker.trackPageView(’/folder/File Downloaded ')” what can I use instead to track downloads correctly?
Any help is greatly appreciated as I’m literally pulling my hair on this one.