Search code examples
tridiontemplating

Web Analytics and Content Reuse


We have created a button template where an editor can associate a web analytic tag with it. The issue is we would like to reuse this button component on the same page but still be able to differentiate where on the page it is coming from.

Has someone encountered this issue before? We're looking for some insight into the problem and perhaps some ways to solve this without modifying the template.

FYI, we are using Tridion 2009 SP1.

Thanks!

Updated with HTML

<a href ="/security.jsp" onClick="trackCustomLink('tttt:p:apply-now','Link','onClick');">
   <img src="/images/GICs/applynow-button.gif"  border="0" alt="Apply Now" /></a>

Solution

  • Assuming your button is rendered with a component template, it seems like you need to just use the Ordinal Position of the component on the page - Can you specify what kind of templates you are using (VBScript or Modular with DWT or C#)? Base on that we may be able to give you some code samples.

    Graham bird has a good article about OrdinalPosition with VBScript at: http://www.grahambird.co.uk/2011/01/ordinalposition/

    The idea behind this is that you add the ComponentPresentation.OrdinalPosition value to your analytics code.