Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8116829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:57:20+00:00 2026-06-06T03:57:20+00:00

I’m developing a web app where users can get coupons and similar things. I

  • 0

I’m developing a web app where users can get coupons and similar things. I need to publish with Open Graph using the Javascript sdk an action each time an user choose and request a coupon.

When you click a coupon it will redirect you to the page coupondetail.php?cid=248 (Where “Cid” is the Coupon ID ). Actually I personalize the og meta tags with PHP: In this way Facebook should scrape a different content for each ?cid shared.

This is actually the way I personalize them using PHP:
(Mycouponapp is a sample name!).

  <head>
    <meta charset="ISO-8859-1">
    <title>Coupons</title>
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US" xmlns:fb="https://www.facebook.com/2008/fbml"> 
<head prefix="og: http://ogp.me/ns# mycouponapp: 
                  http://ogp.me/ns/apps/mycouponapp#">
  <meta property="fb:app_id" content="*appid*" /> 
  <meta property="og:type" content="mycouponapp:reward"/> 
  <meta property="og:title" content="<?php echo $couponname; ?>" /> 
  <meta property="og:image" content="http://www.mycouponapp.com/<?php echo $couponimgurl; ?>" /> 
  <meta property="og:description" content="<?php echo $couponname; ?>" /> 
  <meta property="og:url" content="http://www.mycouponapp.com/coupondetail.php?cid=<?php echo $cid; // coupon id ?>">

Ten days ago I was testing the website and I set a static og:title, calling it “Sample Reward”. Even if I changed the code, today when I publish an action using Javascript it still shows “Matteo got Sample Reward on Mycouponapp”, instead of showing “Matteo got couponname on Mycouponapp”.

I already used the Facebook debugging tool to try scraping again the content, but it doesn’t work (Even if the debugging tool shows a correct Coupon detail!)

Also, if I click of the “Sample Reward” text I will be redirected to http://www.mycouponapp.com/coupondetail.php?rid= and as you can see there is not Cid at the end.

I really can’t understand why. I clip my JavaScript code: Maybe the problem is on that!
The Facebook JS SDK was already loaded before this.

<script>
 function postCoupon()
  {

   FB.login(function(response) {
   if (response.authResponse) {

      FB.api(
        '/me/_AppName_:get?reward=http://www.mycouponapp.com/coupondetail.php?cid=<?php echo $rid; ?>',
        'post',
        function(response) {
           if (!response || response.error) {
              console.log(response.error);
           } else {

              alert('Pook was successful! Action ID: ' + response.id);
           }
        });
        }
 }, {scope: 'publish_actions'});


  }
  </script>

  <script>
    window.fbAsyncInit = function() {
      FB.init({
        appId      : '_App Id_', // App ID
        status     : true, // check login status
        cookie     : true, // enable cookies to allow the server to access the session
        xfbml      : true  // parse XFBML
      });
    };



  </script>

What’s wrong in my code? Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T03:57:22+00:00Added an answer on June 6, 2026 at 3:57 am

    At this point, probably the best thing to do is to change your url scheme to something like mycouponapp.com/coupondetail/248 so each coupon has a unique url.

    You could do that either by rewriting your urls in your .htaccess file or changing the url scheme of your PHP app.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
We're building an app, our first using Rails 3, and we're having to build
I have thousands of HTML files to process using Groovy/Java and I need to
I am using Paperclip to handle profile photo uploads in my app. They upload
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
In my XML file chapters tag has more chapter tag.i need to display chapters

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.