Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 19th Nov 2012, 05:03 PM   #1
Ambitious Warrior
War Room Member
 
StewartJ's Avatar
 
Join Date: 2012
Posts: 98
Thanks: 11
Thanked 8 Times in 6 Posts
Default
How to Pass keyword referrer info through iFrame?
Share on: 
fb share twitter share gplus share more share

Hi Guys,

I would like to pass keyword referrer info through an iframe. Basically, I have a form which I have to iFrame on a website however; if I just iframe the form, the keyword referrer doesn't jump the iframe and I get lead/info without any referrer related to it.

For instance, using this code I am able to capture the title of the page the lead came from:

PHP Code:
<iframe style="margin-right:0px" scrolling="no" src="http://domain.com/form-i-am-iframing/?utm_content=WORDPRESS-POST-TITLE-FUNCTION" width="300" height="500" scrolling="auto" frameborder="0"></iframe> 
Using something similar.. how can I capture the keyword referrer if someone lands on a particular page of my site using "some keyword"? :confused:

Thanks for your help guys!
StewartJ is offline  
Unread 19th Nov 2012, 05:48 PM   #2
Advanced Warrior
War Room Member
 
Brandon Tanner's Avatar
 
Join Date: 2006
Location: USA
Posts: 1,907
Thanks: 236
Thanked 1,377 Times in 676 Posts
Default
Re: How to Pass keyword referrer info through iFrame?
Share on: 
fb share twitter share gplus share more share

You can get the referring URL using HTTP_Referer (PHP) and then parse out the referring keyword from that, but it's not very reliable for several reasons. But if you're content with being able to grab that info from only a certain percentage of your visitors (which is all you can hope for), then you can do something like this.

Once you have that info, simply echo it out in your iframe src's query string. For example (assuming that you put the referring keyword in a variable name 'keyword')...

<iframe src="YourWebsite.com/FormSubmit.php?keyword=<?php echo $keyword; ?>">

Then in the FormSubmit.php code, you would grab the value of the keyword that was passed through the query string...

<?php
$keyword = $_GET['keyword'];
?>


Brandon Tanner is offline  
Unread 19th Nov 2012, 07:29 PM   #3
Ambitious Warrior
War Room Member
 
StewartJ's Avatar
 
Join Date: 2012
Posts: 98
Thanks: 11
Thanked 8 Times in 6 Posts
Default
Re: How to Pass keyword referrer info through iFrame?
Share on: 
fb share twitter share gplus share more share

Thank you Brandon.

In your opinion is there a more inclusive way to get keyword referrers and send them to the iFrame?
StewartJ is offline  
Unread 19th Nov 2012, 08:00 PM   #4
Advanced Warrior
War Room Member
 
Brandon Tanner's Avatar
 
Join Date: 2006
Location: USA
Posts: 1,907
Thanks: 236
Thanked 1,377 Times in 676 Posts
Default
Re: How to Pass keyword referrer info through iFrame?
Share on: 
fb share twitter share gplus share more share

Originally Posted by StewartJ View Post

Thank you Brandon.

In your opinion is there a more inclusive way to get keyword referrers and send them to the iFrame?
You can get the referrer using other languages as well (ie Javascript, Ruby, ASP, etc), but you will still have the same problem as with the PHP method. Which is... the referrer info will not always be passed to your page in the first place, because of many possible reasons (browser settings, popup blocker, firewall, etc etc).

So no matter what language you use to get the referrer, it's never going to be 100% reliable.


Brandon Tanner is offline  
Closed Thread


Bookmarks

Tags
iframe, info, keyword, pass, referrer


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 03:20 PM.