I have a page that is mostly rendered through json data. The url passes an id, and receives json data populating the page and updating the url with parameters.
How would I dynamically update the opengraph data (as at first all I have is the id to pass, no actual data) when the json renders?
thanks
You cannot update the og meta tags after the initial HTML response comes from the requested url. Remember the Facebook linter does not run javascript, so it would not be able to pickup on any og tags.
Your web server will get a specific user agent string, See When does Facebook scrape my page? of https://developers.facebook.com/docs/reference/plugins/like/ and your server will need to send back the proper OG meta tags when it requests your unique page.
It’s always easiest to do things when you have canonical urls that mirror the pages that can be gotten via AJAX calls.
Check into URL rewriting.