Tracking custom image links on WordPress website by Google Analytics -
i developed wordpress website give option admin upload image , give link shown advertisement in front end. basically, image clickable , links link provided admin.
what want track clicks on these advertisements via google analytics. possible? new google analytics , not have idea.
(function ($) { $(document).ready(function() { // attach onclick event document , catch clicks on elements. $(document.body).click(function(event) { // catch closest surrounding link of clicked element. $(event.target).closest("a,area").each(function() { _gaq.push(['_trackevent', 'image click', $('img', this).attr('alt'), $(this).attr('href')]); }); }); }); })(jquery);
yeah possible can track image click via google analytics see reference more info. http://techatitsbest.com/blog/image-click-tracking-google-analytics-events
http://www.seotakeaways.com/event-tracking-guide-google-analytics-simplified-version/
Comments
Post a Comment