
Google Analytics uses a strange link text to track page hits, and opening of documents (such as pdfs). I am working on a custom CMS for a client, and they need WYSIWIG capability to maintain the analytics code. Here is the code to track those links:
<a href="directory/document.pdf" target="_blank" onClick="javascript: pageTracker._trackPageview('/directory/document.pdf');">link to pdf</a>
I have gone into the files of FCKEditor and have figured out how to add the ability to write the "onclick" function into the link. That took a bit of digging, but was not terribly difficult (even for a non- javascripter). I have been able to write the attribute into the link from the form, checked the source code, and it appears properly. The problem arises when I try to go back to edit the link with the link interface, the "onclick" field that I created in the form does not recall the the information I added. It pulls up "null" or the equivalent. If you save the changes in the link interface and view the source again, it then adds a second "onclick" attribute into the link, with "null" as the property.
I worked on the files: fck_link.html (to change the form that submits the link properties) and fck_link.js (that processes the form), and en.js (the language file). It seems to me that copying the syntax of, say, the "title" attribute should get the "onclick" to recall the information ascribed to it. In the fck_link.js file, I added lines to the "GetE(' ').value" section, and the "SetAttribute ()" section. Of course, I had to be careful about the "onclick" attribute that is set by the popup target, also. Infact, I commented out all the popup scripting. Maybe I am missing something in another file? ... some connecting code that is not apparent?
Does anyone have any ideas on how to get the form to recall the data that is entered?
Thanks!