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

Nytshade

New member
Joined
Jan 22, 2015
Messages
743
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

New member
Joined
Mar 5, 2013
Messages
397
Points
0
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.
 

elcidofaguy

Well-known member
Joined
Jan 13, 2015
Messages
1,281
Points
113
elcidofaguy

Indeed its two separate URLs i.e. http vs. https - they may be a solution however... From the top of my head I would look into iframes as a means to show the stats for the old URL... That way you can embed a http url within the https parent page...

Alternatively I would remove https on pages where you do not need it i.e. product description pages etc. and only use it on pages where you capture user information.
 

wms

Administrator
Staff member
Joined
Jul 7, 2012
Messages
845
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
Joined
Jan 13, 2015
Messages
1,281
Points
113
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
Joined
Jan 13, 2015
Messages
1,281
Points
113
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:
[URLnf=https://mysite.com]https://mysite.com[/URLnf] That has a iframe linking to...

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

document.location.href ="http://mysite.com"
I found this [URLnf="http://stackoverflow.com/questions/18327314/how-to-allow-http-content-within-an-iframe-on-a-https-site"]article [/URLnf]which may help others....
 

wms

Administrator
Staff member
Joined
Jul 7, 2012
Messages
845
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
4,730
Replies
2
Views
3,071
Replies
3
Views
3,833
Latest threads
Replies
2
Views
368
Replies
1
Views
366
Replies
4
Views
1,888
Replies
3
Views
794
Recommended threads

Referral contests

Referral link for :

Sponsors

Popular tags

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