My Gateway - Iframe Code

rockstar

Newbie
Joined
Jan 8, 2009
Messages
10
Reaction score
11
Here's a demo of how this works:
Code:
http://www.bhtests.dreamhosters.com/gateway/

I thought this might be useful for someone. This is what I use as a gateway on my sites. Basically this works as a popup that forces the visitor to enter their e-mail/zip or any other information. This code was taken from another site where the discussion was "how to create an unblockable popup". This is considered to be a very hard to block popup because to be honest, it is not. It smells and taste like a good old fashioned popup but it's not.

The popup is basically a hidden div (ad) by default on the stylesheet, and later (you can define the timer) we use javascript to change the hidden value to "visible".

This popup can be closed after 60 seconds, when another popup button shows up. If you click this button the stylesheet changes again from "visible" to "hidden" and the visitor gets to see the website.

You can also assign different offers to different countries. In this example code I'm only targeting US visitors with a iframe of google dot com. If you're coming from another country you'll see a simple banner. I'm currently using this on a site for a very famous mmorpg where I get a lot of Russian, Greek visitors. You just need to add the line:

Code:
else if (geoip_country_code() == "RU") {	
  document.write("NEW CONDITION");
}

//Change US to RU if you are targeting RU visitors
As for the iframe code you can do it manually or using cakeslice/GodCPA or whatever method you want. Don't forget to fake the referrer on the iframe url.

Here's the code:

Code:
<html>
<head>
	<title>My Gateway</title>
	<script src="http://j.maxmind.com/app/geoip.js" type="text/javascript"></script>
	<script type="text/javascript">
	function showad() {
	window.setTimeout('showad2()',1000);
	}
	
	function showad2() {
	document.getElementById("ad").style.visibility = "visible"
	}
	</script>
	

	<script type="text/javascript">
	function showclose() {
	window.setTimeout('showclose2()',60000);
	}
	
	function showclose2() {
	document.getElementById("close").style.visibility = "visible"
	}
	</script>
	
	
	<style type="text/css">
	#ad { background:#fff ; text-align:center; border:10px solid #DC3522 ; color:#000 ; font-family:sans-serif ; padding:20px 5px ; position:fixed ; top:20px ; left:20px ; width:95% ; height:90% ; visibility:hidden ; z-index:1 }
	#close { visibility: hidden; }
	#text_top1_title { font-family:georgia, serif; color:#3B200F; font-size:16px; font-weight:bold; line-height:125%; text-align:center; }
	#normal_text { font-family:georgia, serif; color:#381704; font-size:10px; letter-spacing:0.1em; line-height:200%; padding-top:11px; }
	#last_text { color: #000; font-size: 10px; margin: 5px; font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif; font-size: 11px; }
	#text_top2 { font: bold 26px "Century Schoolbook", Georgia, Times, serif; color: #333; line-height: 90%; margin: .2em 0 .4em 0; letter-spacing: -2px; }
	#warn2 { font-family: courier, sans-serif; font-size: 10px; padding: 10px; }
	</style>
	
	
</head>

<body onload="showad();">
<div id="ad">

<script type="text/javascript">

if (geoip_country_code() == "US") 
{	
  document.write("<div id='text_top1_title'>OOPS! Houston, we have a problem!<br /> <div id='normal_text'>YOU HAVE TO SUBSCRIBE OUR NEWSLETTER TO ACCESS OUR CONTENT...</div><br /><div id='last_text'>Don't worry, we will only contact you if some scandal happens...</div></div>  <!-- Hello Input Iframe Here!!! IFRAME START -->  <div style='overflow: hidden; width: 592px; height: 69px; margin-left:auto; margin-right:auto; position:relative;' id='i_div'><iframe name='i_frame' src='http://www.google.com' style='border: 0pt none ; left: -394px; top: -176px; position: absolute; width: 1280px; height: 576px;' scrolling='no'></iframe></div><br / ><!-- IFRAME END --> <div id='normal_text'>Please allow one moment for the e-mail validation process...<br />After validation you will be able to close this window!</div>");
} 
else
{
  document.write("<!-- IF OUTSIDE USA TRY ANOTHER OFFER HERE --> <div id='text_top2'>Click the image below to visit the greatest site ever<br /><br /></div><a href='#'><img src='banner.png' width='auto' border='0'></a><br /><div id='warn2'>After clicking the banner above you'll be able to close this popup and watch our content.</div>");
} 

</script>

<div id="close">
<a href="#" onclick="document.getElementById('ad').style.visibility='hidden'"><img onload="showclose()" onclick="document.getElementById('close').style.visibility='hidden'" src="img/close.png" border="none"></a>
</div>
</div>
Implement this on your site/blog or simply insert your content here. <br />

</body>
</html>

If you need help setting this up post on the thread for everyone to see.
 
Last edited:
Nice!...can you put a iframe in their for example to show us instead of banner....thx!

Here's a demo of how this works:
Code:
http://www.bhtests.dreamhosters.com/gateway/
I thought this might be useful for someone. This is what I use as a gateway on my sites. Basically this works as a popup that forces the visitor to enter their e-mail/zip or any other information. This code was taken from another site where the discussion was "how to create an unblockable popup". This is considered to be a very hard to block popup because to be honest, it is not. It smells and taste like a good old fashioned popup but it's not.

The popup is basically a hidden div (ad) by default on the stylesheet, and later (you can define the timer) we use javascript to change the hidden value to "visible".

This popup can be closed after 60 seconds, when another popup button shows up. If you click this button the stylesheet changes again from "visible" to "hidden" and the visitor gets to see the website.

You can also assign different offers to different countries. In this example code I'm only targeting US visitors with a iframe of google dot com. If you're coming from another country you'll see a simple banner. I'm currently using this on a site for a very famous mmorpg where I get a lot of Russian, Greek visitors. You just need to add the line:

Code:
else if (geoip_country_code() == "RU") {    
  document.write("NEW CONDITION");
}

//Change US to RU if you are targeting RU visitors
As for the iframe code you can do it manually or using cakeslice/GodCPA or whatever method you want. Don't forget to fake the referrer on the iframe url.

Here's the code:

Code:
<html>
<head>
    <title>My Gateway</title>
    <script src="http://j.maxmind.com/app/geoip.js" type="text/javascript"></script>
    <script type="text/javascript">
    function showad() {
    window.setTimeout('showad2()',1000);
    }
    
    function showad2() {
    document.getElementById("ad").style.visibility = "visible"
    }
    </script>
    

    <script type="text/javascript">
    function showclose() {
    window.setTimeout('showclose2()',60000);
    }
    
    function showclose2() {
    document.getElementById("close").style.visibility = "visible"
    }
    </script>
    
    
    <style type="text/css">
    #ad { background:#fff ; text-align:center; border:10px solid #DC3522 ; color:#000 ; font-family:sans-serif ; padding:20px 5px ; position:fixed ; top:20px ; left:20px ; width:95% ; height:90% ; visibility:hidden ; z-index:1 }
    #close { visibility: hidden; }
    #text_top1_title { font-family:georgia, serif; color:#3B200F; font-size:16px; font-weight:bold; line-height:125%; text-align:center; }
    #normal_text { font-family:georgia, serif; color:#381704; font-size:10px; letter-spacing:0.1em; line-height:200%; padding-top:11px; }
    #last_text { color: #000; font-size: 10px; margin: 5px; font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif; font-size: 11px; }
    #text_top2 { font: bold 26px "Century Schoolbook", Georgia, Times, serif; color: #333; line-height: 90%; margin: .2em 0 .4em 0; letter-spacing: -2px; }
    #warn2 { font-family: courier, sans-serif; font-size: 10px; padding: 10px; }
    </style>
    
    
</head>

<body onload="showad();">
<div id="ad">

<script type="text/javascript">

if (geoip_country_code() == "US") 
{    
  document.write("<div id='text_top1_title'>OOPS! Houston, we have a problem!<br /> <div id='normal_text'>YOU HAVE TO SUBSCRIBE OUR NEWSLETTER TO ACCESS OUR CONTENT...</div><br /><div id='last_text'>Don't worry, we will only contact you if some scandal happens...</div></div>  <!-- Hello Input Iframe Here!!! IFRAME START -->  <div style='overflow: hidden; width: 592px; height: 69px; margin-left:auto; margin-right:auto; position:relative;' id='i_div'><iframe name='i_frame' src='http://www.google.com' style='border: 0pt none ; left: -394px; top: -176px; position: absolute; width: 1280px; height: 576px;' scrolling='no'></iframe></div><br / ><!-- IFRAME END --> <div id='normal_text'>Please allow one moment for the e-mail validation process...<br />After validation you will be able to close this window!</div>");
} 
else
{
  document.write("<!-- IF OUTSIDE USA TRY ANOTHER OFFER HERE --> <div id='text_top2'>Click the image below to visit the greatest site ever<br /><br /></div><a href='#'><img src='banner.png' width='auto' border='0'></a><br /><div id='warn2'>After clicking the banner above you'll be able to close this popup and watch our content.</div>");
} 

</script>

<div id="close">
<a href="#" onclick="document.getElementById('ad').style.visibility='hidden'"><img onload="showclose()" onclick="document.getElementById('close').style.visibility='hidden'" src="img/close.png" border="none"></a>
</div>
</div>
Implement this on your site/blog or simply insert your content here. <br />

</body>
</html>
If you need help setting this up post on the thread for everyone to see.
 
I'll change the banner.png to an iframe as soon as I can.

About the opening the link in a new page check your quotes inside the code.
You should be using this kind on quote: 'target=_blank' instead of "target=_blank". Check if this solves your problem.

Edit: As requested, from now on if you're coming from outside the US you'll see an iframe too.
 
Last edited:
I'll change the banner.png to an iframe as soon as I can.

About the opening the link in a new page check your quotes inside the code.
You should be using this kind on quote: 'target=_blank' instead of "target=_blank". Check if this solves your problem.

Edit: As requested, from now on if you're coming from outside the US you'll see an iframe too.

Sorry for being prick, but i would just love to see the iframe in action, but i cannot, because i am not from usa but from europe, can you put a global 1 page email submit (will enter the submit too :-)
 
I took the banner long time ago, the iframe is working for US and non-US visitors. As you probably know, it would not be very wise to run a real iframed campaign and post it on BHW. If you you need extra help feel free to pm me.
 
can you please tell me where to install it ? in the index page?. which files should it copy and pasted on the site..thanks any live sample
 
can you please tell me where to install it ? in the index page?. which files should it copy and pasted on the site..thanks any live sample

If you already have a website and you want to implement this then you need to copy and paste this code in between your <head> </head> tags:

Code:
<script src="http://j.maxmind.com/app/geoip.js" type="text/javascript"></script>
    <script type="text/javascript">
    function showad() {
    window.setTimeout('showad2()',1000);
    }
    
    function showad2() {
    document.getElementById("ad").style.visibility = "visible"
    }
    </script>
    

    <script type="text/javascript">
    function showclose() {
    window.setTimeout('showclose2()',60000);
    }
    
    function showclose2() {
    document.getElementById("close").style.visibility = "visible"
    }
    </script>
    
    
    <style type="text/css">
    #ad { background:#fff ; text-align:center; border:10px solid #DC3522 ; color:#000 ; font-family:sans-serif ; padding:20px 5px ; position:fixed ; top:20px ; left:20px ; width:95% ; height:90% ; visibility:hidden ; z-index:1 }
    #close { visibility: hidden; }
    #text_top1_title { font-family:georgia, serif; color:#3B200F; font-size:16px; font-weight:bold; line-height:125%; text-align:center; }
    #normal_text { font-family:georgia, serif; color:#381704; font-size:10px; letter-spacing:0.1em; line-height:200%; padding-top:11px; }
    #last_text { color: #000; font-size: 10px; margin: 5px; font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif; font-size: 11px; }
    #text_top2 { font: bold 26px "Century Schoolbook", Georgia, Times, serif; color: #333; line-height: 90%; margin: .2em 0 .4em 0; letter-spacing: -2px; }
    #warn2 { font-family: courier, sans-serif; font-size: 10px; padding: 10px; }
    </style>

Then you need to add this to your <body> tag:

Code:
<body onload="showad();">

Then just add the rest of the html/javascript code:

Code:
<div id="ad">

<script type="text/javascript">

if (geoip_country_code() == "US") 
{    
  document.write("<div id='text_top1_title'>OOPS! Houston, we have a problem!<br /> <div id='normal_text'>YOU HAVE TO SUBSCRIBE OUR NEWSLETTER TO ACCESS OUR CONTENT...</div><br /><div id='last_text'>Don't worry, we will only contact you if some scandal happens...</div></div>  <!-- Hello Input Iframe Here!!! IFRAME START -->  <div style='overflow: hidden; width: 592px; height: 69px; margin-left:auto; margin-right:auto; position:relative;' id='i_div'><iframe name='i_frame' src='http://www.google.com' style='border: 0pt none ; left: -394px; top: -176px; position: absolute; width: 1280px; height: 576px;' scrolling='no'></iframe></div><br / ><!-- IFRAME END --> <div id='normal_text'>Please allow one moment for the e-mail validation process...<br />After validation you will be able to close this window!</div>");
} 
else
{
  document.write("<!-- IF OUTSIDE USA TRY ANOTHER OFFER HERE --> <div id='text_top2'>Click the image below to visit the greatest site ever<br /><br /></div><a href='#'><img src='banner.png' width='auto' border='0'></a><br /><div id='warn2'>After clicking the banner above you'll be able to close this popup and watch our content.</div>");
} 

</script>

<div id="close">
<a href="#" onclick="document.getElementById('ad').style.visibility='hidden'"><img onload="showclose()" onclick="document.getElementById('close').style.visibility='hidden'" src="img/close.png" border="none"></a>
</div>
</div>

This is as simple as I can put it. If you still can't use it, pm me and I'll set it for you.
 
what is this all about???? and r u giving it for freee here
 
what is this all about???? and r u giving it for freee here

Depends on volume, if a lot of people start requesting it, I can't waste my time for free. If it's just a couple of people who are having difficulties then I can set it up for them.
 
is the popup supposed to close after the email is submitted? because it doesn't seem to close for me or anyone else i had test it
 
I have test this too and it is not closing. If we could manage to make it close we can do a lot of tricks with it :wof:
 
We call this a lightbox, nothing new...

In fact it's pretty standard IM technology... there are even WP Plugins for it :D

The real gold would be in getting a Lightbox to work onExit without needing that damn JS Alert.
 
ok i have alot of content blockers or lightboxes etc...
but my question is after the submit how do i make the next page break out of the iframe and open in a new tab or window, then show something like a progress bar in the box to replace where the email submit was...
 
i feel really risky doing this shit, even though i've made lots of money doing shit with faked referrers before. anyway for this specifically to give you up to your AM?
 
Back
Top