Share button count has reset to zero after switching to ssl (https)

Nytshade

Well-known member
Registered
Joined
Jan 22, 2015
Messages
503
Points
0
Hey guys, I need some help with recovering my social shares. After moving to ssl, my main php script is working fine. On my wordpress blog (which is in a folder (domain.com/folder)) everything seems to be working fine except that my sharing buttons have reset count, all my social shares are gone.

Not just one sharing buttons but all, linkedin, twitter, facebook, g+ etc.

I asked my host to do everything for me, all I did was to buy the ssl from a third party not the web host provider. It's been a couple of days and I'm not sure if the guy is going to find a fix. Please help guys because this is starting to affect my amazon sales, and now I see that the social shares did play a role to increase conversions.
 

Maxwell

Well-known member
Registered
Joined
Mar 5, 2013
Messages
189
Points
28
Https and Http are two different URLs hence when you switched to https then number of shares on your social share buttons reset to zero.

It happened this because you shared old URLs with Http, the counts will only show on http. It is impossible to show the counts in this case

If someone has a tricky to show button counts for old urls (http) when switching to https then I also would to know about it.
 

fwh

Administrator
Staff Member
Joined
Dec 8, 2012
Messages
773
Points
63
Hey guys, I need some help with recovering my social shares. After moving to ssl, my main php script is working fine. On my wordpress blog (which is in a folder (domain.com/folder)) everything seems to be working fine except that my sharing buttons have reset count, all my social shares are gone.

Not just one sharing buttons but all, linkedin, twitter, facebook, g+ etc.

I asked my host to do everything for me, all I did was to buy the ssl from a third party not the web host provider. It's been a couple of days and I'm not sure if the guy is going to find a fix. Please help guys because this is starting to affect my amazon sales, and now I see that the social shares did play a role to increase conversions.
If you are using wordpress cms then you can use this code and put them into functions.php in your WP theme

Code:
function httpurl( $url ) {
	return preg_replace( '/https:/i', 'http:', $url );
}
Code:
function https_to_http() {
	$url = get_permalink(); 
	$url = httpurl( $url ); 
        return $url;
}
Now on your template, you can find data-url and adding https_to_http function to social script where to show number of shares on social network with old URLs (http).

Hope it helps!
 

elcidofaguy

Well-known member
Registered
Joined
Jan 13, 2015
Messages
866
Points
0
elcidofaguy

Nice one! It might work - but I suspect what will happen is that all web pages will redirect to http and hence there is no point in even having https in the first place.... Curious to know if it can... That said its a good place to insert additional code which you can place the iframe if need be and further you could add additional logic to check for the type of page/post e.g. check if its a post with specific tags then implement your new method....

With the iframe approach at least the URL displayed will be https and you can then embed the old URL as how you want... Just in case here is an example of the iframe code:

Code:
        <div id="content">
            <iframe width="100%" height="100%" frameborder="0" src="http://mywebsite.com" />
        </div>
In the above example an entire page is captured... You can also capture portions and position it with using div tags i.e just encapsulate the social media plugin....

Will it work ....? Nytshade buddy do keep us posted ;-)
 

elcidofaguy

Well-known member
Registered
Joined
Jan 13, 2015
Messages
866
Points
0
Just reading more into this... Its not that straightforward with embedding http into https... It can be done but you need to do it by proxy e.g.

Code:
[URL=https://mysite.com]https://mysite.com[/URL] That has a iframe linking to...

[URL=https://mysite.com/utilities/redirect.html]https://mysite.com/utilities/redirect.html[/URL] Which has a simple js redirect script like...

document.location.href ="http://mysite.com"
I found this article which may help others....
 

fwh

Administrator
Staff Member
Joined
Dec 8, 2012
Messages
773
Points
63
Nice ones, Sid!

I would like to give Nytshade any better ideas to count SHAREs on both http and https.

I will not show the details with code, only show ways you can do with it. :D

Firstly, this is important for you to decide, should count shares from https or http.

You will use some lines of codes to count the shares from old urls (http) and see it if the counts > 5 or > 10 then you will use http.

If the count is lesser than 5 then you will use new url (https) for sharing to social networks.

I want to show this because if the counts on your old URLs lesser than 5 then it's not necessary to show the count and you can use https for new shares and get new counts.

Cheers,
 
Older Threads
Replies
10
Views
6,168
Replies
2
Views
2,616
Replies
9
Views
3,807
Newer Threads
Latest Threads
Recommended Threads

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top