Installing Shareaholic on Blogger / Blogspot

Follow

IN THIS ARTICLE

Summary

The following tutorial will step you through how-to install Shareaholic on Blogger.

Blogspot


Install Shareaholic Setup Code (Shareaholic.js)

If you have not already signed up for Shareaholic, check out the Getting Started with Shareaholic Guide before following the instructions below.

  1. Log into your Blogger.com account
  2. Click Template in the lower left-hand column
  3. Click the Edit HTML button
  4. Use CTRL-F or Command-F and search for the following within the template:
     /head
  5. Click the line above the </head> tag, hit Enter to create a new line and paste your Shareaholic Setup Code. As a reference, your site's Shareaholic setup code can be found in the Installation tab of your site's Settings on Shareaholic.com, and it looks something like the following (the Site ID in the code will be unique to your site):



  6. Click Save Template

Alternatively, you can also follow these steps:

  1. Within Blogger, click Layout from the left-hand side menu.
  2. Click on any of the Add a Gadget links within the layout.
  3. Choose the HTML/Javascript gadget from the list and type "Shareaholic" for the title.
  4. Paste in the Shareaholic setup code from the Shareaholic.com dashboard into the Content section.
  5. Click Save.

How-to install an In-page Shareaholic App

Shareaholic In-page Apps are special apps that let you place them exactly where you want in your website layout or template at the location where the app should be displayed. In-Page Share Buttons and In-Page Related Content are examples of Shareaholic In-Page apps.

If you have not created an In-page Shareaholic App, check out the Installing an In-page Shareaholic App Guide before following the instructions below.

A) First, create a new In-Page App instance (for example - Share Buttons, Follow Buttons, Related Content) in your Shareaholic dashboard:

  1. Login to your Shareaholic account and select your site from the My Sites drop-down at the top of the page.
  2. On your 'Apps' dashboard, under 'Social Sharing', you'll find the Share Buttons section. Similarly, you'll find the Related Content and Follow Buttons sections. Click New In-Page App.

    share-add_new.png

    RC-add_new.png

  3. Give a name to this new app location. Choose a name which makes sense for you. Something like 'Post Above Content' would be a good name.
  4. Edit the look and feel of the app and click Save.
  5. In the same window, Click on the Code tab. This is where you'll find the HTML code for your app, which you'll insert into your Blogger template:



    You can also quickly get to the code using this short cut:




  6. Copy this code to your clipboard.

B) Add the Shareaholic In-Page App code to your Blogger template:

These instructions are for adding a Shareaholic In-Page App to the TOP of your Blogger posts. Instructions for how-to add an app to the bottom of your posts are in the More Placement Options section below.

  1. Head back to blogger.com and click Template on the lower left-hand column
  2. Click the Edit HTML button under your Live on Blog template

    blogger-template-settings

  3. Use CTRL-F or Command-F and search for "post-header" then look for the following line of code:
    <div class='post-header-line-1'>
    Make sure you are clicking inside the HTML template before trying to search, or else you will not be able to find it. Your search bar should look like the one in the screenshot below. This line of code may appear more than once, so make sure you are putting the code in the right location!

    blogger-install-code

    Note: 
    Depending on your site's theme, you may have multiple "post-header" located in your template. Make sure you are inserting the snippet code after the correct <div class='post-header-line-1'>, or else share buttons will not appear. The correct line should be the one furthest down the template.
  4. Directly beneath that line, press enter to create a new line.
  5. Paste the app code into the empty line, which should look something like:
     <div class="shareaholic-canvas"
    data-app="share_buttons"
    data-app-id="(your custom app id)"
    expr:data-title="data:post.title"
    expr:data-link="data:post.url">
    </div>
  6. Be certain that the Shareaholic <div …> ends with a “/>” when you paste it in.
  7. Click Save Changes to apply this code to your and you're done!

Notes:

  • If your Blogger theme provides for a mobile theme, you may find this multiple times. Perform this for each instance!
  • If you're unable to see your app appear, make sure that there isn't another "post-header-line-1" in your template that you missed. While you should only have to place it once in the last location of the tag, there should not be any ill effects from placing the code below all the post-header-line-1 tags, so don't worry about repeating yourself!

Additional In-Page App Placement Options

a. Add Shareaholic In-Page Apps to the bottom of all your Posts:

  1. Follow the directions for showing buttons at the top, only instead of searching for the post-header-line-1 <div> tag, locate the code block that begins with:
             <b:if cond='data:post.hasJumpLink'>
  2. Place your cursor at the end of the last line of this Blogger template block, which will contain: </b:if>
  3. Press Enter to create a new empty line.
  4. Paste the Shareaholic In-Page App HTML code snippet into the empty line.
  5. Be certain that the Shareaholic <div …> ends with a “/>” when you paste it in.
  6. Press the Save Changes button to apply this code to your site.

b. Add Shareaholic In-Page Apps to the bottom of your Posts BUT hide them on your homepage:

Follow the directions for adding an In-Page app as listed above, but paste the Shareaholic App HTML code snippet in the following Blogger template block instead:

<b:if cond='data:blog.pageType == "item"'>
   ... SHAREAHOLIC IN-PAGE APP HTML CODE SNIPPET HERE....
</b:if>

c. Add Shareaholic In-Page Apps in different Blogger layout locations

  1. Select Layout from the menu to the left. 
  2. Determine where you would like the In-Page app to appear.
  3. Click Add a Gadget in your desired location.
  4. In the popup window, scroll down and select HTML/JavaScript.
  5. Place your cursor in the Content box of the Configure HTML/JavaScript window.
  6. Paste the Shareaholic In-Page App HTML code snippet into the input box. Note: For In-Page Share Buttons, if you would like to specify the link that should be shared, see this article.
  7. After customizing, press the Save button.
  8. Once you have finished adjusting your layout, press the Save Arrangement button to apply your changes.

For example, if you want to add a Shareaholic In-Page app to your Sidebar:

  1. You can add In-Page Apps in your sidebar by clicking on Layout and then clicking Add a Gadget in the sidebar area.
  2. Choose the HTML/Javascript gadget from the list and paste your code into the widget.

Note: Although Shareaholic is compatible with almost all standard Blogger themes (limited support for Dynamic Views), we cannot guarantee compatibility with custom templates. If you are concerned that your template may not be compatible, try using any of the above methods to install an In-Page Share Button app for testing purposes. Share Buttons should be immediately visible once the Setup Code and the In-Page app's HTML code has been applied to your blog.

Additional Resources:

Using conditional statements (for tweaking app placement)

Was this article helpful?