AddThis Reccommend API use
Permalink
I have the AddThis smart layers in my website. The only problem is that the recommend feature is showing every possible page. I just want it to show certain pages. Digging deeper I found the API documentation which had the linkFilter function. Now using it with concrete I don't know how. Maybe someone with better knowledge can help. I am thinking of doing an attribute to add to pages that I don't want to show up with AddThis
Here is how to use it from the support section (http://support.addthis.com/customer/portal/articles/1200473-smart-layers-api#.Uq0yNeJu6fs)
linkFilter Decide if the link should be displayed in the specified layer, the function signature looks like:
function(link, layer) { }
link - an object with two properties, title and url, that can be used to determine if you want to show the link or not (e.g. if (link.title === 'http://badurl.com') return falsel;)
layer - the layer where the link could be displayed (e.g. recommended, whatsnext, thankyou).
To not show a link, simply return a boolean false. To show the link, return the link in its original form.
Here is how to use it from the support section (http://support.addthis.com/customer/portal/articles/1200473-smart-layers-api#.Uq0yNeJu6fs)
linkFilter Decide if the link should be displayed in the specified layer, the function signature looks like:
function(link, layer) { }
link - an object with two properties, title and url, that can be used to determine if you want to show the link or not (e.g. if (link.title === 'http://badurl.com') return falsel;)
layer - the layer where the link could be displayed (e.g. recommended, whatsnext, thankyou).
To not show a link, simply return a boolean false. To show the link, return the link in its original form.
Hi there!
I'm in charge of support and AddThis and this post came through our Google alerts. The linkFilter option is a JavaScript function. If you post the Smart Layers code you're using on the page here I can walk you through the changes you'll need to make to filter specific URLs.
Regards,
Paul Rothrock
Chief Support Engineer
AddThis.com
I'm in charge of support and AddThis and this post came through our Google alerts. The linkFilter option is a JavaScript function. If you post the Smart Layers code you're using on the page here I can walk you through the changes you'll need to make to filter specific URLs.
Regards,
Paul Rothrock
Chief Support Engineer
AddThis.com
Here is the code which I have put in the setting tracking code header. The problem I am having is that whats next and recommend shows stacks, page not found links etc. Thanks in advance.
<!-- AddThis Smart Layers BEGIN --> <!-- Go to http://www.addthis.com/get/smart-layers to customize --> <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-529c1212780c7693"></script> <script type="text/javascript"> addthis.layers({ 'theme' : 'dark', 'share' : { 'position' : 'left', 'numPreferredServices' : 4 }, 'follow' : { 'services' : [ {'service': 'facebook', 'id': 'MYID'} ] },
Viewing 15 lines of 30 lines. View entire code block.
http://www.concrete5.org/marketplace/addons/addthis/...