I switched my site over to a caching system and now I'm having problems with my plugin that only showed ads to people coming from search engines (better quality clicks that way).
So I decided to search the internet for a javascript alternative and I found one, but I need a simple change made.
I need the script to add a cookie that expires after a certain amount of time. The cookie should make it so the visitor continues to see the ad for an hour or so after coming from the Search Engines.
I also want a version that only shows ads to non-search engine visitors.
I want the code that I put on my site to look like this:
<script type="text/javascript" src="/folder/[login to view URL]"></script>
<script type="text/javascript">myvisitor();</script>
Most of the work has already been done:
[login to view URL]
[login to view URL]
So it shouldn't take that long. I have examples below.
## Deliverables
-----------Change This Code:A1611------------------
URL: /folder/[login to view URL]
var ref = [login to view URL];
var sevisitor;
var SE = new Array('[login to view URL]', 'search.', '[login to view URL]', '[login to view URL]', '.yahoo.','/url','/search','.google.','.ask.','.baidu.','.bing.','.aol.','.answers.');
for ( var source in SE){
var match = [login to view URL](SE[source]);
if (match !=-1) {
sevisitor=true;
}
}
function myvisitor(){
if (sevisitor){
var large = 'You Are A Search Engine Visitor<br>';
[login to view URL](large);
}
}
-----------END CODE------------------
What I add to my page:
---code I add to my page----
<script type="text/javascript" src="/folder/[login to view URL]"></script>
<script type="text/javascript">myvisitor();</script>
---code I add to my page----
Is it possible to change that code that I "add to my page" into php so that the text is crawled by the search engines without changing "[login to view URL]"?
---Example Code That Sets Cookie---
<script type='text/javascript'>
//<![CDATA[
var ref = [login to view URL];
var se = new Array('/search?', 'images.google.', '[login to view URL]', 'search.', '[login to view URL]', '[login to view URL]', '/search/', '.yahoo.');
var sevisitor = false;
for (var i = 0; i <= se.length-1; i++) {
if ([login to view URL](se[i])!== -1) {
var expiry = new Date ();
[login to view URL]([login to view URL]() + 3600000);
[login to view URL] = "sevisitor=1; expires=" + expiry + "; path=/; domain=[login to view URL]";
sevisitor = true;
}
}
//]]>
</script>
---Example Code That Sets Cookie---
I want two versions of this script. One that shows ads to search engine visitors only and one that shows ads to visitors not coming from the search engines. Both of should add a cookie like the example shown.