Forum Moderators: DixonJones

Message Too Old, No Replies

Please Help! Not Able to Track PDF/Doc Downloads

         

mj342

6:19 am on Nov 24, 2014 (gmt 0)

10+ Year Member



Hello Everybody,

Good Morning.

I have a query regarding Google Analytics Goals Setup for Pdf/Doc downloads from product pages at my website.

The website has various products under inventory section where some PDF and DOC files are also provided for free downloading detailing the specifications for individual products.

The path for the PDF/DOC files look something like:

http://attachments.example.com/4205/CAT3512%2024Z06694%201105KW%20Gset.doc
http://attachments.example.com/11631/XQ1000%20Spec%20Sheet.pdf

I've come up with a regular expression to track all such downloads which looks like:
/[0-9]+/([A-Za-z0-9-% ]+)\.[(pdf)(doc)]
OR
attachments.example.com/[0-9]+/([A-Za-z0-9-% ]+)\.[(pdf)(doc)]

I've tested the regular expression via [analyticsmarket.com...] and its matching the files URLs I'm trying to download.

Still, the expression is not tracking any downloads under Analytics. I've tried both variations, i.e.
/[0-9]+/([A-Za-z0-9-% ]+)\.[(pdf)(doc)]
OR
attachments.example.com/[0-9]+/([A-Za-z0-9-% ]+)\.[(pdf)(doc)]

Attached image shows how the Goal is currently setup under Analytics.

Can anyone advise please on what I'm doing wrong?

[PS. Not sure how to attach an image]


Thanks in Advance!

RhinoFish

6:51 pm on Nov 24, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



+There's a reporting delay, hope you waited a bit.

+Without attachment, a little blind here. :-)

+When they land on that URL, it relies on the "page" to load the Analytics script, but these aren't pages, they are pdf and doc files. Are you waiting for a script to fire from these URLs? Where is the script located?

+So I assume you're using the outbound click to the file as a proxy for viewing it instead, via this technique:
[support.google.com...]
Correct?

lucy24

10:11 pm on Nov 24, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



\.[(pdf)(doc)]

Is this GA syntax? It sure as heck wouldn't work as a vanilla Regular Expression. (Wouldn't work as intended, that is.)

Doesn't GA have a setting where you can flag certain extensions as downloads and always track them that way?

mj342

6:31 am on Nov 27, 2014 (gmt 0)

10+ Year Member



@RhinoFish - Thanks for taking your time to analyze it

Highly appreciated.

+There's a reporting delay, hope you waited a bit.
Yeah waited a lot.. say 2 weeks

+Without attachment, a little blind here. :-)
Tried to get results with both variations (with attachment & without attachment too)

+When they land on that URL, it relies on the "page" to load the Analytics script, but these aren't pages, they are pdf and doc files. Are you waiting for a script to fire from these URLs? Where is the script located?
I guess this can be the issue. PDF and DOC can not have scripts.

Can you please suggest for any alternative way where I can track all those PDF and DOC files using some type of similar goal setup. I mean the PDF/DOC files I am talking of here follow same type of URL and there are about hundreds of such files. So I just don't want to setup event tracking for all files individually. It would take a lot of effort plus a lot of new PDFs/DOCs are to be added on regular basis.

Hope you can provide some solution to track all similar type of PDFs with minimal efforts and much of hard coding for each file?

mj342

6:37 am on Nov 27, 2014 (gmt 0)

10+ Year Member



@Lucy24 - Thanks for analyzing it.

Is this GA syntax? It sure as heck wouldn't work as a vanilla Regular Expression. (Wouldn't work as intended, that is.)
Well there might be some kind of issue with the regular expression as I am kind of new in this. However, I have verified the regular expression using - [analyticsmarket.com...] which matched it with associated document URL to be download.

Doesn't GA have a setting where you can flag certain extensions as downloads and always track them that way?
Never heard of this option. Can you please explore it a bit or refer some link to read about it.
Moreover, is it going to solve my problem of tracking around hundreds of similar type of documents downloads by minimal setup and hard coding.

RhinoFish

9:41 pm on Nov 28, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You might be able to do this programmatically on your back end, using redirects (and a database).

If changing (or redirecting) the link to track the download click event doesn't work well, see the second option presented in the help file I linked above, the virtual page view method.

Either way, sounds like your inventory of existing files, and regular additions to come, means you don't want to do this manually. Chat with your programmer.

lucy24

10:20 pm on Nov 28, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Doesn't GA have a setting where you can flag certain extensions as downloads and always track them that way?

Never heard of this option.

Disclaimer: I don't use GA. I'm working on the assumption that anything {small-budget third-party program} can do, can surely be done by the vast resources of G### ;)