0

I am trying to create a goal in optimizly.

I have a product page product.php where someone selects a product via a radio button. That POSTS the data to the cart page. There are 3 variations plus the original one so 4 variations in total.

The data is posted something like below

cart.php?id=277

There's just 3 id's so lets say the ids are 277,278 and 279

Now i have created the variations without issue. I now want to setup a goal on the cart.php, the goals will be:

Product 277 added to cart
Product 278 added to cart
Product 279 added to cart

But essentially there will be 12 goals because there will be:

Product 277 added to cart via original Product 277 added to cart via variation 1 Product 277 added to cart via variation 2 Product 277 added to cart via variation 3

Is there a way to do this with the custom goal or is it only possible via the API? I found the documentation on their site a bit confusing and couldn't find anything specifically related to this, been waiting a few days for a reply from their support with no reply.

user1547410
  • 863
  • 7
  • 27
  • 58

1 Answers1

1

You should actually just code 3 goals (one for each product) or even a single goal ('add to cart clicks') and then do the pivoting in the reporting section where it will break everything out by variation (see screenshot).

That said, optimizely.variationNamesMap[1234567890] where 1234567890 is the experiment ID (pull from the querystring on the edit page) will allow you to access your variation names in the code.

Shows how you pivot by variation

TomFuertes
  • 7,150
  • 5
  • 35
  • 49
  • Thanks so much for trying to help. Im pretty much brand new to optimizely so i was hoping you could go into a bit more detail as im not sure exactly how to apply this. On my product page when i run the page and type: alert(optimizely.variationNamesMap[0123456789]); in the browser console (where i replaced 012... with the experiment id) and it comes back as undefined) – user1547410 Dec 08 '14 at 16:24
  • You have to actually be bucketed into a variation for that experiment. Check out the Optimizely QA Article on setting a test cookie and then push your experiment live. It should work once you're bucketed. – TomFuertes Dec 13 '14 at 21:26