Jump to content

how to detect webview in app for IPS community for ads


Saurabh Jain

Recommended Posts

Posted

I want to have my website in a android app with webview

The problem is : I have adsense by google on the website; so I have a webview it will show adsense too... which is violation of policy ....

I want a code which can detect  : if it is webview : do not show this code..........

or

 

if webview show the code 1

else show the adsense code...

 

 

Posted

One solution from

http://stackoverflow.com/questions/29630719/android-block-adsense-ads-in-webview-with-admob

Then you have 2 options:

  • Remove the adsense divs via javascript inside the app (show us your website code in order to give you more accurate help)
  • If you have access to the server from wich the content is being shown, render the content without the divs that contains adsense. You can use User Agent to render the content. (again show us the code which is rendering the page to help you more accurately)

 

Posted

the solution I used was to put two different divs inside an 'advertisement' (within ACP) with different ad-code within each div, and then used width-specific CSS to make one div active and the other div disabled.

Works perfectly, and have had no complaints from the ad-house I use (tho I don't use google adsense, they're a bunch of sharks).

Posted

Amother idea I found here

http://thehelpcentre.xyz/question/28175000/android-block-adsense-ads-in-webview

Will thsi work directly in our IPS ?????

Or - can you ad an extra parameter to request from inside your application?
 
 
And, on your server side - something like this:
 
if GET [is_webview] == 1
    store is_webview in session, or cookie
endif


if SESSION [is_webview] != 1
    echo ADSENSE_CODE

endif
8 minutes ago, dancingbear said:

the solution I used was to put two different divs inside an 'advertisement' (within ACP) with different ad-code within each div, and then used width-specific CSS to make one div active and the other div disabled.

Works perfectly, and have had no complaints from the ad-house I use (tho I don't use google adsense, they're a bunch of sharks).

how do you pass details in CSS or identuify the same...

Can you help me in thsi context

 

Regards

Saurabh

Posted
38 minutes ago, Saurabh Jain said:

how do you pass details in CSS or identuify the same...

Can you help me in thsi context

@media all and (max-width:980px) { /* smartphones, landscape iPhone */ 

	#desktop_ad {
      	display:none;
    }
	#mobile_ad {
      	display:block;
    }
}  
@media (min-width:981px) { /* landscape tablets */ 
	#desktop_ad {
      	display:block;
    }
	#mobile_ad {
      	display:none;
    }
}

 

 

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...