Rich-text Reply

Removing hyperlinks

trangm 07-18-14
Accepted Solution

Removing hyperlinks

Hey everyone! I'm getting a high abandonment rate in my funnel at a certain step. There are a handful of links on that step that I want to turn off as a variation but regardless of whether I edit hyperlink or edit HTML, the link still remains. Has anyone else experienced this? Is there a workaround?

 

Cheers,

Trang

Level 2

MartijnSch 07-21-14
 

Re: Removing hyperlinks

Hi Trang,

Could you post the current code for this variation, you can find it in the right bottom corner of the edit screen of your test. It should just work without a problem and also shouldn't involve a work around.
adzeds 07-21-14
 

Re: Removing hyperlinks

This should be a pretty simple change so am not sure what would stop it working. If you post up the code someone should be able to solve the issue.
David Shaw
Level 11
trangm 07-21-14
 

Re: Removing hyperlinks

I think I might be having issues because the pages on my conversion funnel are dynamically generated. Links on the page I want to test could or could not be there depending on the user's input on the previous steps. It's a wizard-based funnel if that helps.

 

$(".first .outdoor > div:eq(1) > a:eq(0)").attr({"href":""});
$(".first .indoor > div:eq(1) > a:eq(0)").attr({"href":""});
$(".mid .outdoor > div:eq(1) > a:eq(0)").attr({"href":""});
$(".mid .indoor > div:eq(1) > a:eq(0)").attr({"href":""});
$(".last .outdoor > div:eq(1) > a:eq(0)").attr({"href":""});
$(".last .indoor > div:eq(1) > a:eq(0)").attr({"href":""});
$("#first_features > li:eq(0) > a:eq(0)").attr({"href":""});
$("#first_features > li:eq(1) > a:eq(0)").attr({"href":""});
$("#mid_features > li:eq(0) > a:eq(0)").attr({"href":""});
$("#mid_features > li:eq(1) > a:eq(0)").attr({"href":""});
$("#last_features > li:eq(0) > a:eq(0)").attr({"href":""});
$("#last_features > li:eq(1) > a:eq(0)").attr({"href":""});

 

cheers,

Trang

ss-optimizely.png
Level 2
MartijnSch 07-22-14
 

Re: Removing hyperlinks

Hi,

 

Could you give this code snippet a try?

 

$(".first .outdoor > div:eq(1) > a:eq(0),.first .indoor > div:eq(1) > a:eq(0),.mid .outdoor > div:eq(1) > a:eq(0),.mid .indoor > div:eq(1) > a:eq(0),.last .outdoor > div:eq(1) > a:eq(0),.last .indoor > div:eq(1) > a:eq(0),#first_features > li:eq(0) > a:eq(0),#first_features > li:eq(1) > a:eq(0),#mid_features > li:eq(0) > a:eq(0),#mid_features > li:eq(1) > a:eq(0),#last_features > li:eq(0) > a:eq(0),#last_features > li:eq(1) > a:eq(0)").each(function(){
  $(this).replaceWith($(this).text());
});

 What it does is for every element that you've selected replace the link itself with the text that was in the link. What you've done before is remove the HREF element in the <a> tag but that will still leave the style of a link.

Hope this helps!

adzeds 07-22-14
 

Re: Removing hyperlinks

Yup. The solution from @MartijnSch is a better implementation than what you were looking to do before. Had a quick scan and it should work without any changes required.
David Shaw
Level 11
trangm 07-22-14
 

Re: Removing hyperlinks

Thanks @MartijnSch That worked!

Level 2