How to get targeted adsense ads on Facebook app page requiring authentication - facebook

I have a Facebook iframe application that I am monetizing via Google Adsense. On pages that do not require Facebook authentication, the ads are served fine and reflect the content on the page. Pages that require a Facebook session have the ads rendered fine, but they are very generic. They only reflect the user's geography and not the page content (for example, Groupon ads for the user's city, and ads for random things like photo uploading services).
I would like to get Adsense to render targeted ads based on the page content. There is plenty of good content on the pages in question. They are not "content-free" pages like pure logon pages.
I am using an approach similar to the one in the accepted answer for this other question: google adsense in facebook application . My Adsense javascript is in a separate file that gets loaded into an iframe in my canvas page, which is in turn loaded into Facebook as an iframe (like any other Facebook iframe app). The file with the Adsense code has a bunch of relevant content to provide Adsense with the context for targeting the ads. This content is not visible to the user as I set the iframe to have no scrollbars and a limited height.
Is the problem that the Adsense bot (user agent Mediapartners-Google) gets blocked by the Facebook logon and can't indexing the page?
Or is the problem that when the user accesses the page, Facebook tacks on a very long querystring, resulting in Adsense treating it as a different page for every user? Then again, this has no impact on the iframe URL.
The solution recommended in that other stack overflow question calls for loading the file with the Adsense code and keywords using a frameset rather than an iframe. Would this really make a difference?
I am aware of the potential conflict with Adsense terms which prohibits loading Adsense via an iframe. For a Facebook app there really is no other way to do it, and since the app iframe has legitimate content for ad targeting and is "owned" by the publisher (me) it seems consistent with the spirit if not the letter of the Adsense terms of use.
I have toyed with the idea of changing my pages that require a Facebook session to be open, and just disable all controls and present a Facebook login button to users who visit those pages and are not logged into Facebook already. I would use the Javascript client library to manage the login and enabling of controls so the page does not refresh, so hopefully Adsense will read the content and delivery relevant targeted ads. This is a significant change to those pages however, so if there is a simpler solution I'd like to avoid this work.

Well I did nothing but wait a week or so and the ads started to get context-tuned and relevant, using the approach of putting the ads in an iframe that has masked-off context content (setting the iframe height and width to just show the ads, no scroll bars or border) that matches my app's subject.
I'm not sure why it took a week for Google to tune into the context and produce targeted ads on this page, but I won't look the gift horse in the mouth I guess.

Related

Differentiating between Google Analytics Tracking of Facebook App and Web App

I have a web app at www.mydomain.com/webapp and its set up with Google Analytics. I create a facebook app at apps.facebook.com/webapp and iframe in the above url.
Is there a way to distinguish activity of users on facebook from users on mydomain?
Thanks for any help and direction you can give me.
You could use JavaScript to determine that your page is displayed in an iframe – but that would also be true if maybe other sites embedded your page.
A better way would be to check for the [signed_request][1] parameter that gets POSTed to your app on initial load into the iframe. (If you were paranoid about someone “faking” that, you could also verify the signed_request.)
Once you figured out that your page was actually loaded inside Facebook, it should be easy to execute the appropriate JS code to send that info to Analytics.

Displaying iframe content on a facebook page from a custom url

I am trying to create a system which allows customers to add a Facebook page as an add-on to what our business offers. Ideally I want users to click a button from our site which creates a page for them on Facebook which contains an iFrame in which content is served by us from our site.
I've never done any work with Facebook before, I don't really understand how the whole app thing works (I don't really use it personally as well) and I'm not sure what the best way to achieve what we seek. I have read a few tutorials on the fb developer site, which were all completely out of date, but I created an app of type 'App on Facebook' that displays a canvas url with an iframe which displays some content.
However, what I really want is to do one of the following:
1) Create an app that can be added to someone's page, which takes a custom url and displays this url in the iframe on the canvas page.
For example, a user called bob initialises the facebook integration from our site, we automatically create a page for them, add the app we have created, and provide a url like http://ourcustomurl.com/bob which is a link to some content from our site which is then displayed in the iframe.
2) Another option I thought would be possible would be creating a new app for every user who enables the facebook integration from our site, and just setting the canvas url on creation. But this option doesn't sit well with me, we don't really want to create an app for people, but a page.
You can't create a Facebook Page or an App via the API
If i understand correctly you want page admins to install your app into a tab on their page, and have different content displayed on that page tab depending on which page it is.
Check this document: https://developers.facebook.com/docs/appsonfacebook/pagetabs/
The main takeaway you should have is that you can use the signed_request which is sent to your app to determine which Facebook Page the App is being loaded from and decide on your side which content to display based on that

twitter and facebook app in a modal div inside an iframe

I need to link the user's twitter and facebook profiles in a website profile while the website is loaded inside other websites' through iframe.
Is it possible to do that using a modal div inside that iframe? I'm quite in trouble thinking about the return url and page reload.
Have some example?
btw i'm using php but think it's not important now
Thanks,
A.
You can do what ever you want in your page even when it resides in an iframe. What you can do in it (visually) is only limited by the dimensions of the iframe (unless the hosting page has some kind of layer on top of your iframe).
I can't speak of the twitter way of doing things (you can always check their documentation) but with facebook it's pretty easy to integrate into the graph using the api.
You need to have a facebook app, and then in your page (even if it's in an iframe) you can use the javascript sdk to authenticate the user and then use the graph as you need (and have permissions to).

Iframes v FBML - Why transfer?

I have lots of Facebook Fanpages, and I have been told on many occasions to change to iFrames. Facebook developing isn't really my main thing so I havent kept upto date with the change as FBML worked for me.
I have asked a recent question about rotating images and it seems that iFrames will be able to handle this.
Can you tell me what are the good things about iFrames?
Is there an iFrame service without thirdpart branding (i.e WildFire logo at the bottom of page)
Thanks for your help
You should be switching as soon as possible from fbml fan pages to iframe fan page because the FBML pages have been deprecated (you can't create new fbml pages) and it is likely Facebook will start killing FBML page support for existing pages, with little to no notice.
The biggest benefits are almost all javascript code will run now and without making a user first click somewhere. Laying out pages is a lot cleaner. And you don't have to learn the fbml tags. You just make a web page like you normally would and it should run just fine, as long as you understand that iframe code is sandboxed due to cross domain limitations so you can't try to modify its parent (the Facebook page)
I don't know of any iFrame services, but iFrame pages are so simple - you just host a plain html file or webpage somewhere on a server anywhere and tell Facebook the url for it. Do note though that the site it is hosted on should have an SSL certificate for users that visit your page with HTTPS enabled on their Facebook account.

Difference Between Facebook App Page and Facebook Page

I have created a Facebook page for our business, and I created a Facebook App to get a AppID in order to use it in the Facebook plugins.
I've noticed that a Facebook App has a page which looks the same as a Facebook Page.
Which one should I use for promoting to the public? The App Page or normal Page?
You should be promoting your business page. That's what people will be searching for.
Essentially, all objects within the Facebook sphere are represented by a Page. Your app gets one of it's own which, if you were so inclined, would mean you could use it to promote your application. I would also recommend locking down your application's Page so the wall doesn't get filled with spam and other dubious and possibly malicious links. You can do this in the Page settings.
Promote the normal page(www.facebook.com/pages/yourpagename). The application page is where you would promote the application you built but it sounds like you just need a appid.
A significant difference between an app page vs a normal page: the app page does not show the number of people who 'like' it. It shows the number of MAU instead.
You have to promote the normal Page. In the normal page you can add a tab that link your application.
One other bit of information: If you create an ad in facebook which links to your page then it will have a like button and will show the current number of people which like your page when it is served to people.
If you have an app then it will not have the like button, but if people use your app then when an ad is served to someone that has a friend that used the app they will see a social context in the ad 'jonny B used(or played if a game) your [app/game name]' at the bottom of the ad.