Rich-text Reply

Work Around for Tracking Clicks in a Drop Down Nav-Bar

colinsurguine 12-05-14

Work Around for Tracking Clicks in a Drop Down Nav-Bar

Drop down Menus have the tendancy to not stay up in Optimizely when you try to hover over it. I edited a line of code for a link, and would like to track clicks to that link, but I can't hover over the element without the drop down menu disappearing.

 

Is there a work around to getting the clicks to that link tracked?

greg 12-05-14
 

Re: Work Around for Tracking Clicks in a Drop Down Nav-Bar

Yes. Instead of clicking on the element you want to track, use the selector field. When you're creating a click goal, click "Advanced" to view the "Selector" field. Then enter a selector for the link you want to track, such as:

#menu a[href~="signup.html"]

(This example will track clicks on any link inside #menu that contains "signup.html" in the target URL.)
Level 2
Amanda 12-05-14
 

Re: Work Around for Tracking Clicks in a Drop Down Nav-Bar

@greg is exactly right. 

 

Are you familiar with CSS selectors?  If not, feel free to post the URL and let us know which menu item you want to track and we can help you with the selector. 

 

Another trick that sometimes works is to hover over the menu item and use the keyboard shortcut (CTRL I) to toggle to interactive mode so the menu appears and then use the same shortcut to toggle back to editing mode where you can select the link and click "track clicks" from the editor. That way you won't have to move the mouse to toggle back and forth between modes and the menu stays put. Check out the Support article here for the keyboard shortcuts. 

Optimizely
MJBeisch 12-05-14
 

Re: Work Around for Tracking Clicks in a Drop Down Nav-Bar

[ Edited ]

Clicking on an element in the editor to set up a click tracking goal is really just a WYSIWYG shortcut to setting the goal up as Greg has described, anyway. Manually building a selector for a goal also allows you to do more complex tracking, if you're familiar with CSS/jQuery selectors. Instead of a 1-to-1 relationship between elements and goals, you can track multiple elements with a single goal.

For example, say you have dropdown navigation that is a mix of text links and image links. You could write a selector to track clicks on all the image links, and then a separate one to track text links. This would allow you to compare which gets more overall engagement. Maybe those product images are important from a marketing standpoint but not getting enough traction? Maybe they're an afterthought and thus not merchandised well, meaning they're taking up valuable nav real estate but performing poorly? Maybe those images get a huge clickthrough rate versus other elements and can be focused on more and built around? Should probably test that...

Matt Beischel - E-Commerce Optimization Specialist CohereOne

Level 2