Using Google Tag Manager (GTM) to record C5 download events

Permalink
When I link to a file in the file manager, a link like this is created in the HTML:

http://www.mydomain.xyz/download_file/view/123/456...

This results in an HTTP 302 (Found) that allows the client to download the target file.

Before using Concrete5, I would link directly to the target file and GTM would be able to access the click URL on the page which would enable me to create an Event whose label was the download file name.

With Concrete5, I can't see how GTM can acquire this information, unless I override download_file so that it serves an intermediate web page (that could quickly to a meta refresh). Has anyone any further experience of this scenario?

Thanks
Chris

b3rimbau
 
mnakalay replied on at Permalink Reply
mnakalay
My experience with GTM is limited but shouldn't be able to use any attribute through javascript to serve as name? The title or alt attribute for instance? I believe one of those 2 contains the real file name and probably concrete5 file title attribute.

I might be wrong though
b3rimbau replied on at Permalink Reply
b3rimbau
Hi Nour - that's a good idea - thanks. I think links added by the rich text editor don't include attributes by default (apart from href) but I expect that behaviour could be overridden, much like added images will have an alt attribute that is the file's title.
mnakalay replied on at Permalink Reply
mnakalay
yes you're right it doesn't even add a title attribute which really sucks in my opinion. You can add it manually in the html though, from the editor