how to get branch to re-scrape page meta tags

Answered Asked on May 18, 2016 in Technical.

How can I get branch.io to re-scraper my page for the meta tags. It has an old picture that needs to be updated.

MakeSpace — Developer
4 Answer(s)
Best answer Answered on May 19, 2016.

Ahhh, perfect! If you append ?debug=true to the end of that link, you can see a full readout of all the data parameters stored inside.

Here’s how the system works: when your URL is initially scraped after the link is created, we actually hard-code the meta tags we find straight into the data for that link. We don’t have a way to trigger a rescrape, but we do have an API to update existing links. You can find the documentation for that here. You’d just need to manually change the $og_image_url parameter value for that link to the new image you want to use.

I went ahead and did this for the link above. The CURL command I ran to do it is here:

curl -X PUT \

\

-H "Content-Type: application/json" \

\

-d '{"branch_key" : "INSERT_YOUR_KEY_HERE","branch_secret":"INSERT_YOUR_SECRET_HERE","data": "{\"$og_image_url\": \"https://cdn.makespace.com/s/img/common/makespace-was-here-blue.jpg\"}"}' \

\

https://api.branch.io/v1/url?url=http%3A%2F%2Finv.mksp.io%2FxHon%2FOETrbYlb9s

Hope that helps!

Branch — Developer
Commented on August 4, 2017.

When I run this CURL command, the previously scraped tags are disappearing. I have more specifics on my issue here:

Developer
Answered on May 19, 2016.

Aha! I figured it might be something like that….thanks very much!

MakeSpace — Developer
Commented on May 19, 2016.

My pleasure! Glad to help 🙂

 

Branch — Developer
Answered on May 19, 2016.

Hi!

Where are you seeing the old picture? If it’s when sharing on Facebook, you might actually be running into their cache. You can flush it out using the Open Graph Object Debugger.

If this issue is showing up somewhere else, could you share the link that is causing problems, and more details on how you set the meta tags initially? For example, was it when creating the link via the SDK in your app, or through a marketing link on the dashboard?

Branch — Developer
Answered on May 19, 2016.

So…unfortunately, there are multiple hops of indirection….but ultimately we get this:

 

https://bnc.lt/xHon/OETrbYlb9s?_referrer=twitter

 

which is interesting because we use a custom domain.

Originally it will have been a link created through the API .

MakeSpace — Developer