AddThis - contains too many device filters error

When using AddThis service with asp.net, some exceptions will throw like these:

The string 'fb:like:layout' contains too many device filters. There can be only one.

The string 'g:plusone:size' contains too many device filters. There can be only one.

You can solve this by using "In line server code".

 

Step 1: Implement the following code in your code file:

 

    Protected Function GetFacebookAttribute() As String
        Return String.Format("{0}=""{1}""", "fb:like:layout", "box_count")
    End Function
 
 
    Protected Function GetGooglePlusAttribute() As String
        Return String.Format("{0}=""{1}""", "g:plusone:size", "tall")
    End Function

 

Step 2: call it like this :

 

    <!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_floating_style addthis_counter_style" style="Right:0px;top:20px;">
<a class="addthis_button_facebook_like" <%=GetFacebookAttribute() %> ></a>
<a class="addthis_button_tweet" tw:count="vertical"></a>
<a class="addthis_button_google_plusone" <%=GetGooglePlusAttribute() %> ></a>
<a class="addthis_counter"></a>
</div>
<script type="text/javascript">    var addthis_config = { "data_track_addressbar": true };</script>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-500fe1b1632c7311"></script>
<!-- AddThis Button END –>

 

 

 

Or you can call it directly without code file:

 

 

    <!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_floating_style addthis_counter_style" style="Right:0px;top:20px;">
<a class="addthis_button_facebook_like" <%=String.Format("{0}=""{1}""", "fb:like:layout", "box_count") %> ></a>
<a class="addthis_button_tweet" tw:count="vertical"></a>
<a class="addthis_button_google_plusone" <%=String.Format("{0}=""{1}""", "g:plusone:size", "tall") %> ></a>
<a class="addthis_counter"></a>
</div>
<script type="text/javascript">    var addthis_config = { "data_track_addressbar": true };</script>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-500fe1b1632c7311"></script>
<!-- AddThis Button END –>

 

 

Hope that helps.

Published Monday, September 17, 2012 7:46 PM by Yousef_Jadallah

Comments

# re: AddThis - contains too many device filters error

Tuesday, September 18, 2012 6:53 AM by royalessays.co.uk

Very interesting! Thanks for post.

# re: AddThis - contains too many device filters error

Thursday, September 20, 2012 5:44 AM by allancepellet

A very vivid and detailed info.

# re: AddThis - contains too many device filters error

Wednesday, October 10, 2012 9:43 AM by A-Writer.com Glasgow

This is a wonderful post. I enjoyed the information lot. I will bookmark this page. Thanks for sharing this information.

# re: AddThis - contains too many device filters error

Wednesday, October 10, 2012 9:44 AM by A-Writer.com Glasgow

Really informative things are provided here, I really happy to read this post.

# re: AddThis - contains too many device filters error

Tuesday, October 30, 2012 11:17 AM by essay need

Incredibly inspiring article, Thank you !?!

Leave a Comment

(required) 
(required) 
(optional)
(required)