Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Saurabh Jain Posted November 4, 2015 Posted November 4, 2015 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...
Saurabh Jain Posted November 4, 2015 Author Posted November 4, 2015 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)
Cosmic Posted November 4, 2015 Posted November 4, 2015 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).
Saurabh Jain Posted November 4, 2015 Author Posted November 4, 2015 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? http://www.example.com/?is_webview=1 And, on your server side - something like this: if GET [is_webview] == 1 store is_webview in session, or cookie endifif SESSION [is_webview] != 1 echo ADSENSE_CODEendif 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
Saurabh Jain Posted November 4, 2015 Author Posted November 4, 2015 Another method.. Can we have a user agent for mobile web view...and we can block ads for specific user agent ?
Cosmic Posted November 4, 2015 Posted November 4, 2015 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; } }
Saurabh Jain Posted November 5, 2015 Author Posted November 5, 2015 How this can be done can you ad an extra parameter to request from inside your application? http://www.example.com/?is_webview=1 And, on your server side - something like this: if GET [is_webview] == 1 store is_webview in session, or cookie endifif SESSION [is_webview] != 1 echo ADSENSE_CODEendif
Recommended Posts
Archived
This topic is now archived and is closed to further replies.