hello great community,

i hope my question is clear .... i use banner rotator for my site but i want to see which banner get better ctr (click through rate) . also to not confuse the vistor with the other links i would need to hide the <a href target>

i tried to embed piwik code but i haven't received any statics

here the current rotator code

var images = [],
index = 0;

images[0] = "<a href = 'http://' target='_blank'><img src='http://' alt='link1'></a>";
images[1] = "<a href = 'http://' target='_blank'><img src='http://' alt='link2'></a>";
images[2] = "<a href = 'http://' target='_blank'><img src='http://' alt='link3'></a>";

index = Math.floor(Math.random() * images.length);
document.write(images[index]);

thank u

Such a bad idea. Hiding the destination would put me on alert the site has something to hide or is trying to take me to a very bad place.

My advice is to not spend time on such and apply work to make your site the best it can be.

commented: Echo this +15

there is nothing fishy here ....my idea is same like flash banners when they hide the destination it's help the overall rendering of site but also make it more desirable to click .

i hope someone with experience to help me with the code not doubt in my intention.

Then look at the HTML source. That is the language. Nothing there seems to tell the browser to hide the destination.

As to script, you write that. The basic idea is to respond to the image click and then move on. Some folk want others to write their code but here I rarely see that. Ideas on how, yes.

As to folk questioning your intent, that will happen. It's just shady programming. No reason to hide such and you may get less hits if you do this.

i did not write this script . please if you are not willing to help at least give others a chance to help me than minimizing my thread.

thank you

I did help. I noted it does not look to be in HTML so you get to write some javascript.

Now I would be guessing you want folk here to write your code for you. So far I don't see that a lot. I see you are asked to try writing it or sometimes folks will point a way out of the forest. I did that by mentioning writing a javascript to fill in where HTML stopped. That's helping.

If I wrote that for you I would not be helping you. I'd be doing your work for you.

Member Avatar for diafol

@mario. Hiding destination is not good imo. Especially spawning a new tab or window. I think that.s what porn sites do. Why don.t you just add a id token to the url to let the target page know which image was clicked?

If I understood what you are asking there is a really simply solution , each banner link has an id at least (you could do it with with linkIds that wouldn't reveal internal structure to anyone but I will not go as far). So it is simple to have lets say a div with that id as data to that id lets' call it banner-id or data-bannerId, each time someone clicks on that an AJAX call will be made , you will add one more click to that id and send back the url. The JS side will take the URL and forward the visitor to that. This is the simplest old way (even before AJAX) and somehow a naïve one. But start with that and when you feel that you are ready to provide more complex solutions try googling some of those.

There are many reasons why someone might not want to have a direct link. Those have nothing to do with SEO in this matter because Google bots are getting smarter , and can recognize this indirect way of linking. This has to do with other aspects of marketing

@ diafol thanks for the tip
@ AleMonteiro tnx a lot for the help .. i will check out your soultion ;)

jkon yes it's very simple this why i asked , anyway your explanation is great i will search that.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.