Welcome to WebmasterWorld Guest from 34.228.30.69

Forum Moderators: DixonJones & mademetop

Message Too Old, No Replies

Need to find a way to track .mp3 requests from server

How can I integrate a server level request into Google Analytics?

     
10:52 pm on Mar 10, 2017 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Jan 1, 2002
posts:1018
votes: 2


I am looking for a way to use Google Analytics provide me a report of .mp3 requests from the server.

I think it can be done, but I'm not sure how to do it.

The problem is that we send a feed to iTunes, TuneIn, etc...and Google Analytics (GA) doesn't track those file requests.

At the moment, the amount of requests is fairly small (1000 or less daily requests), so I'm wondering if there is a 'trick' to using .htaccess (or something similar) and rewrite a request so is triggers an 'event' that GA WOULD be able to track?

Is something like that possible? Or is there a much simpler way that I'm overlooking?

I'd prefer the results would show in GA, (even more preferable if they were separated out so we can see what shows are more popular than others.)

But if this isn't possible with GA, then what would be a good workaround?

Some details:
Shared hosting
Linux server
No cPanel
Webalizer won't work for this (tried it - unless it isn't set up properly)
I have no idea how to set up something like AWSats, although if someone could help with that, that might work.

I imagine that other 'podcasters' out there might be experiencing the same issues, so I thought I'd ask here so it would help them also.
Thanks!
2:33 am on Mar 11, 2017 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:15304
votes: 703


Or is there a much simpler way that I'm overlooking?
Can we assume you've intentionally chosen not to get the information directly from server access logs?

Does “no cPanel” mean your host uses something different (mine, for instance, is big enough to roll their own control panel), or that you simply don’t have much control over / access to the site? You did mention htaccess, so clearly you're not entirely helpless.
3:51 am on Mar 11, 2017 (gmt 0)

Moderator from US 

WebmasterWorld Administrator keyplyr is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Sept 26, 2001
posts:12913
votes: 891


There are a few scripts floating around in these forums. Although they're set-up to query for different targets, you could edit to make it work for your needs. Just do a few searches.

If you're not a coder, my suggestion is to manually download your daily raw server access log and run it through one of the stats programs that return a tally on file type requests.
1:24 am on Mar 12, 2017 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Jan 1, 2002
posts: 1018
votes: 2


We have access to the daily (not live) logs from the server.

I had an older program (FastStats/Mach5 Analyzer) that I would use to ftp into the server and parse the logs, but they went out of business, and I cannot find the original program on the web. I still have the 'key', but I can't find that old program. (Yes, the FREE version is still available, but I upgraded to the "gold" version, and THAT download is nowhere to be found...)

Keyplyr: I tried doing a search for some ideas, but I didn't find any in the forums here. Any ideas? (Links)
2:00 am on Mar 12, 2017 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:15304
votes: 703


You said 1000 or less per day. At that level you can even do it in a text editor: Just open the log file and ask it to find you all lines containing ".mp3". Some more fine-tuning, and you can separate the 200/304* responses from the 403 responses, and make sure nothing is out of whack.


* That's assuming mp3 counts as a static file and hence returns 304 if warranted.
2:19 am on Mar 12, 2017 (gmt 0)

Administrator

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Aug 10, 2004
posts:11465
votes: 174


may favorite tool for doing this (especially on an ad hoc basis) is the unix command line.
with grep, cut, sort, uniq, wc, and perhaps sed, you can construct a series of piped commands to give you almost any list or number you require from a log file analysis.
12:32 pm on Mar 12, 2017 (gmt 0)

Moderator from US 

WebmasterWorld Administrator keyplyr is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Sept 26, 2001
posts:12913
votes: 891


I had an older program (FastStats/Mach5 Analyzer) that I would use to ftp into the server and parse the logs, but they went out of business, and I cannot find the original program on the web
Try the Wayback Machine (Internet Archive.) I've found things like that there several times.
4:51 pm on Mar 12, 2017 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member tangor is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Nov 29, 2005
posts:8765
votes: 704


Another method is to inject the raw logs into a database and use database tools to obtain the reporting desired. Has a second benefit of collecting and maintaining historical periods of data compared to other methods.