Link tracking is not working for image tag in CQ 5.6 | Community
Skip to main content
sagaya_charlie
October 16, 2015
Solved

Link tracking is not working for image tag in CQ 5.6

  • October 16, 2015
  • 1 reply
  • 794 views

Hi,

I am not getting beacons for below image click tracking code,

<img   onclick="CQ_Analytics.record({event:'event',values:{ varName: 'varvalue'}, collect:  false, options: { obj: this }, componentPath: "<%=resource.getResourceType()%>"});" alt="${classname }" title="${classname}" src="${imagepath}"  /> 

The same is working if I use as below code,

<a  href="" onclick="record(['event'],{ varName: 'varvalue'},false,{obj:this},'<%=resource.getResourceType()%>');" class="${classname }">
                                                <img    alt="${classname }" title="${classname}" src="${imagepath}"  /> 
                                            </a>

other than anchor tag the above record function is not working. I can't enclose <a> to all other tracking tags (input, form.,etc).

Please help to resolve this issue.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Gigazelle

Do you have a test page you can publish for us to take a look? Troubleshooting implementation code is much easier and more effective when all the page resources are there.

1 reply

Gigazelle
Adobe Employee
GigazelleAdobe EmployeeAccepted solution
Adobe Employee
October 16, 2015

Do you have a test page you can publish for us to take a look? Troubleshooting implementation code is much easier and more effective when all the page resources are there.