简体   繁体   English

Drupal统计跟踪文件的点击

[英]Drupal statisitcs track file clicks

I have a Drupal website that has many smaple audio files on many pages. 我有一个Drupal网站,在许多页面上都有许多枫木音频文件。 Some users come, listen to a sample, or listen to all of them and then leave. 一些用户来,听样本或听所有样本然后离开。

But Google analytics does not track these clicks, even though in the option enabled: 但是,即使在启用的选项中,Google Analytics(分析)也不会跟踪这些点击:

Track downloads (clicks on file links) for the following extensions 7z|aac|arc|arj|asf|asx|avi|bin|csv|doc|exe|flv|gif|gz|gzip|hqx|jar|jpe?g|js|mp(2|3|4|e?g)|mov(ie)?|msi|msp|pdf|phps|png|ppt|qtm?|ra(m|r)?|sea|sit|tar|tgz|torrent|txt|wav|wma|wmv|wpd|xls|xml|z|zip 跟踪以下扩展名的下载(单击文件链接)7z | aac | arc | arj | asf | asx | avi | bin | csv | doc | exe | flv | gif | gz | gzip | hqx | jar | jpe?g | js | mp(2 | 3 | 4 | e?g)| mov(ie)?| msi | msp | pdf | phps | png | ppt | qtm?| ra(m | r)?| sea | sit | tar | tgz | torrent | txt | wav | wma | wmv | wpd | xls | xml | z | zip

Which includes the mp3 files that I'm playing. 其中包括我正在播放的mp3文件。

Then on Google Analytics in the Events section I can bearly see 3 mp3 downloads, and when I check my Apache log file, I have tens of clicks on mp3 files every day. 然后,在Google Analytics(分析)的“活动”部分中,我可以看到3个mp3下载,并且当我检查Apache日志文件时,每天都有数十次点击mp3文件。

I'm using the soundmanager2 player that works as a link and with the help of Javascrip, Flash and CSS plays the mp3 files. 我正在使用soundmanager2播放器作为链接,并在Javascrip,Flash和CSS的帮助下播放mp3文件。 http://www.schillmania.com/projects/soundmanager2/ http://www.schillmania.com/projects/soundmanager2/

How could I track these clicks on the soundmanager player? 如何在音效管理器播放器上追踪这些点击? If needed I can install another statistics module than google analytics... 如果需要,我可以安装除Google Analytics(分析)之外的其他统计模块...

Many thanks 非常感谢

Depending the display mode you use and the type of player, the tracking to integrate is different. 根据您使用的显示模式和播放器的类型,要集成的跟踪会有所不同。

Display Media 显示媒体

Here no custom tracking needs to be added. 在这里,无需添加自定义跟踪。 The Google Analytics Drupal module with Track download links enabled does the job. 启用了Track download links的Google Analytics(分析)Drupal模块可以完成此任务。

SoundManager player SoundManager播放器

If you use any of the available players, you need to add a custom javascript code and add a callback on the play event which is triggered on the first play of the SoundManager player(s). 如果使用任何可用的播放器,则需要添加自定义JavaScript代码,并在play事件上添加回调,该事件在SoundManager播放器的第一次播放中触发。

The javascript looks as follows: JavaScript如下所示:

// Add callback on play event
threeSixtyPlayer.events.play = function() { 
    var url = this.url, // retrieve URL for active played MP3
        file = url.substring(url.lastIndexOf('/')); // only keep filename of MP3

    // Push an event to GA
    _gaq.push(['_trackEvent', 'mp3', 'play', file.substring(1)]);
}

The event that is pushed to Google Analytics looks like this: 推送到Google Analytics(分析)的事件如下所示:

[mp3,play,Maid with the Flaxen Hair.mp3?uuid=525c67793bcd5]

Depending the used player, you should update and use to correct available instance. 根据所使用的播放器,您应该更新并使用它来更正可用实例。

SoundManager2 Page Player SoundManager2页面播放器

pagePlayer.events.play = function() { ...

SoundManager2 UI 360 SoundManager2 UI 360

threeSixtyPlayer.events.play = function() { ...

SoundManager2 Inline player SoundManager2内联播放器

inlinePlayer.events.play = function() { ...

SoundManager2 MP3 Basic player SoundManager2 MP3基本播放器

basicMP3Player.events.play = function() { ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM