ash-jc-allen / short-url

A Laravel package for creating shortened URLs for your web apps.
MIT License
1.25k stars 157 forks source link

Open Graph meta tag #207

Closed bhekor closed 1 year ago

bhekor commented 1 year ago

Hi,

Great package, well done!

Please is there a way to add meta description to most especially og_type, og_title, og_description, og_image etc? For a better experience on social media sharing.

Thanks.

ash-jc-allen commented 1 year ago

Hey @bhekor, thank you for the kind words! 😄

As far as I'm aware, the meta information like that is pulled through from the destination page's HTML that you'll be redirected to. So I don't think this is something that can be added to the links.

For example, I have a short URL on my website that redirects user's to my Fathom Analytics referral link: https://ashallendesign.co.uk/s/fathom-analytics-sidebar

When I put this URL into an Open Graph check website, I get the following results: https://www.opengraph.xyz/url/https%3A%2F%2Fashallendesign.co.uk%2Fs%2Ffathom-analytics-sidebar

If I'm wrong on any of this though, I'm happy to take suggestions for changes 🙂

bhekor commented 1 year ago

You are welcome 🙏,

Yeah, I understand, I saw this company Linklyhq that offers the service to generate a short link with an open graph meta among other things, so I thought there was a way to create it without having to create an extra page.

After some little research, basically what they're doing is populating those meta information into a static(with dynamic data) page that loads first before redirecting the user to the original main URL.

I have not dug into this package yet 😅, but I believe you've got a page or something that probably loads before redirecting the users as well, we can make use of that. I guess 🤔