Find Jobs
Hire Freelancers

Add Cookie To My Search Engine Only Script

$25-30 USD

Cancelled
Posted over 12 years ago

$25-30 USD

Paid on delivery
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.
Project ID: 3593271

About the project

Remote project
Active 12 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs

About the client

Flag of UNITED STATES
Saint Louis, United States
5.0
104
Member since Jan 7, 2008

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.