Enjoy unlimited access to all forum features for FREE! Optional upgrade available for extra perks.

Interstitial Ads and Cloaked Aff Links

Joined
Sep 17, 2012
Posts
385
Reaction score
64
Thought this might be a good place to ask this.. if you have a site that mixes google auto ads and affiliate content and you cloak the links through a sub folder (eg: /go/link/) then you end up getting an interstitial ad on the link, which obviously isn't ideal from a conversion perspective.

Eg: It goes:

Page -- click --> Interstitial ad -- dismiss --> Aff link

Is there any way to tell google to not show an interstitial ad on a specific link (or even for clicks to a specific sub folder would do it).
 
Yeah you can exclude it from the page no problem, but we want the ads to run on the rest of the page... just not when that one specific link is clicked - it's a pretty big page and just has an aff unit after the intro for a specific product.
 
That's just talking about a nested subfolder isn't it? Eg: /first-directory/second-directory/

There's no ad code on the redirect URL so I'm assuming it must be triggered by the code on the page that the link is on. So blocking the /go/ folder wouldn't work as the relevant ads are running on the /page-with-link/.

Ie: The interstitial ads are actually controlled by ad code on the page you're leaving, not the page you're going to. If that makes sense.
 
It's just using auto ads on every page - so just the same single bit of code and we've not mucked about with anything.

That link did have a bit of useful info:

Some links on a page may be considered ineligible to show interstitial ads. Interstitial ads won’t be shown when a user clicks an ineligible link, for example, links to URLs without HTTP/HTTPS and links that open a new window.

So opening it in a new window would probably do the job.... except then we'd have to battle the ad blockers potentially not showing the link.

It's interesting that no one else seems to have this issue before (or have realised it's there) because searches bring up very little info on the subject.
 
@baldidiot
I know this is old but did you resolve it ??
Couldn't you simply do something like the following :
There are a few ways to do this...
If you're using PHP the easiest way would to be to assign a name to the link ID
you dont want google ads to show on ..
like
<a href="external-link-1" id="dontshow">

then wrap the google ad code inside a php function

Or simply use jQuery to remove any of the code inserted on that specific a tag
 
@baldidiot
I know this is old but did you resolve it ??
Couldn't you simply do something like the following :
There are a few ways to do this...
If you're using PHP the easiest way would to be to assign a name to the link ID
you dont want google ads to show on ..
like
<a href="external-link-1" id="dontshow">

then wrap the google ad code inside a php function

Or simply use jQuery to remove any of the code inserted on that specific a tag
He's talking about auto ads, where you include one bit of code and it'll do all of the ad implementation for you (placement of ads, vignette ads, interstitial ads, sticky ads and even shopping links and all sorts). You can add exclusions for entire pages from within Adsense, but I'm not aware of a client side solution for this after searching the internet.

I suspect that they won't show an interstitial ad if you add an on-click handler to a link and use JavaScript to redirect to another page. It'll probably just be for pure anchor tags... otherwise they would risk showing them at odd times. Just a hunch.
 
Last edited:
Could still check the source using jquery once page has loaded for relevant code inserted by google
There is a way to do it though..
Can someone point me to a site that does use google intersitals so I can have a look at their JS to provide a definitive answer ?
Not really played around with auto ads much but there will be a way to do it
even if its a case of checking the referring link thats clicked and hiding the element id.
Need to have a look at some code though but its achieveable
 
Looking at the initial post it seems could simply check the current URL using PHP ..
and then where you add the google script tag
simply put this inside the <head></head> or wherever you call it from on the page
<?php
if($_SERVER['PHP_SELF'] !== 'this-link')
{
Goggle script tag here
}
?>

could even create an array of links and use

<?php
$links = array("link-1","link-2","link-3");
if(!in_array($_SERVER['PHP_SELF'],$links))
{
Goggle script tag here
}
?>
 
Yep...
Checking with JS would make more sense as the page has already loaded
 
I assumed that the requirements were to show Google ads, but just not have the interstitial ads triggered when essentially leaving the website (via proxy link). I might be wrong though.

If the question is how to I prevent Google Adsense ads from appearing on a particular page then you just don't include the adsense code on the page and Ben's code looks perfectly valid. I would always prefer to do this via the server response than on the client side, but needs must if you don't have the possibility to do so.
 
Yeah I'd go with Ben's personally and you could also do an on click function as well to test any clicks on all A tags

$("a").click(function () {
var excludedLinks = ["/go/link1/", "/go/link2/", "/go/link3/"];
var addressValue = $(this).attr("href");
if (excludedLinks.some(link => addressValue)) {
// Do not load the interstitial ad code​
} else {
// Load the Google AdSense code as usual
// Replace 'your_ad_unit_id' with your actual AdSense ad unit ID
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: "ca-pub-XXXXXXXXXXXX",
enable_page_level_ads: true
});
}​
});
 
Yeah I'd go with Ben's personally and you could also do an on click function as well to test any clicks on all A tags

$("a").click(function () {
var excludedLinks = ["/go/link1/", "/go/link2/", "/go/link3/"];
var addressValue = $(this).attr("href");
if (excludedLinks.some(link => addressValue)) {
// Do not load the interstitial ad code​
} else {
// Load the Google AdSense code as usual
// Replace 'your_ad_unit_id' with your actual AdSense ad unit ID
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: "ca-pub-XXXXXXXXXXXX",
enable_page_level_ads: true
});
}​
});
That would load the Adsense code after a click on any anchor tag, which I don't think is what is desired. Cause this would prevent any ads from being displayed and then it would display them after clicking a link, which is the last time you want ads to be loaded, cause they're already leaving the current page.

If the ad code was just for interstitial ads then I might be inclined to agree, but it's all ads (interstitial and ad placements) or nothing with that code.
 
Yeah that was just something I knocked up quickly last night so it wont be accurate but its enough to give a rough idea.

If its a static link that you want the ads not to show on simply assign the a tag an id value
and replace $("a").click(function () {
with
$("#excludedID").click(function () {

Either way would be trial and error to get the desired effect and all we can do is speculate right nowregarding the code because we don't know the code structure at the moment etc

That would load the Adsense code after a click on any anchor tag, which I don't think is what is desired. Cause this would prevent any ads from being displayed and then it would display them after clicking a link, which is the last time you want ads to be loaded, cause they're already leaving the current page.

If the ad code was just for interstitial ads then I might be inclined to agree, but it's all ads (interstitial and ad placements) or nothing with that code.
 
I refer back to my idea of adding an on click script and using JS to redirect the user. I don't think Google Adsense will trigger an interstitial on a Javascript triggered navigation.

jQuery is unnecessary nowadays imho. Modern browsers have everything built in that you need :).
 
Yeah I'm not really experienced with JS ... I've been using PHP for the last 25 years
so never touched JS and only started dabbling with jQuery recently so my JS knowledge isn't great.

There should be a way round it but like @seemly pointed out previously unless we knew more about his code structure / ad integration etc any suggestions we could make would pretty much be guess work and potentially trigger other issues
 
Sorry, only just noticed these replies!

The OP still wants Adsense to be displayed on every page, but is asking that when a specific link is clicked, interstitials aren't shown.

Yes, exactly. All we're trying to do is stop the interstitial showing up when someone clicks and aff link, just in case that stops them continuing through to the final URL.

I'll be honest, I'm not that clued up on javascript but I got the jist of what was being said. The problem with using javascript on the links is that we have multiple editors on our sites and some links are in content. It also seems to be quite a complicated solution for something that google should really have thought about, when I first posted I was largely hoping for a google-side solution.

Going back to the original question of whether we solved it... not really. We have some work arounds, specifically:

1. Opening in a new window seems to stop it happening, but causes issues with adblockers so needs to be on a case by case basis. Tbh we've just been leaving it in most places - I'd rather the user be able to visit the end page with an interstitial ad to annoy them than not visit the page at all because their ad blocker stops them.

2. Not loading adsense on commercial pages. This is our main solution. It's not the end of the world because we probably don't want a bunch of ads on a page where we have more valuable aff content. So it's only really an issue now on pages where the adsense rev is more valuable than the aff link (ie: where the affiliate content is a relatively minor part of the page).

What would be ideal is if google had some kind of path exclusion you could add for the interstitials, eg: excluding them on any link with /go/ in it.
 

The Rule #1

Do not insult any other member. Be polite and do business. Thank you!

Members online

☆ Premium Listings

Sedo - it.com Premiums

IT.com

Premium Members

Latest Comments

Acorn Domains Merch
MariaBuy Marketplace

New Threads

Domain Forum Friends

Other domain-related communities we can recommend.

Our Mods' Businesses

Perfect
Laskos
*the exceptional businesses of our esteemed moderators
Top Bottom