Rich-text Reply

Trouble tracking goal in A/B test for a single change

Linnea 08-03-15
Accepted Solution

Trouble tracking goal in A/B test for a single change

I want to try to change the position of a link from a lower position on the webpage to a higher. My thesis is that perhaps more people click on the link if its higher up. 

 

I have set up an A/B test, without two different URL's (is this wrong?) and istead just used variation1, with a tracked goal to the higher positioned link. 

 

Problem: I see the variation is up on the webpage when troubbleshooting, however my clicks arent being tracked since they arent visable in the results page. There is only the original page results. 

 

Question: Should I create an other kind of experiment? Should I use multitest instead of A/B? Should I specify different ulr's? (this seems to me a bit overkill since I have such a small change) 

 

Best,

Linnea

Level 2

JMarchant 08-03-15
 

Re: Trouble tracking goal in A/B test for a single change

Hi Linnea,

How have you built the test? Was it using the visual editor? If you've moved the link, then the selector may be different so the tracking may break. You could add some code into your Experiment Javascript that tracks all clicks to the specific URL:

/* _optimizely_evaluate=force */
var URL = 'http://www.example.com/path';
var event_name = 'clicks';

window['optimizely'] = window['optimizely'] || [];
$('a[href="'+url+'"]').live('mousedown', function(event) {
	window.optimizely.push(["trackEvent", event_name]);
});
/* _optimizely_evaluate=safe */

Just simply replace the variable 'URL' with the URL of the link, and the 'event_name' variable with the custom event name that you can retrieve from the edit window of your goal under 'ADVANCED':

Screen Shot 2015-08-03 at 11.27.35.png

If there are multiple links on the page with that URL, you may have to then update the 'Selector' that is shown in that screenshot. Can you possible send the link of the test?

James Marchant
Senior Developer at Conversion.com

 
Linnea 08-03-15
 

Re: Trouble tracking goal in A/B test for a single change

Screen Shot 2015-08-03 at 15.49.04.png

 

Now I have set this test up. 

We have more links attached to this page I believe two more links to this attribution page on the first page), so do I need to change anything in the "selector"?

 

I changed the javascript as suggested.

 

Best,

linnea

Level 2
JMarchant 08-03-15
 

Re: Trouble tracking goal in A/B test for a single change

Hi Linnea,

 

Do you want to track them in the same goal or seperately? What are the URLs that you want to track? It might be best to actually remove the code I previously said to add, and then change the selector. So the selector field for the screenshot you posted would be like so:

a[href="http://www.example.com/path"]

replacing the URL to that of the link you want to track.

 

If you wanted all the links in one goal, then you could update the selector to:

a[href="http://www.example.com/path1"], a[href="http://www.example.com/path2"], a[href="http://www.example.com/path3"]

Replacing each URL with each of the link URLs you want to track.

 

Does that make sense?

James Marchant
Senior Developer at Conversion.com

 
Linnea 08-03-15
 

Re: Trouble tracking goal in A/B test for a single change

OK. Now Im a bit confused. 

 

My thesis is: 

If I move the link in the list from highest up to a lower position, it will ge fewer hits. 

 

So I ONLY want to track one text row, that includes this link. 

 

How can I do this? 

 

Level 2
JMarchant 08-03-15
 

Re: Trouble tracking goal in A/B test for a single change

Sorry, I misread your previous post: I thought you wanted to track other clicked links on the page. Looking at your screenshot, I would remove the code I previously posted and update the selector field with the following:

.home_main a[href="/attribution/"]

This should specifically track the link that you've moved and none of the other links on the page with the URL.

 

Let me know if that works.

James Marchant
Senior Developer at Conversion.com

 
Linnea 08-03-15
 

Re: Trouble tracking goal in A/B test for a single change

Thank you!
Will try this out!
Level 2
Linnea 08-03-15
 

Re: Trouble tracking goal in A/B test for a single change

So, I still dont get any data from my goal, eg. under variation1 in results page is= 0. However in original data is 2. But when I try troubbleshooting nothing appears wierd (see attached) 

 

 Do you have any clue what I might do different? 

 

Screen Shot 2015-08-03 at 16.23.54.png

Level 2
JMarchant 08-03-15
 

Re: Trouble tracking goal in A/B test for a single change

Hi Linnea,

 

The results make take a while to come through now you've updated it, but as quite rightly checked it is firing the event off correctly. The results page doesn't update in realtime so I would wait an hour to see if there has been any difference made.

James Marchant
Senior Developer at Conversion.com