Preserve Google +1, Facebook Like, and Twitter Tweet This button counts after URI change
Asked Answered
S

6

11

My question is very simple: is there any way to (programmatically, technically, or manually) make a Google +1, Facebook Like, or Twitter Tweet This button preserve its count after a change of URI?

Programmatically: Doing something with the javascript to make it show the combined counts of two URIs while posting the new action to only the latter.

Technically: Do they detect and follow a 301 redirect from the original resource? Is there any special text I can include in the HTTP header to tell them that they should move all "points" from the old URI to the new one?

Manually: Some form somewhere on their site that I can submit or someone I can email that will be able to copy our points over to the new URI?

(note that I use URI and not URL in this question on purpose. The canonical resource link is changing from something.php?id=idnumber to /mycoolproduct/)

EDIT

Bounty started, but don't answer with "it can't be done"

Slither answered 18/11, 2011 at 6:35 Comment(0)
B
1

Unfortunately, there is no solution for this. We have tried all possible solutions and you will simply lose your social equity if you do a 301 Redirect. We found it to not be worth the hassle of trying to maintain our vote counts, and have instead pointed our buttons to the homepage in the interim of moving to the new url structure.

Brueghel answered 26/3, 2012 at 23:5 Comment(1)
Same conclusion here. Just not possible, which is, in all honesty, plain ridiculous. I cannot believe that none of these companies even gave this topic enough thought to mention it in their FAQ or support system.Slither
P
8

I believe there is only one solution that fits your request above universally. That solution would be to 301/302 the old URIs to the new URIs and then keep using the old URIs with your social buttons. All the major social buttons allow you to specify the URL for which to like/g+/tweet/etc. This would preserve your existing social share counts and all shared posts would still direct to the same page. The choice now becomes whether to 301 or 302 redirect. A 302 may help preserve current search placement and avoid loosing your ranking if its pretty good. A 301 redirect (moved permanently) will cause search engines to start indexing your new URLs and dropping the old ones. This might cause a loss in current search rankings. It appears that as of this post, nobody is honoring redirects for social votes of any kind.

So I think the the safest route is to 302 redirect and continue to use the old URIs for social votes. You will keep your equity this way, but must maintain your redirects and become even more invested in the old URI template. How are your redirects implemented? .htaccess? or in page? You will need to weigh the cost-benefits for your case.

Otherwise you should probably 301 and start using the new URIs for your social buttons. In this case you might loose your social equity, but are free to build new without fear of messing up anything. If the social equity you are replacing can be recouped in say 6 months or less I wouldn't bother with it and start fresh.

However, this brings up an interesting point. You mentioned programatically adding two counts. Well yes, you could put together some JavaScript to add a couple counts together, but I gotta ask why? Adding them together for visual display purposes will not actually help increase referral traffic or search ranking. So its just a facade that I don't think helps you. If you're just looking to fool your visitors into thinking you're popular, why not just generate an image server side that keeps counting up. (bad joke, don't do it!) Bottom line you can't actually redirect your social equity, you may be able to pretend to have moved it, but you can't actually.

Considering your original question asks about several social buttons, its important to note that even if one or two of these services started honoring redirects when applying social votes, it wouldn't relieve you from making the decisions above. You'll still need the redirects for existing backlinks, and if you are supporting multiple social buttons on your page the choice of redirect type will need to be made with all of the social buttons in mind.

Prepotent answered 24/11, 2011 at 7:7 Comment(4)
I'm already redirecting via 301 the old links to the new. I already used the method you're discussing, but it doesn't work since it only captures new "votes" made by using the buttons on our site, users copy-and-pasting the /mycoolproduct/ link into a tweet or fb post doesn't count, because the widget on that page wouldn't be accessing the votes for the new uri, only for the old one.Slither
I'm not sure there is a perfect solution for you. Considering you've already 301'd your old links, I'd forget about trying to keep the old social equity - its likely only visual at this point anyways and not contributing to your rankings anymore. Just use the new URIs for your social buttons. The 301s are done, you can't really change your mind now. At this point, this suggestion won't change anything except the visual number reported on your page, everything else is already past the point of no return.Prepotent
I think you're missing the point of my question if you think it's past the point of no return. I need to 301 redirect /dl.php?id=1 to /mycoolproduct/ and my question is how can I move or join the points given that I'm redirecting. I want to know how I can tell Google/FB/Twitter to merge or move the points for these two URIs and how I can report the combined count in the on-page widgets.Slither
@MahmoudAl-Qudsi I think you missed the point of the answer. :) This cannot be done and is documented across the internet - do a google search. The only option you have is to "spoof" the count number on your local page by adding the old count to the new one with some tricky JavaScript. But that will be a lot of work and won't provide any benefit to you except to look nice on your page. It won't actually apply the likes/g+ from the perspective of facebook and google. They've both already discounted old social votes if their indexes have been updated since your 301-redirects.Prepotent
D
2

I can't speak for how to do this with Twitter/G+ but for Facebook:

You can't 'move' the likes and comments between URLs, and for new content you should definitely start using the new URLs, but for your existing URLs you can still have the original like counts/comments work if you:

  • Continue pointing the Like button on the new URL to the old URL (i.e <fb:like url="http://oldurl"/>
  • Add an exception to your redirect code so that when Facebook's crawler (facebookexternalhit/1.* - currently 1.1) accesses it, the original set of open graph meta tags are displayed (this will keep the description, title, thumbnail, etc, working as before)
  • Other users that land on the 'old' URL will still be redirected to the content in its new location
Dwightdwindle answered 24/11, 2011 at 20:31 Comment(2)
This is unnecessary as the opengraph meta tags have not changed. And it misses the real problem: people will share my link from outside my page (I never had a like button on my page before, yet still managed to amass a great number), and this will only show the tally of the old page.Slither
No, If the like button on the new page points to the old URL, Facebook's crawler will go to the old URL, use the meta data there and update the like/share/comment count for the old URL, but this will be displayed on the actual like button you've installed onto the new page If you don't do this, Facebook will follow the 301/302 redirect frrom the old URL to the new URL and increment the counts for the new URL, which will lose your existing likes, etcDwightdwindle
O
2

I have a real solution to this problem it might not be the most conventional but it does work 100%. Using a simple jQuery plugin called sharrre. Keep in mind I'm not the best jQuery coder (If you see improvements please let me know!) but this works regardless.

Here is how I did it on my site:

Using the sharrre plugin you can add the current share count to any element on your page. I simply got the data for both URLs then added them together and displayed them on the like, tweet, share, etc buttons.

This example is with Twitter but I'm doing this with Facebook, Google Plus, Pinterest and Linkedin. Here is the code:

<li id="twitter" data-url="CURRENT-URL" class="twitter sharrre"></li>

<li id="twitter-old" data-url="OLD-URL" class="twitter sharrre" style="display: none;"></li>

Then I called sharrre's code:

$(function(){ sharrreItUp(); }

This is how my function looks on my .js file:

function sharrreItUp() {

    $('#twitter').sharrre({
        share: {
            twitter: true
        },
        enableHover: false,
        click: function(api, options){
            api.simulateClick();
            api.openPopup('twitter');
        }
    });

    $('#twitter-old').sharrre({
        share: {
            twitter: true
        }   
    });

    setTimeout(function(){ 

        var oldTwts = $('#twitter-old .box .count').html();
        var newTwts = $('#twitter .box .count').html();
        $('#twitter .box .count').html(parseInt(oldTwts) + parseInt(newTwts));

    }, 2000);

}

And BAM... you have your new URL being sharrred and the old shares from different social networks get added into them.

Oviparous answered 19/3, 2013 at 2:1 Comment(0)
B
1

Unfortunately, there is no solution for this. We have tried all possible solutions and you will simply lose your social equity if you do a 301 Redirect. We found it to not be worth the hassle of trying to maintain our vote counts, and have instead pointed our buttons to the homepage in the interim of moving to the new url structure.

Brueghel answered 26/3, 2012 at 23:5 Comment(1)
Same conclusion here. Just not possible, which is, in all honesty, plain ridiculous. I cannot believe that none of these companies even gave this topic enough thought to mention it in their FAQ or support system.Slither
O
0

i don't wanna say something wrong, but i think you just need to define the URI inside each share button, so no matter from what URL the vote come from, the defined url will be used as count.


if you, instead already have two different sources and you want to join it, you should follow the iframe src and scrape the count from it; for google +1 the div id that contain the count is #aggregateCount for twitter is #count; an example could be as below:

<?php
$doc = new DOMDocument();
$doc->loadHTMLFile('iframe-url-goes-here');
$count = $doc->getElementById('aggregateCount');
echo $count->nodeValue;
?>

then, on your page after the DOM is loaded and the widget are loaded, you can append your own value.

hope this help, in anycase i prefer the first way.

Outface answered 30/11, 2011 at 21:12 Comment(0)
T
0

Put in the head of the new page

<meta property="og:url" content="old_url_here"/>

This way Facebook attributes likes for the old page. The only downside is that this way when people share your link, the old rich snippet will be included.

Timisoara answered 22/6, 2015 at 4:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.