AddThis Academy

An ever-growing library of resources to help you become a better online marketer.

Setting URL Parameters

To allow the simplest possible case without JavaScript at all–a user wants a button with analytics with no code whatsoever–we support passing in parameters to the AddThis JavaScript URL via its hash, otherwise known as a fragment identifier.

In the URL http://www.example.com/foo#bar, "#bar" is the hash.

Name Description
pubid Your AddThis profile ID. You can find a list of your profile IDs. More information about profiles is available here.
domready If defined, the AddThis script will assume it’s been added to the page after the DOM is ready. Useful when dynamically adding AddThis to a page after the latter has finished loading.
async if defined, only core assets will be loaded. Once you’re ready to load the rest of the assets, call the function addthis.init()

 

Profile ID Example:

In this example, we pass the pubid parameter using the URL hash fragment.

<script type="text/javascript" src="http://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-a1b2c3d4e5f61a23"></script>

Another Example:

In this example, we pass both the pubid and the domready parameter using the URL hash fragment.

<script type="text/javascript" src="http://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-a1b2c3d4e5f61a23&domready=1"></script>

« Attribute Based Configuration

Rendering Tools with JavaScript »

Setting URL Parameters
1 (20%) 2 votes

Was this article helpful to you?