0

This is driving me mental! I have page which has a share button on it, for arguments sake I have hard coded the image name and title in the controller as shown here

 public ActionResult ThankYou()
    {
        var model = new LabCombination
        {
            ImageCombination = "danone_ultimate_coconut_vanilla.png",
            ImageTitle = "danone_ultimate_coconut_vanilla"
        };

        return View(model);
    }

In my view I do this

  <meta property="og:title" content="Check out the flavour I just made! @Model.ImageTitle" />
  <meta property="og:description" content="Check out the flavour I have just created!" />
  <meta property="og:image" content="http://danone.staging-eurorscg.com.au/Content/Images/FlavourLab/CombinationSmall/@Model.ImageCombination" />
  <meta property="og:url" content="http://danone.staging-eurorscg.com.au/thank-you" />

which renders as follows

 <meta property="og:title" content="Check out the flavour I just made! danone_ultimate_coconut_vanilla" />
 <meta property="og:description" content="Check out the flavour I have just created!" />
 <meta property="og:image" content="http://danone.staging-eurorscg.com.au/Content/Images/FlavourLab/CombinationSmall/danone_ultimate_coconut_vanilla.png" />
 <meta property="og:url" content="http://danone.staging-eurorscg.com.au/thank-you" />

When I do the facebook scraper I see this enter image description here

yet when I go to the page a press share I see this

enter image description here

Why is facebook not refreshing! I have cleared the cache in my browser!

You can scrap the page here

https://developers.facebook.com/tools/debug/og/object/

with the following url

http://danone.staging-eurorscg.com.au/thank-you

Any help would be appreciated

** Update ** As I set the mete data dynamically, it caches the original information as shown here, what you see in the middle of the screen i.e the image should be also displayed in the shared dialog

enter image description here

My Meta data looks like this

 <meta property="og:title" content="Check out the flavour I just made! Strawberry &amp; Honey" />
<meta property="og:description" content="Check out the flavour I have just created!" />
<meta property="og:image" content="http://danone.staging-eurorscg.com.au/Content/Images/FlavourLab/CombinationSmall/danone_ultimate_strawberry_honey.png" />
<meta property="og:url" content="http://danone.staging-eurorscg.com.au/thank-you" />

As you can see it has all the correct meta data.

Code Ratchet
  • 5,758
  • 18
  • 77
  • 141

3 Answers3

0

That is because your share button is trying to share the url http://danone.staging-eurorscg.com.au/flavour-lab and not http://danone.staging-eurorscg.com.au/thank-you

WizKid
  • 4,888
  • 2
  • 23
  • 23
  • that's the page I want to share, so when the user shares it on FB I don't want the user to click it and be taken to the thank-you page, I want them to go to the falvour lab page – Code Ratchet Feb 25 '15 at 23:18
  • Ok I have it working, but facebook is still caching the previous content as shown in my update, you can see I have selected strawberries and honey, yet when shared it displays coconut, even my meta data is correct.... – Code Ratchet Feb 25 '15 at 23:32
  • Yes Facebook caches the title. So don't change it every second. – WizKid Feb 26 '15 at 01:18
  • The title needs to change see my question regarding clearing meta data http://stackoverflow.com/questions/28732397/clear-facebook-meta-data-instantly as I need it to clear – Code Ratchet Feb 26 '15 at 01:25
0

Add the following og meta tag, with the current epoch time:

<meta property="og:updated_time" content="1431713584" />
Circadian
  • 559
  • 4
  • 4
0

You can force Facebook to update it's cache using debugger tool. It used to be called url linter.

https://developers.facebook.com/tools/debug/

Mika Tuupola
  • 19,877
  • 5
  • 42
  • 49