I finally integrated my Twitter username on Blogger's default sharing buttons.
The good thing about the default sharing buttons, is that they allow the readers to share your contents via email, Blogger, Twitter, Facebook and Google+ with just a click. You could also easily install it in your Blogger blog, so it is one of the most used sharing buttons on blogs. That's what I've observed, anyway.
So.. that's the good thing. I've got no problem with the email, Blog and Facebook buttons.. Since I'm a Twitter junkie, my problem is with Twitter. The downside to the default buttons is that the Twitter button doesn't focus on using the API to its fullest, which, if used, should help you increase your engagement with your readers.
Simply put, if you use Twitter's official tweet button, your username is already included in the codes (data-via="leahsayomac"). So if you tweet a certain content, you will see this line via @leahsayomac. Having &via=leahsayomac in the query string is going to help you track who has tweeted your content (it shows up in the mentions) and your visitors will have the chance to follow you, if they aren't already following you. However, if you're using Blogger's official sharing buttons, you don't see your username. And that's what I wanted to fix.
I played with my codes yesterday and I finally found the solution. It's pretty simple. You could try to do this, if you want to. But before doing any tweaks on your blog's codes, make sure to back up your template first. This is important. BACK UP your template.
- On the new Blogger dashboard, go to Template.
- Click Edit HTML.
- Click Expand Widget Templates.
- Search for this code.. sb-twitter. To do that, click CTRL+F and type it in the search box.
- Here is what your code might look like. Yours may look a bit different, but this is what mine looks like..
<a class='goog-inline-block share-button sb-twitter' expr:href='data:post.sharePostUrl + "&target=twitter"' expr:title='data:top.shareToTwitterMsg' target='_blank'><span class='share-button-link-text'><data:top.shareToTwitterMsg/></span></a>
- Change the href attribute. Only the href attribute.. And don't forget to change the username leahsayomac to your own Twitter username. Otherwise, it'll be my username that'll show on your tweets. Here is what it should look like after editing the codes.
<a class='goog-inline-block share-button sb-twitter' expr:href='"https://twitter.com/intent/tweet?url=" + data:post.url + "&via=leahsayomac&text=" + data:post.title' expr:title='data:top.shareToTwitterMsg' target='_blank'> <span class='share-button-link-text'><data:top.shareToTwitterMsg/></span></a>
- Click Save Template.
And that's it. You're done. This tweak automatically adds your username (via @leahsayomac) on every tweet, using the Twitter button on the Blogger's default sharing buttons. If you wanna see it in action, use mine on this post. If it doesn't work on your blog, restore your template using your backup and you're good.
If you're okay with your sharing buttons, you don't really need to edit anything. But if you want to try this, go ahead and follow the instructions, but be sure to back up your template first. Good luck! ☺