-->

How to configure addthis so that it won't crea

2019-04-09 02:43发布

问题:

When I share a page, addthis creates some data/ infomation after my share URL with a hash(#) - how I can configure addthis so that it won't create the hash data in the URL that I am going to share?

For instance, addthis makes these,

http://mywebsite.com/#.Ufs8RtZRjpU.facebook
http://mywebsite.com/#.Ufs8oc2zPtQ.twitter

I am after,

http://mywebsite.com/
http://mywebsite.com/

Is it possible?

edit:

<!-- AddThis Button BEGIN -->
<script type="text/javascript">var addthis_config = { pubid: "lauthiamkok", data_track_addressbar:false };</script>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=lauthiamkok"></script> 
<!-- AddThis Button END -->

<script type="text/javascript">
var addthis_config = addthis_config||{};
addthis_config.data_track_addressbar = false;
</script>

Tried this but does not work. Addthis is still a pain after years using it!

回答1:

I think what you're wanting to disable is clickback tracking, and in your question you're trying to disable address bar tracking. Try this instead:

var addthis_config = {
       data_track_clickback: false 
}

Found this here.



回答2:

I found this: http://support.addthis.com/customer/portal/questions/352733-how-to-remove-hash-from-url-

<script type="text/javascript">
var addthis_config = addthis_config||{};
addthis_config.data_track_addressbar = false;
</script>

Okay try moving the add_config line above the widget

<script type="text/javascript">
var addthis_config = addthis_config||{};
addthis_config.data_track_addressbar = false;
</script>

<!-- AddThis Button BEGIN -->
<script type="text/javascript">var addthis_config = { pubid: "lauthiamkok", data_track_addressbar:false };</script>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=lauthiamkok"></script> 
<!-- AddThis Button END -->


回答3:

I have created a JavaScript function and used it on load....

 function onloader() {
            var v = window.location.href;
            v = v.replace(/\#.*/, '');
            window.location.href.replace = v;
        }
        $(window).load(function () {
            onloader();
        });

that did work for me... :) hope that will work for every one :D