CMS Development

IamHamidd
Mitglied

How to overwrite/replace the auto-generated Open Graph Tags (OG Tags) on HubSpot?

lösung

I would like to change the image and title of our social media post-sharing for a few web pages/blogs. Is there a way to overwrite or replace HubSpot's current auto-generated open graph tags (OG tags)? Could you please let me know if you have any other alternative ideas to implement? Website

 
0 Upvotes
1 Akzeptierte Lösung
Anton
Lösung
Trendsetter/-in | Diamond Partner
Trendsetter/-in | Diamond Partner

How to overwrite/replace the auto-generated Open Graph Tags (OG Tags) on HubSpot?

lösung

Hi @IamHamidd., 

 

Yes - it's possible. To give users a easier access to them I've written a custom module a while back. 

You can grab it from my github here.

 

 

best, 

Anton

Anton Bujanowski Signature

Lösung in ursprünglichem Beitrag anzeigen

3 Antworten
Anton
Lösung
Trendsetter/-in | Diamond Partner
Trendsetter/-in | Diamond Partner

How to overwrite/replace the auto-generated Open Graph Tags (OG Tags) on HubSpot?

lösung

Hi @IamHamidd., 

 

Yes - it's possible. To give users a easier access to them I've written a custom module a while back. 

You can grab it from my github here.

 

 

best, 

Anton

Anton Bujanowski Signature
BarryGrennan
Stratege/Strategin

How to overwrite/replace the auto-generated Open Graph Tags (OG Tags) on HubSpot?

lösung

Very cool module @Anton!

 

Out of interest, why do you use the jQuery append method vs hubl require_head? Something to do with the order it would place them in?

 


profile2022aBarry Grennan

Freelance HubSpot CMS Developer

Website | Contact

 

 

Anton
Trendsetter/-in | Diamond Partner
Trendsetter/-in | Diamond Partner

How to overwrite/replace the auto-generated Open Graph Tags (OG Tags) on HubSpot?

lösung

Thank you @BarryGrennan

Yeah - It might have a loading order effect.

For my knowledge require_head will put the code into standard_header_inlcudes and when writing something for everybody where you don't know if standard_header_include is before or after everything necessary, the jQuery append method can be better. Otherwise the defaults from HubSpot would override it again 🙂 But thank you for the tipp - I'll think about updating the module.

 

Also: Feel free to modify it. 

 

p.s: Would really appreciate some credits 😊

 

best, 

Anton

Anton Bujanowski Signature