Go Back   Webmaster Forums UK SEO SEM Webmaster Community Forum - UKWW > Web Design and Website Development > Programming > PHP Forum
Register FAQ Members List Downloads Calendar Today's Posts Webmaster Resources Webmaster Blogs
 
 

PHP Forum PHP related discussion, help, tips and tutorials.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-21-2008, 08:44 PM
ms4u's Avatar
Senior Member
116 posts this year. Executive spud!
We have not managed to scare them away..
Last months UKWW Tokens: 19
 
Join Date: Apr 2008
Posts: 110
Thanks: 0
Thanked 1 Time in 1 Post
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Default Session Variable

Hi,

I am planning to track my PPC campaign in both my Google Adword and Yahoo search. The traffic that direct over my site have the following URL:

Google:
HTML Code:
www.abc.com/?kw=keywords
Yahoo:
HTML Code:
www.abc.com/?OVRAW=keywords&OVKEY=keywords&...etc
What I want to do is, to code my landing to track those keywords coming through both search engine. I am planning to use SESSION to do the tracking. My session codes are as follows:

PHP Code:
 <?php 
session_start
(); 
$_SESSION['tracking'] = $_GET['kw']; 
$_SESSION['tracking'] = $_GET['OVKEY']; 
?>
and my affiliate link will be as follows to track those keywords using clickref in my affiliate network account:

HTML Code:
http://www.awin1.com/awclick.php?mid=1&id=12345&clickref=<?php echo $_SESSION['tracking'];?>
My question is am I doing the right thing? Can I have $_SESSION variable with similar name/value='tracking' as what I shown above?

Please advice. Thanks
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 06-22-2008, 07:04 AM
Bagi Zoltán's Avatar
Boss Cart consultant
1157 posts this year. Platinum VIP!
Trusted Member - This user is a Master!
Last months UKWW Tokens: 15
 
Join Date: Feb 2007
Location: Veszprém, Hungary
Posts: 1,594
Thanks: 4
Thanked 25 Times in 13 Posts
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Default

I am not a coder though have some php experience, but i believe that redefining the $_SESSION['tracking'] will overwrite the first line, so you should use different variable name. Otherwise you may track the PPC campaigns with Google Analytics.
__________________
Time may come when you will need a shopping cart
digitális mérleg keresőoptimalizálás
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 08-12-2008, 01:58 PM
Dimitar Christoff's Avatar
Member
106 posts this year. Executive spud!
We have not managed to scare them away..
Last months UKWW Tokens: 45
 
Join Date: Jul 2008
Location: Lodnon, England
Posts: 78
Thanks: 10
Thanked 5 Times in 5 Posts
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Default

Quote:
Originally Posted by Bagi Zoltán View Post
I am not a coder though have some php experience, but i believe that redefining the $_SESSION['tracking'] will overwrite the first line, so you should use different variable name. Otherwise you may track the PPC campaigns with Google Analytics.
that's ok though - he won't get a link in that has both kw=blah&OVKEY= so--in effect, only one will be set - all he needs to do is compare against a null value.

personally, i'd build a routine that iterates my affiliates until it finds who the source is, you could do something like:
PHP Code:
<?PHP

sesson_start
();

// in an ideal scenario, we want to record source and keywords in a way that is 
// tidy and meaningful for us.

$referals = array(
    
// define our possible sources of the traffic to the affiliate 'ids' we hold
    
"live.com" => "live",
    
"google" => "google",
    
"gmail" => "google",
    
"googlemail" => "google",
    
"yahoo" => "yahoo",
    
"kelkoo" => "yahoo"
);
    
$affils = array(
    
// affiliate ids/keys and corresponding $_GET keys to look at
    // this can be text like 'google' or an id or whatever
    
"google" => "kw",
    
"yahoo" => "OVKEY",
    
"live" => "q"
);          

// The browser might not provide HTTP_REFERER so you cannot rely on it -
// Secondly, some software firewalls (like Norton Internet Security) have
// features to strip out such information... 

$done false;
foreach(
$referals as $domain => $key) {
    
// look at known domain sources 
    
if (strstr($_SERVER['HTTP_REFERER'], $domain) {
        
$done true// we have our match, fine!
        
$_SESSION['affiliate'] = $key;
        
$_SESSION['keywords'] = $_GET[$affils[$key]];
    }
}

if (!
$done) {
    
// no match, referal got lost, need to brute force it.
    
foreach($affils as $affil => $key
        if (
$_GET[$key]) {
            
// match by checking variable
            
$_SESSION['affiliate'] = $affil;
            
$_SESSION['keywords'] = $_GET[$key];
        }
}

?>
anyway, have fun.
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 08-29-2008, 04:33 PM
Member
42 posts this year. i see smoke!
It looks like they have moved their luggage in.
Last months UKWW Tokens: 12
 
Join Date: May 2008
Location: Taunton, uk
Posts: 42
Thanks: 1
Thanked 4 Times in 4 Posts
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Default

dimitar rightly said it dosnt matter, and his sample script looks quite nice... but im a perfectionist so....

<?php
session_start
();
if(isset(
$_GET['kw']){
$_SESSION['tracking'] = $_GET['kw'];
}elseif(isset(
$_GET['OVKEY'])){
$_SESSION['tracking'] = $_GET['OVKEY'];
}
?>

and for your question,
Can I have $_SESSION variable with similar name/value='tracking' as what I shown above?

yes cus your only going to have one or the other so there shouldn't be any conflicts

Last edited by seopaul; 08-29-2008 at 05:16 PM. Reason: more info
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
Reply

Bookmarks



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Webmaster Resources
UK WW SEO Tools
Find UK Hosts
 
The Forum Rules
Forum Rules - MUST READ
 
Site Of the Month
BizzFace
Nominate site of the month
 
Tag Cloud
ad exchange audio ads bid bidding directory bid directory list bid for position business clothes dedicated servers delisted designer directory links wanted discount executive suites finance google handbags internet and marketing internet marketing iphone jewelry link exchange nokia n95 paid blogging phones electronics replica samsung sem seo seo company sunglasses teac cd recorder uk property writer wallets web web design web development website development website promotion wholesale yahoo backlink

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 On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:39 PM.

UK Webmaster World Forums - Internet marketing, web development, domain names, SEO contest and discussuons.
Subscribe to our feeds   Subscribe to our feeds

Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0