Facebook like on logged-in website content

Posted on 2013-01-05
Last Modified: 2013-01-10

I have a list of products on a website. The website is built using PHP and mySQL. In order to view any part of a product page, a user must be logged into my website...if the user is not logged in then the login page loads up.

Each product has a Facebook Like button on its page, added using the IFrame method. The idea is that a "Like" will add a Facebook wall link to this exact product URL.

My problem is that when the Like button is pressed, Facebook posts that the signin page was liked, and not the actual product URL.

I can't allow non-logged-in people to see my products and I must also have the Facebook Like working as described.

Has anyone else ever had the same issue and found a way around it? The only thing I can think of is to show the page to non-logged-in users and hide/blur the content I don't want them to see.

Many thanks
Question by:kbit
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 53

Expert Comment

ID: 38746912
You have painted yourself into a corner.  The like is on the login page, and that is the url that is going to be sent.  It sounds like you are trying to force users to like things just to access them, and that kind of behavior really is a questionable practice that borders on scamming users.


Author Comment

ID: 38746925
The idea of having the like is to raise awareness of the site on Facebook.

If within Facebook, people click on a product that a friend of theirs liked, they arrive at my site and have the option of signing up, signing in or ignoring.

There is no scam, all I'm trying to do is get Facebook to show the content I want it to show.

It's extremely similar to arriving at an Experts Exchange question and not being able to view the solutions unless you sign up/in.
LVL 53

Assisted Solution

COBOLdinosaur earned 500 total points
ID: 38747023
It's extremely similar to arriving at an Experts Exchange question and not being able to view the solutions unless you sign up/in.

Yeah well in case you didn't notice EE does not show up much in searches any more, because Google de-index all content that was blocked by the pay wall and downgraded the ranking of the site.  That is also what they will do to you.

As for Facebook they are not going to let you post whatever link you want when someone clicks on the login page.  They are only going to post the product url if the like button is on the product page and the user clicks it.

"There is no scam, all I'm trying to do is get Facebook to show the content I want it to show."

That in fact is scamming you are trying to lie to Facebook about where the user click the like button so you can post links to promote your products.  Facebook is in the advertising business, they are not going to let you post your ads unless it is within the limits of their ToS.  If you want ads on Facebook, they will be happy to sell you a campaign.  They are not going to let you force users to like things involuntarily; and I suspect the first time someone complains about it they will block you.

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.


Accepted Solution

kbit earned 0 total points
ID: 38747050
Well thanks for the comments anyway, particularly the one about Google lowering the website's rank...I'll pass this on to the website's owner.

Through trial and error it seems that once your webpage can display the Facebook meta properties, it's enough to be shown correctly on Facebook. So for now I've put in an IF statement on the webpage that tells the user they must sign up/in in order to view the product. This allows the Facebook like to like the correct page (and show the product name and image) without showing all my product's details.
LVL 110

Expert Comment

by:Ray Paseur
ID: 38747191
I noticed that you have a close request pending for this question, but I'd like to offer one anecdote from last year's MoDevDC conference on navigation and client relations.  One of the presenters told us about an experiment which took the "register/sign-in" component of a well-known ecommerce site completely out of the buying process.  The client was anonymous right up to the point of entering shipping and payment details.  When the conversion rate (actual purchases) for this experiment was benchmarked against the site's earlier requirement to register before creating a shopping cart, it was discovered that the value of moving the "register" button from the front of the shopping experience to the back of the shopping experience was $300,000,000 per year.  The site now sends a follow-up email a few weeks after you have received your products, asking you to review the products and give feedback.  That's where your Facebook "like" button should go.

Who is this smart company that figured out how to sell without appearing manipulative?

Author Closing Comment

ID: 38762298
Came up with a workaround as described above

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Part of the Global Positioning System A geocode ( is the major subset of a GPS coordinate (, the other parts being the altitude and t…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question