Affiliate Marketing
Forum Search

Reply
 
LinkBack Thread Tools Display Modes

  #1 (permalink)  
Old 23-04-08
KirstyM's Avatar
Super Member
 
Join Date: Nov 2004
Location: On World Tour!
Posts: 1,131
Thanks: 0
Thanked 0 Times in 0 Posts
KirstyM seems to know their stuff
  Passing Keyword Data Thru php Redirect Links?

Hello,

I've been curious about this one for a while. I used to used a php echo on my PPC landing pages to pass keyword data from the URL into the clickreference field of an affiliate link.

However, now that a lot of people are using php links to mask their affiliate urls I was wondering how you could still record keyword data by passing variables through your masked urls? I'm assuming this is relatively straightforward if you've a knowledge of php!
__________________
Come Read My Affiliate Marketing Blog.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 23-04-08
Registered User
 
Join Date: Jul 2005
Location: Northamptonshire
Posts: 571
Thanks: 0
Thanked 2 Times in 2 Posts
futureweb is an unknown quantity at this point
  Re: Passing Keyword Data Thru php Redirect Links?

PHP Code:
// Session to store your keyword
session_start();
session_register('keyword');

if(
preg_match('/google|yahoo|msn|altavista/i'$parts['host']) && !empty($parts['query'])) {
}
$referer_query '';


$referer_params = array('q','query','p','Q','Query','P');

if(!empty(
$_SERVER['HTTP_REFERER'])) {
   
$parts parse_url($_SERVER['HTTP_REFERER']);
   if(!empty(
$parts['query'])) {
       
parse_str($parts['query'], $query_params);
       foreach(
$referer_params as $key) {
          if(isset(
$query_params[$key])) {
              
$referer_query $query_params[$key];
              break;
          }
       }
   }
}


if(!empty(
$referer_query)) {
$_SESSION['keyword'] = urlencode($referer_query);
}else{
// theres no keyword Bookmark?
$_SESSION['keyword'] = 'NULL';

You can then carry this over to your links page and call the session var

PHP Code:
// Links page

// Don't forget this
session_start();

// link example
 
$link mysql_query("select link from tablename where id = '".$_GET['id']."'");
    
$l=mysql_fetch_assoc($link);
header('Location: '.$link.'&epi='.$_SESSION['keyword']);
exit(); 
__________________
Mobile Phones
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
php scripts to display data from MySql accelerator Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 3 03-01-06 02:26 AM
The Good Feed Guide (For Merchants) clint45 Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 13 17-11-05 08:30 PM
mysql / php / insert data into many tables morleymouse Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 9 05-01-05 03:46 PM
data feeds with php Peter Skellen Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 1 09-10-03 08:45 PM


Affiliate Marketing RSS Feeds - Contact Us - Affiliate Marketing - Archive - Privacy Statement - Top

Content Relevant URLs by vBSEO 3.2.0 RC7