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?
Solved! Go to Solution.
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!