remove adsense ads on subscription in website - adsense

i want to know can i show ads for free users and remove ads if they purchase subscription in my website. (i have website).
and i want to done this in php if conditions like
if(subscription==true){
// nothing here}
else{
// google adsense code here
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=############" crossorigin="anonymous"></script>
}
i want to done like this.
can this voilance any google guidelines??
can if i done this my adsense got disapprove or rejected by chance??

Related

How do you create a mobile friendly Like Gate for a Page on Facebook?

I've put a Like Gate on a few of my Facebook Pages and I'm getting a lot of complaints saying that people can't access the content via their mobile device since the mobile version of the facebook website, and the facebook apps for ios/android, don't support tabs on Facebook.
I see there are services out there (I'm not sure how legit they are) that offer a way to create a mobile like gate for your page tab, but I can't find any documentation on how they do it. These services are not suitable for me, because the content on my tab is custom and dynamic.
So, how can I create a interstitial page for a mobile page that requires the visitor to have liked my Page on Facebook before they can proceed? This has to work for new users, as well as existing users who re-visit the tab and without requiring an install to an application.
Thanks!
One approach you can take for a mobile site is to check that the user has liked the page in question via the JS SDK.
If you have a logged-in user to your application, you can Subscribe to the authResponseChange FB event within your JS SDK initialization, or call a function directly to make an API request to verify if the user is a fan of your page.
In your initialization:
FB.init({appId: YOUR_FB_APP_ID_HERE });
window.fbAsyncInit = function() {
// React to a user clicking an on-page Like button:
FB.Event.subscribe("edge.create", verifyUserLikesPage);
}
You can verify that the user likes the appropriate page in the like handler:
function verifyUserLikesPage() {
FB.api("/me/likes/"+FBID_OF_PAGE_TO_ENSURE_THEY_LIKE, function(apiResponse){
if (apiResponse.data && apiResponse.data.length > 0)
// User likes the page. Enabled them to proceed
else
// User does not like the page. Require they click Like.
}
}
More information on the edge.create subscribe via JS available here: https://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/

facebook apps redirect to hosting url in the first usage

I built a facebook apps from an tutorial with using adobe flash builder 4.5 . It is hosted on heroku.
This app gets name, image, birthday and status message . It displays these infos in the screen. And you can also post status message to your fb account. As you understand, it is very simple apps.
In the first usage of this app, after permission dialog, url is redirected to hosting url.
When you want to use it again, You can use it on facebook.com
do you have any idea why it is redirected to hosting url in the first usage after permission dialogs.
Thanks,
cergun
Selam Ceyhun,
This is expected behavior, what you can do for this is simply:
<script type='text/javascript'>
if (window.top.location == window.location)
window.top.location = 'https://apps.facebook.com/myapp';
</script>
that's it.

Adsense code not showing

My adsense code won't show. Code is in there, and is in there for weeks...Still not showing..
http://www.ecompanies.nl/pilot/diensten/seo/breda.html
I think it should be jQuery or Google Maps javascript interfering or something.
Don't see any javascript errors..
Any help is highly appreciated!
For anyone encountering the same problem...It looks like an Adsense problem. Seems like the ads only show up after Google Adsense bot spidered the page. On new pages on my sites, it takes 1 or 2 days for the ads to show up. Very strange..

Can Facebook Live Stream Plugin be used on site outside of Facebook?

Does anyone out there have a working example of the Facebook live stream plugin
that exists on a NON facebook webpage (meaning one that isn't located in the facebook domain ie. a canvas app)?
Has anyone successfully managed to integrate the Facebook Live Stream plugin into their site?
I cannot successfully do this using the code given by facebook which is:
<div id="fb-root" ></div>
<script src="http://connect.facebook.net/en_US/all.js#appId=MYAPPID&xfbml=1">
</script><fb:live-stream event_app_id="MYAPPID" width="400" xid=""
height="500" always_post_to_friends="false"></fb:live-stream>
Facebook has almost 0 documentation on this and whatever they do have is vague. I've searched forums regarding the issue but they are all full of people who can't get it to work and no decent solutions posted.
Thanks
The problem here was that I had "accept 3rd party cookies' turned off in my browser and the plugin needed to access these in order to work.

how to make Facebook app install/installable/auto-bookmarked

I have this Facebook application profile page:
http://www.facebook.com/developers/editapp.php?app_id=122313254494566#!/apps/application.php?id=122313254494566
which is associated with my iframe-based Facebook application, Gem Spinner:
http://apps.facebook.com/gemspinner/
My understanding from reading recent Facebook documentation is that in the last couple months Facebook changed the method by which users can "bookmark" an app ("bookmarking" as I understand it, is the process of adding an icon for the application to the user's list of applications on the left side of the Facebook home page). My understanding is that bookmarking is now supposed to happen automatically the first time the person uses the app.
But that's not happening for my app. When you go there, it just shows you the app page and lets you play the game. There is no confirmation message, like I see with other apps, checking if I want to allow this app to access various information from my Facebook account. And there is no bookmark/icon added to the application list on my home page.
So I'm obviously missing something. I tried to follow the instructions here: http://developers.facebook.com/docs/guides/canvas/, including the part on bookmarks, but again that part makes it sound like it will just happen automatically.
My app has been approved for the Facebook directory (although it is not yet showing up in searches of the directory). And it's not in "sandbox" mode.
Perhaps there are some Facebook API calls I must make to let the user "install" the application. If so, I'd love to know what those are.
Apparently the thing I was missing is that it's necessary to call FB.login() from within your javascript code in order to get facebook to "automatically" bookmark the application for the user. I guess this makes a certain amount of sense, since the user has to be "authenticated" with your app before your app (or Facebook on behalf of your app) can make any changes to the user's account, such as adding a bookmark. Nonetheless, it seems like it could have been the case that it added the bookmark without the authentication, and certainly reading the Facebook documentation one would think that simply visiting the app would create the bookmark, regardless of the authentication.
Anyway, another problem was how to make the authentication happen in a smooth way. It may be that there's a more clever and more functional way to do this using page redirects, but it seems like this new API wants to show a pop-up window for the login UI. If that popup is triggered by a button press (i.e., a button that says/means "click here to authenticate with this application"), you get the popup without the terrible browser popup warning. But if you just call the FB.login() function yourself, you get the terrible warning.
So, to get around this, I had my code trigger the button event, and it worked (at least on Firefox). The code is:
<body>
<div id="fb-root">
</div>
<script src="http://connect.facebook.net/en_US/all.js" type="text/javascript"></script>
<script type="text/javascript">
FB.init({
appId : 'your app id here',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : false // parse XFBML
});
function fblogin() {
FB.getLoginStatus(function(response) {
if (response.session) {
// logged in and connected user, someone you know
} else {
// no user session available, someone you dont know
FB.login(
function(response)
{
if (response.session)
{
// user successfully logged in *or* user was already logged in
// *and* user has now been successfully authenticated for this app
// *and* a bookmark added by Facebook for this app
}
else
{
// user cancelled login
}
} );
}
});
}
</script>
<a id="clickme" href="#" onclick="fblogin();return false;"></a>
... the rest of your page here ...
<script type="text/javascript">
document.getElementById( "clickme" ).onclick();
</script>
</body>
This all seems pretty hackish, but I don't know a better way to make the authentication happen automatically while avoiding the popup warning.
It seems to me that the FB.login() function is confusingly named. It really seems to mean, "If the user is not logged in, present the login UI. But if the user is already logged in, or if the user successfully logs in using the UI, also authenticate the user for this application, including automatically bookmarking this application for the user." So maybe at least loginAndAuthenticate() would be a better name.