I've been experimenting with this technique and testing what happens when there's an extra link or two along with the "Back to Top" link. I've had some affiliate sales that I can trace to the extra links so now I'm testing a little script to random-rotate a couple of links.
For three text links in a narrow bar across the top of the page, I put this near the bottom of my <body>:
<ul id="ToTop">
<li><a href="
http://example.com/affiliate0/" target="_blank">Goodies</a></li>
<li id="demo"></li>
<li><a href="#">Back to Top ⇧</a></li></ul>
<script>
if (Math.random() < 0.5) {
text = "<a href='
http://example.com/affiliate1/'>Treasures</a>";
} else {
text = "<a href='
http://example.com/affiliate2/'>Cool Stuff</a>";
}
document.getElementById("demo").innerHTML = text;
</script>
In my CSS:
ul#ToTop {position:fixed;top:0;z-index:5;background:#fff;display:block;text-align:center; width:100%;border-bottom:1px #7ab9bc solid;padding:0; margin:0:}
#ToTop li {display: inline-block;padding:0; margin:0s;width:32%;}
#ToTop li a {display:block;width:100%;}
#ToTop li a:hover {background-color: #eee;)
I also gave the masthead div a higher z-index number than it had before.
Fun stuff!