Sometimes when a link is published on certain platforms like Skype, LinkedIn or Twitter, a preliminary view of the linked webpage is shown, usually containing an image a title and a description. The publisher of the link may not control this view because is linking third party content and the autogenerated view may not suit the situation or it may not be the expected one.
OGPFake makes easy for any link publisher to add or change the information that platforms use to generate link previews. This way any publisher can gain control over how their links are shown. On top of that, Google Analytis can be added to gather information about the traffic and popularity of the links as well as information about the profile of the people clicking on them.
Link previews are based on a special protocol developed by Facebook (Open Graph Protocol), which is frequently used by SEO and SEM specialists to decide how their content is going to be shown when linked. This protocol is based in special meta tags in HTML header that provide enough information for knowing which image, title and description show when a link is shared. OGPFake provides a web redirection containing custom OGP tags as well as a Tracking ID of a property of Google Anlytics. This way, when linking through OGPFake, OGP tags will be added or overriden and information about the event will be stored in Google Analytics.
OGPFake is a Django app and can be deployed anywhere you want, but Heroku is a very good place to deploy it. You can download the repository and deploy it manually or click on this button:
This is really useful, because you could use the same free Dyno to manage all links, because they are configured using enviromental variables:
This enviromental variables are specified in each link, to define the title, description, image, tracking ID or destination of each link:
https://[Heroku app name].herokuapp.com/?ga_tracking_id=[Tracking ID variable name]&title=[Title variable name]&description=[Description variable name]&url=[Destination URL variable name]&image=[Image variable name]
You can add any enviromental variable you need and reutilize them in more than one link (GET parameters can appear on the link in any order). Is important to know that, in Heroku, the maximum size of all config vars combined must be less than 32KB.
If you want to deploy OGPFake in other sites different from Heroku, you will need to device enviromental variables in the required way.
In Skype:
In Twitter card:
In LinkedIn:
At this moment, supported OGP tags are:
og:title / twitter:title
Link preview title.
og:description / twitter:description
Link preview description
og:url
URL to the content to share. This URL will be also the destination of the redirection.
og:image / twitter:image
Link preview image. For almost every platform, image size needs to be under 5MB.
This web apps are useful to test links and check all OGP information is correct before sharing them:
If in any case, any tag is not being show properly, you may need to force a cache clear (reference in Spanish) by adding a random GET parameter to the link.
MIT License
Copyright (c) 2018 Noemi Escudero del Olmo, https://github.com/Naeriam
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.