Migrating Http To Https With Addthis – Retain The Social Share Count Numbers

social share counts

What Is It?

It is really frustrating when you migrate your popular website from HTTP to HTTPS because you just want to add security, and suddenly your famous website pages lose the massive share counts! “Now what, Shall I be unsecured to be popular?” will be the first thought popping up in your mind. But that is not the solution, we can’t disable SSL.

I decided to keep the website on HTTPS, without worrying about the social status for a few days and spent some time researching this a bit. The problem is very simple,

Social websites treat each URL unique, including the protocol! So, http://y.com and https://y.com will be different!

So obviously the share counts will be different, and also the future shares will be tracked separately. Though I have AddThis to generate social sharing buttons and counters, it actually uses the social network’s support to do that. Then how can we fix it?

How to Fix It?

Each social network treats the shared URL tracking in diff. ways, I have verified this on Facebook and Pinterest and found that they return diff. counts for the same URL but diff. protocols. Somehow LinkedIn has this thing correct!

Facebook

To check facebook’s share count, we can access http://graph.facebook.com/, which will fetch the shares for HTTP URL. Further, Facebook reads the page URL from meta tag ‘og: URL’ and ‘canonical’ tag as suggested here and also in facebook’s help pages. But this would only fix the issue for only Facebook, for others we anyway need to find a better way.

After doing much research, I found the Addthis documentation showing a javascript method supported to fetch social share counts for diff. service providers for a given URL.

The Solution

This issue can be solved in diff. ways,

Finally, after evaluating all the possible solutions we decided to take the last approach, Where I can fetch the social share counts for the given page from Facebook, Pinterest, Reddit and Delicious for Http URL and add them up using javascript in the https count Addthis has generated. We would need to do the following steps,

Finally, we have retained the Http URL share counts, no changes in the configurations of AddThis OR meta tags are needed.

Sometimes, Javascript can help where nothing else seems to help, so keep scripting!

Click here for more blogs

At BoTree Technologies, we build enterprise applications with our Development team of 70+ engineers.

We also specialize in AI, ML, Ruby on Rails, Python, Django, Spree commerce, NodeJs and ReactJS.

Consulting is free – let us help you grow!

Related posts

Top 7 Insurance Technology Trends to know in 2023

by Shardul Bhatt
4 years ago

The Pros and Cons of Microservices in Software Development

by Shardul Bhatt
3 years ago

Team as a Service (TaaS): The Agile Approach to Scaling Your Business

by BoTree Technologies
3 months ago
Exit mobile version