Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Counter Conflicts #284

Open
LockeAG opened this issue Mar 1, 2016 · 3 comments
Open

Update Counter Conflicts #284

LockeAG opened this issue Mar 1, 2016 · 3 comments
Labels

Comments

@LockeAG
Copy link

LockeAG commented Mar 1, 2016

Hi , Guys , thank you , for continuing the project. It is without a doubt a great piece of code.

One of the main problem is the lack of tracking on Universal Analytics Code. I think updating this is a Must , I just saw that there is a pull request that updates this (#248) , I test out, and it is not working well. I hope this will improve with time.

Second , when I update to version 2.0.0 , all my counters reset. Is there any way to recover the count??

let me show my sample code .:

/**
 * Share Script
 */
 function shareme(shareElement, shareElementMobile) {

    $(shareElement).each(function(i) {
        $(this).sharrre({
            share: {
                facebook: true,
                twitter: true,
                pinterest: true,
                linkedin: true,
                tumblr: true,
            },
            template: '<ul class="box"><li> <h2>{total}<small>Compartido</small> </h2> </li><li id="facebook"><i class="fa fa-facebook"></i></li><li id="twitter"><i class="fa fa-twitter"></i></li><li id="googleplus"><i class="fa fa-google-plus"></i></li><li id="linkedin"><i class="fa fa-linkedin"></i></li><li id="pinterest"><i class="fa fa-pinterest"></i></li><li id="tumblr"><i class="fa fa-tumblr"></i></li></ul></li></ul>',
            enableHover: false,
            enableTracking: false,
            buttons: {
                googlePlus: {},
                facebook: {
                    layout: 'button',
                    send: true
                },
                twitter: {
                    via: 'LockeAG',
                },
                linkedin: {},
                pinterest: {}
            },
            url: 'http://code.google.com',
            render: function(api, options) {
                $(api.element).on('click', '#twitter', function() {
                    api.openPopup('twitter');
                    return false;

                });
                $(api.element).on('click', '#facebook', function() {
                    api.openPopup('facebook');
                    return false;

                });
                $(api.element).on('click', '#googleplus', function() {
                    api.openPopup('googlePlus');
                    return false;

                });

                $(api.element).on('click', '#pinterest', function() {
                    api.openPopup('pinterest');
                    return false;

                });


                $(api.element).on('click', '#linkedin', function() {
                    api.openPopup('linkedin');
                    return false;
                });

                $(api.element).on('click', '#tumblr', function() {
                    api.openPopup('tumblr');
                    return false;

                });
            }
        });


    });

    $(shareElementMobile).each(function(i) {
        var lnk = $(this).attr('data-url'),
        txt = $(this).attr('data-text'),
        resTxt = encodeURIComponent(txt),
        resLnk = encodeURIComponent(lnk);


        $(this).sharrre({
            share: {
                facebook: true,
                twitter: true,
                linkedin: true
            },
            template: '<ul class="box"> <li> <h2>{total}<small>Compartido</small> </h2> </li><li id="facebook"><i class="fa fa-facebook"></i></li><li id="twitter"><i class="fa fa-twitter"></i></li><li id="linkedin"><i class="fa fa-linkedin"></i></li><li id="whatsapp"><a href="whatsapp://send?text=' + resTxt + ' ' + resLnk + '" data-action="share/whatsapp/share"><i class="fa fa-whatsapp"></i></a></li></ul>',
            enableHover: false,
            enableTracking: false,
            buttons: {
                facebook: {
                    layout: 'button',
                    send: true
                },
                twitter: {},
                linkedin: {}
            },
            render: function(api, options) {

                $(api.element).on('click', '#twitter', function() {
                    api.openPopup('twitter');
                    return false;
                });

                $(api.element).on('click', '#facebook', function() {
                    api.openPopup('facebook');
                    return false;
                });

                $(api.element).on('click', '#linkedin', function() {
                    api.openPopup('linkedin');
                    return false;
                });

                $(api.element).on('click', '#whatsapp', function() {
                    api.openPopup('whatsapp');
                    return false;
                });

            }
        });


    });
}

Thank you!

@smeeckaert smeeckaert added the Bug label Mar 1, 2016
@smeeckaert
Copy link
Collaborator

I'll look into it today, you shouldn't lose counts.

@LockeAG
Copy link
Author

LockeAG commented Mar 2, 2016

Thank you! ,

Is there any co-relation between wildcards and the counter? ,what I mean is that www.domain.com can be affected if you change it to http://domain.com.

thank you

@smeeckaert
Copy link
Collaborator

Yes, the way most API works relies completely on your domain, even if you went from http to https you can lose counts. The best way to avoid this problem is to set a standard url in the url parameter of Sharrre.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants