Forum
Welcome, Guest
Please Login to access forum.
Re:Tracking pdf downloads (1 viewing) 
Go to bottom
TOPIC: Re:Tracking pdf downloads
#1814
Chris Matthews
Fresh Boarder
Posts: 4
User Offline
Tracking pdf downloads Karma: 0  
Hello,
I have just installed your software - and excited by the core functionality. It will help greatly in understanding our site's use (not a live site yet).

I am trying to follow your instructions for the Advanced feature of tracking a document download.

The document is stored in a sub-directory - and I think I need to update your example code (which describes from site root) My case is the document is at /images/Certifications/FS_546257.pdf

Could you please explain how I should modify the link example code after the .src?

Also - would I also need to update the src="" in the iframe code?

Thank you very much for your time,

---Chris
 
Logged Logged  
  The administrator has disabled public write access.
#1815
John Dagelmore
Admin
Posts: 3722
User Online Now
Re:Tracking pdf downloads Karma: 79  
Hello Chris,

i will try to explain you better

You need to add a custom onclick code to the link that point to the server document, in your case the link that holds

Code:

/images/Certifications/FS_546257.pdf
The src should be as in the example below, where the numeric ID value is the same of the event record created in the backend side, supposed to be named accordingly to the document to track,
Code:

onclick="document.getElementById('trackdownload').src='http://mysite.com/index.php? option=com_jrealtimeanalytics&track=1'"
The iframe src doesn't need any change, it must be empty as reported in the documentation example. The final code will look like this:
Code:

<a href="http://mysite.com/images/Certifications/FS_546257.pdf" onclick="document.getElementById('trackdownload').src='http://mysite.com/index.php? option=com_jrealtimeanalytics&track=1'">Download my document bla bla bla</a> <iframe id="trackdownload" style="display:none" src=""></iframe>
The src value of the link must be the same of that specified in the event details in the backend list for the field 'Set custom url'
Code:

http://mysite.com/index.php? option=com_jrealtimeanalytics&track=1
Sorry if it's sound a bit tricky However hope to have explained a bit better Kindest regards John
 
Logged Logged  
  The administrator has disabled public write access.
#1829
Chris Matthews
Fresh Boarder
Posts: 4
User Offline
Re:Tracking pdf downloads Karma: 0  
Hello John,
Thank you for your reply.

The code you present is what I had done (per your documentation) - although I notice when joomla renders there is one difference- introducing a slash in the iframe src:

Code:

<a href="http://wwwdev.thealliedgrp.com/images/Certifications/FS_546257.pdf" onclick="document.getElementById('trackdownload').src='/index.php? option=com_jrealtimeanalytics&track=1'">FS 546258</a><iframe id="trackdownload" style="display:none" src="/"></iframe>
Then in custom URL:
Code:

http://wwwdev.thealliedgrp.com/index.php?option=com_jrealtimeanalytics&track=1
With the code as above the event does not record. The site is currently offline - but I just put it online for a moment to test, to see if that was causing the issue. The event still is not recorded. Do you see something I am missing? Thank you again for your time! ---Chris
 
Logged Logged  
  The administrator has disabled public write access.
#1830
John Dagelmore
Admin
Posts: 3722
User Online Now
Re:Tracking pdf downloads Karma: 79  
Hello Chris,

looking at the code used maybe the problem could be the different path for the tracking url.

Instead of use this:
Code:

<a href="http://wwwdev.thealliedgrp.com/images/Certifications/FS_546257.pdf" onclick="document.getElementById('trackdownload').src='/index.php? option=com_jrealtimeanalytics&track=1'">FS 546258</a><iframe id="trackdownload" style="display:none" src="/"></iframe>
try to match exactly the domain and the same url set for the custom url of the event in backend:
Code:

<a href="http://wwwdev.thealliedgrp.com/images/Certifications/FS_546257.pdf" onclick="document.getElementById('trackdownload').src='http://wwwdev.thealliedgrp.com/index.php? option=com_jrealtimeanalytics&track=1'">FS 546258</a><iframe id="trackdownload" style="display:none" src="/"></iframe>
thus trying to set the 'src' attribute with the full site path:
Code:

http://wwwdev.thealliedgrp.com/index.php?option=com_jrealtimeanalytics&track=1
instead of
Code:

/index.php?option=com_jrealtimeanalytics&track=1
John
 
Logged Logged  
  The administrator has disabled public write access.
Go to top