title: Dynamically show Facebook Open Graph using URL query string
body: <p>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.</p>
  
  <p>When you click a coupon it will redirect you to the page <code>coupondetail.php?cid=248</code> (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 <code>?cid</code> shared.</p>
  
  <p>This is actually the way I personalize them using PHP:
  (Mycouponapp is a sample name!).</p>
  
  <pre><code>  &lt;head&gt;
      &lt;meta charset="ISO-8859-1"&gt;
      &lt;title&gt;Coupons&lt;/title&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US" xmlns:fb="https://www.facebook.com/2008/fbml"&gt; 
  &lt;head prefix="og: http://ogp.me/ns# mycouponapp: 
                    http://ogp.me/ns/apps/mycouponapp#"&gt;
    &lt;meta property="fb:app_id" content="*appid*" /&gt; 
    &lt;meta property="og:type" content="mycouponapp:reward"/&gt; 
    &lt;meta property="og:title" content="&lt;?php echo $couponname; ?&gt;" /&gt; 
    &lt;meta property="og:image" content="http://www.mycouponapp.com/&lt;?php echo $couponimgurl; ?&gt;" /&gt; 
    &lt;meta property="og:description" content="&lt;?php echo $couponname; ?&gt;" /&gt; 
    &lt;meta property="og:url" content="http://www.mycouponapp.com/coupondetail.php?cid=&lt;?php echo $cid; // coupon id ?&gt;"&gt;
  </code></pre>
  
  <p>Ten days ago I was testing the website and I set a static <code>og:title</code>, 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 <em>couponname</em> on Mycouponapp". </p>
  
  <p>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!)</p>
  
  <p>Also, if I click of the "Sample Reward" text I will be redirected to <code>http://www.mycouponapp.com/coupondetail.php?rid=</code> and as you can see there is not <code>Cid</code> at the end.</p>
  
  <p>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.</p>
  
  <pre><code>&lt;script&gt;
   function postCoupon()
    {
  
     FB.login(function(response) {
     if (response.authResponse) {
  
        FB.api(
          '/me/_AppName_:get?reward=http://www.mycouponapp.com/coupondetail.php?cid=&lt;?php echo $rid; ?&gt;',
          'post',
          function(response) {
             if (!response || response.error) {
                console.log(response.error);
             } else {
  
                alert('Pook was successful! Action ID: ' + response.id);
             }
          });
          }
   }, {scope: 'publish_actions'});
  
  
    }
    &lt;/script&gt;
  
    &lt;script&gt;
      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
        });
      };
  
  
  
    &lt;/script&gt;
  </code></pre>
  
  <p>What's wrong in my code? Thanks!</p>