I am trying to add and the Google Analytics "onclick" tracking to the TinyMCE. I want this to be part of the link list and post to the HTML when a person adds text the text field of the TinyMCE tracking name.
I have included and image. I have the form property in the TinyMCE. I just need to get the value to show up along with the Google Tracking script.
You can't add it using the link editor in the RTE...
But I guess it might is possible to add it using the "HTML" view instead...but I think there might is a risk that tidy strips it. If it does then you maybe want to disable it in the umbracoSettings.config.
Did not see the extra field on the image untill now...don't know how to make sure the stuff entered in there gets written to the HTML...is this an extension you have made yourself or am I missing something? :-)
Actually in the "umbraco/plugins/tinymce3/insertLink.aspx", all I did was add another ui:PropertyPanel with an input field in that named "trackingName". I was just trying to get it to work and just show up in the HTML as a test.
I can't actually get that property to show up in the HTML. I tried adding setFormValue('trackingName', returnValues[3]); to the dialogHandler function in the Javascript at the top of the insertLink.aspx to see if that would actually plug it into the HTML.
But I have a feeling I am missing part of what I need to do to plug it in as an HTML element in the HTML.
I even tried adding the "setFormValue('onclick', inst.dom.getAttrib(elm, 'onclick'));" in the "umbraco_client/tinymce3/plugins/js/advlinks.js" in the if(action =="update"){} to see if that would work as well. This is included in the "umbraco/plugins/tinymce3/insertLink.aspx" as an include at the top of the .aspx.
I don't want to use HTML mode, because our editors are not HTML savvy. So easiest thing I thought would be to have them enter a name or title in the field and just spit out the onclick as a string in the HTML and have their name/title the added to the field show up into it.
It is a javascript thing, I am pretty sure of that. I looked at the TinyMCE documentation and their is nothing that really says anything adding your own stuff to a link within the Javascript to make it show in the HTML.
The reason I am doing this is because Google Analytics doesn't track file links too well. Just page to page/ url to url links.
It is not tracking any clicks for PDFs or downloads of documents our editors put in.
This really should not be that hard, but I am missing something somewhere.
TinyMCE add property to link
How do I add a link property to the link pop up?
I am trying to add and the Google Analytics "onclick" tracking to the TinyMCE. I want this to be part of the link list and post to the HTML when a person adds text the text field of the TinyMCE tracking name.
I have included and image. I have the form property in the TinyMCE. I just need to get the value to show up along with the Google Tracking script.
onClick="javascript: pageTracker._trackPageview('/CustomNameGoesHere');"
How would I do this. Any help would be greatly appreciated.
Thanks
Hi Carlos
You can't add it using the link editor in the RTE...
But I guess it might is possible to add it using the "HTML" view instead...but I think there might is a risk that tidy strips it. If it does then you maybe want to disable it in the umbracoSettings.config.
Hope this helps.
/Jan
Hi Carlos
Did not see the extra field on the image untill now...don't know how to make sure the stuff entered in there gets written to the HTML...is this an extension you have made yourself or am I missing something? :-)
/Jan
Jan,
Actually in the "umbraco/plugins/tinymce3/insertLink.aspx", all I did was add another ui:PropertyPanel with an input field in that named "trackingName". I was just trying to get it to work and just show up in the HTML as a test.
I can't actually get that property to show up in the HTML. I tried adding setFormValue('trackingName', returnValues[3]); to the dialogHandler function in the Javascript at the top of the insertLink.aspx to see if that would actually plug it into the HTML.
But I have a feeling I am missing part of what I need to do to plug it in as an HTML element in the HTML.
I even tried adding the "setFormValue('onclick', inst.dom.getAttrib(elm, 'onclick'));" in the "umbraco_client/tinymce3/plugins/js/advlinks.js" in the if(action =="update"){} to see if that would work as well. This is included in the "umbraco/plugins/tinymce3/insertLink.aspx" as an include at the top of the .aspx.
I don't want to use HTML mode, because our editors are not HTML savvy. So easiest thing I thought would be to have them enter a name or title in the field and just spit out the onclick as a string in the HTML and have their name/title the added to the field show up into it.
It is a javascript thing, I am pretty sure of that. I looked at the TinyMCE documentation and their is nothing that really says anything adding your own stuff to a link within the Javascript to make it show in the HTML.
The reason I am doing this is because Google Analytics doesn't track file links too well. Just page to page/ url to url links.
It is not tracking any clicks for PDFs or downloads of documents our editors put in.
This really should not be that hard, but I am missing something somewhere.
Thanks.
No response or answer to this. Please close this question.
Thanks,
is working on a reply...