Go Back   WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk
Register Blogs FAQ Social Groups CalendarHelp Desk

Reply
 
LinkBack Thread Tools
Old 03-12-2010, 04:39 PM   #1
Active Warrior
 
SetYourselfFreelance's Avatar
 
Join Date: Oct 2009
Posts: 36
Thanks: 3
Thanked 1 Time in 1 Post
Default Anyone know how to automate a promotion?

I'm looking for a way to automate a promotion.

I want to send a link to a page in an autoresponder with a special offer that is available for only 4 days.

But after 4 days, I don't want the promotion to be available to that user any more.

Does anyone know how to automate this? Can I set a cookie that expires 4 days after the user has first visited the page, and then gives them different page content that says the promotion is no longer available after 4 days?

I've seen these kinds of things before. How do people do this?

Anyone?

Thanks!
Elliott
SetYourselfFreelance is offline   Reply With Quote
Old 03-12-2010, 11:03 PM   #2
Advanced Warrior
War Room Member
 
Bruce Hearder's Avatar
 
Join Date: May 2004
Location: Perth, Australia.
Posts: 717
Thanks: 4
Thanked 182 Times in 138 Posts
Social Networking View Member's Twitter Profile  View Member's YouTube Profile
Contact Info
Send a message via Skype™ to Bruce Hearder
Default Re: Anyone know how to automate a promotion?

Hi Elliott,

The simpliest method would be the cookie method, though its not very secure, becuase all the user has to do is clear cookies on their browser and then they have access to that page again.

But if thats not a major problem then go the cookie mthod..

Some simple javascript placed on the landing page will do the job nicely..

Here's some JS that will do the job for you:

Place this code just before your page's </head> tag
Code:
<script type="text/javascript" language="javascript">
<!--
 var days_page_valid_for = 4;
 var exp = new Date();
 exp.setTime(exp.getTime() + (9999*24*60*60*1000));

 function getCookieVal (offset) 
 {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
   endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
 }
 
 function GetCookie (name) 
 {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) 
  {
   var j = i + alen;
   if (document.cookie.substring(i, j) == arg)
    return getCookieVal (j);
   i = document.cookie.indexOf(" ", i) + 1;
   if (i == 0) break;
  }
 return null;
 }
 
 function SetCookie (name, value) 
 {
  var argv = SetCookie.arguments;
  var argc = SetCookie.arguments.length;
  var expires = (argc > 2) ? argv[2] : null;
  var path = (argc > 3) ? argv[3] : null;
  var domain = (argc > 4) ? argv[4] : null;
  var secure = (argc > 5) ? argv[5] : false;
  document.cookie = name + "=" + escape (value) +
  ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
  ((path == null) ? "" : ("; path=" + path)) +
  ((domain == null) ? "" : ("; domain=" + domain)) +
  ((secure == true) ? "; secure" : "");
 }
 
 function DeleteCookie (name) 
 {
  var exp = new Date();
  exp.setTime (exp.getTime() - 1);
  var cval = GetCookie (name);
  document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString(); 
 }
-->
</script>
Now place this code, directly after your pages </body> tage

Code:
<script type="text/javascript" language="javascript">
 var thecookie = GetCookie('beenhere');
 var today=new Date(); 
 if (thecookie != null) 
 {
  //Set 1 day in milliseconds
  var one_day=1000*60*60*24;
  var ct = thecookie;
  var tt = today.getTime();
  
  var diff = Math.ceil((tt-ct)/one_day);
  
  if (diff > days_page_valid_for)
  {
   location.href = "http://www.google.com"; 
  }
  else
  {
   SetCookie('beenhere', today.getTime(), exp); 
  } 
 }
 else
 {
   SetCookie('beenhere', today.getTime(), exp);   
 }  
</script>
Change the line of code that reads :

var days_page_valid_for = 4;

To how long you want the page to remain valid for.

Change the line of code that reads :

http://www.google.com

and replace with the full location of the page you want to redirect the visitor to, when the page has expired..


I hope this helps
Bruce

-----------------
Get Your Backlinks indexed quicker at BackLinks2RSS

Create Full Text Feeds from Partial RSS Feeds at FeedExpander.com. See the WarriorForum post about it here
Bruce Hearder is offline   Reply With Quote
Old 03-13-2010, 10:15 PM   #3
Active Warrior
 
SetYourselfFreelance's Avatar
 
Join Date: Oct 2009
Posts: 36
Thanks: 3
Thanked 1 Time in 1 Post
Default Re: Anyone know how to automate a promotion?

Thanks for that, Bruce.. I'm playing around with this code right now.

Does anyone have any idea what internet marketers usually use when they send out email promos through automated systems that give you a certain period of time to purchase a product? Is it something like this? Or is there something else more automated that I can plug and play.

I want to automate a promotion through my email auto-responders.. Surely this is something that people are doing....no?
SetYourselfFreelance is offline   Reply With Quote
Old 03-15-2010, 06:49 AM   #4
WebNinja
 
jminkler's Avatar
 
Join Date: Mar 2010
Location: Atlanta GA
Posts: 410
Thanks: 17
Thanked 50 Times in 31 Posts
Social Networking View Member's FaceBook Profile  View Member's Twitter Profile 
Contact Info
Send a message via AIM to jminkler Send a message via Skype™ to jminkler
Default Re: Anyone know how to automate a promotion?

Quote:
Originally Posted by SetYourselfFreelance View Post
Thanks for that, Bruce.. I'm playing around with this code right now.

Does anyone have any idea what internet marketers usually use when they send out email promos through automated systems that give you a certain period of time to purchase a product? Is it something like this? Or is there something else more automated that I can plug and play.

I want to automate a promotion through my email auto-responders.. Surely this is something that people are doing....no?
If you use a CMS there is usually a Exipres date for the content.
jminkler is offline   Reply With Quote
Old 03-17-2010, 01:09 AM   #5
Warrior Member
 
Join Date: Mar 2010
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: Anyone know how to automate a promotion?

I thought you are looking for promotion strategies... i was wrong...

lyn_lee05 is offline   Reply With Quote
Reply

  WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk

Tags
automate, promotion

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -6. The time now is 10:03 PM.