Rich-text Reply

Reusing click goal on inserted button

Ed 01-16-15
Accepted Solution

Reusing click goal on inserted button

Hey I have inserted some buttons as images using the editor and I noticed you cannot create a click goal for these using the button top right as the new element does not display in the preview. So instead I added a click goal directly from the image which is fine, except that you cannot assign this goal to other images (for example, if I wish to change the call to action by inserting a different button as an image). This means the goal list becomes unnecessarily confusing and bloated as you have to create new goals for every single variation of a button on different experiements. Is there an easier way to do this?

Ed
Level 2

Amanda 01-16-15
 

Re: Reusing click goal on inserted button

[ Edited ]

Great question! To do this, you actually just need to edit the goal manually. When you select a goal to be tracked, the elements CSS selector is populated in the 

 

To select more than one element, just add a comma and then add the other selectors for the other images. See the attached screenshot below for an example. In this example, you can imagine that the images have IDs #image1, #image2, and #image3

 

An alternative, would be to open up the "Edit Code" section and make sure that each of the images have the same ID so you can track them across the board. 

 

Also, if you are familalr with selectors, you can create on selector to populate in the goal that encompasses all the images at once. Here's a great article http://api.jquery.com/attribute-contains-selector/. So, if all the images you wanted to track were upload by Optimizely, you could use a selector like img[src*='cdn.optimizely.com/img']. 

 

Does this make sense? Let me know if you have questions! 

 

Screen Shot 2015-01-16 at 3.13.14 PM.png

 

 

Optimizely
Ed 01-22-15
 

Re: Reusing click goal on inserted button

Amanda this is super helpful and solved my question. Thanks so much for the help!
Ed
Level 2