Great input as allways Lukas :). You read and respond to the actual question. Appriciate that a lot. I don’t refer to this forum but in many cases people don’t read what you ask about, start some kind of parallell discussion and just create a lot of confusion. So far every posting you’ve made has been precise and accurate!
Hope you have some more patience with me. Piwiks works and this feature is probably all I need to leave it as is.
I have some scripting background and at least it helps to understand a bit of java script logics. But I rely on trying to adapt my cases to working snippets, as I don’t have the ambition to be a creative java-scripter. I’ve also used some java-snippets before and managed then to edit them correctly. Hopefully I also can adapt to the trackEvent function you suggested. It seems to be the perfect solution to get the kind of statistics I need.
First time I copied in code here it was invisible so as there are restrictions around that I try to avoid it. I refer my notifications to the example presented below Tracking Events at https://piwik.org/docs/event-tracking/.
I’m a bit confused when it comes to the variables/arguments passed and how I connect an individual reading of each player. There are totally six media players on the page, four of them for soundfiles and two for videos.
I start with how I’ve interpreted the java scripts I have on other pages. As I understand it a declaration of what java is used on the page has to be made within the ‘head’ tag. I have lots of examples of that, not to mention the Piwik code I pasted in all pages. Then there use to be some kind of reference to those declarations where the script is used. I have a script that generates a slide show (declared within the head-tag in connection with a named variable, then used as a named div-tag in the HTML.
So, a declaration at ‘head’ and a reference to that in the HTML code. I can see the logic in that.
The function is ‘trackEvent(category, action, [name], [value])’
The example used is describes as the intention ‘to track a click on the Play button of the Documentary Thrive’. I understand ‘click on the Play button’
but it’s a bit unclear what ‘Documentary Thrive’ stands for? It’s very important to understand later on.
I then see the suggested script ‘_paq.push([‘trackEvent’, ‘Documentary’, ‘Play’, ‘Thrive’]);’
Comparing that to other java I use it’s a row used in declaration in ‘head’. So from that you just have to replace the example variables with your own. Trouble from here.
I understand the syntax as there is some hidden java function called ‘_pac.push’ that needs arguments.
The 1st argument within brackets is the name of a function, ‘trackEvent’.
The 3rd is obvious. You can also put in anotherone with argument ‘Duration’ to get a record of how long the file played.
The 2nd and 4th is a problem for me. What is ‘Documentary’ and ‘Thrive’ in this case?
Before we learned that we intend to track click ‘on the Play button of the Documentary Thrive’. I can’t see any logic how those two words is related to two different arguments in a function? So my trying-out stops here.
The next task would be to somewhere in HTML connect to the declatation. You already know the HTML at the players from the ‘audio-controls’ tag. The player of the two videos has a iframe-tag with URL from src=. Even if I did get the arguments right to start with I don’t know how to implement them at the players. Somehow I have to use uniqe ID’s at the different files so the stats can report what files was played.
Sorry. Couldn’t say this with a few words. Hope it’s understandable at all 