Expand my Community achievements bar.

SOLVED

Link tracking is not working for image tag in CQ 5.6

Avatar

Level 1

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.

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

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.

View solution in original post

1 Reply

Avatar

Correct answer by
Employee Advisor

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.