Hi, I'm working on the following XSLT-file in Umbraco. What I want to achieve is to implement the Google Event Tracking code into an attribute. But, I don't know how this works exactly. What the Event Tracking does, is creating an 'onClick' feature, which
enables me to track the click on a to be downloaded document in Google Analytics.
This is the code I want the Event Tracking placed in:
NovaScotia82
Member
1 Points
3 Posts
Using Google Event Tracking in attributes
Jan 29, 2013 01:37 PM|LINK
Hi, I'm working on the following XSLT-file in Umbraco. What I want to achieve is to implement the Google Event Tracking code into an attribute. But, I don't know how this works exactly. What the Event Tracking does, is creating an 'onClick' feature, which enables me to track the click on a to be downloaded document in Google Analytics.
This is the code I want the Event Tracking placed in:
<a class="downloadbutton"> <xsl:attribute name="href"> <xsl:value-of select="downloadlink"/> </xsl:attribute> <xsl:attribute name="target"> _blank </xsl:attribute> <xsl:choose> <xsl:when test="directbuttontekst= ''"> Vrij downloaden </xsl:when> <xsl:otherwise> <xsl:value-of select="directbuttontekst"/> </xsl:otherwise> </xsl:choose> </a>And this is the code I'd like to add, but don't know how.
Is this possible, and if yes, do you have a suggestion on how to implement it in the <a> attributes?