#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    64
    Rep Power
    2

    ShareThis Individual User Tracking


    I would like to track when users on my site successfully share something using the ShareThis buttons on my website. I was considering using event tracking in JS and passing the variable to PHP. But this wouldn't be able to track whether the user shared a link or just clicked the button.

    After further consideration it seemed that this methodology would not be very efficient, because I would also need to ensure that this would not track if a user shared the same page multiple times. I would then need to update the database to increment the particular user's total number of shares.

    If anyone can think of a better more efficient way of being able to track individual user shares it would be appreciated. The new shareThis forums are **** these days so it's very difficult to get any suggestions from those guys. Thanks.
  2. #2
  3. A Not To Shabby Code Smurf
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Aug 2008
    Posts
    1,187
    Rep Power
    184
    You could use AJAX, when the button is clicked to update your database and also combine that with HTML5 Web Storage... to use localStorage or sessionStorage. This way... you could track shares and use storage to moderate when AJAX should track individual shares. As far as getting a 100% accurate tracking statistics on a share/posting to a social site... I think unless the site offers an API to track such type of post (for web developers); the onclick event of the "Share" button (from your own site), is probably your best tracking choice.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    64
    Rep Power
    2
    Originally Posted by web_loone08
    You could use AJAX, when the button is clicked to update your database and also combine that with HTML5 Web Storage... to use localStorage or sessionStorage. This way... you could track shares and use storage to moderate when AJAX should track individual shares. As far as getting a 100% accurate tracking statistics on a share/posting to a social site... I think unless the site offers an API to track such type of post (for web developers); the onclick event of the "Share" button (from your own site), is probably your best tracking choice.
    Thanks that's a good idea. I've been holding back on using some HTML5 attributes just to make sure everything on my site can be supported and rendered properly on as many browsers as possible. I hope maybe a year from now we can use all HTML5 without worrying about these issues and people using out of date browsers, but what do you think?
  6. #4
  7. A Not To Shabby Code Smurf
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Aug 2008
    Posts
    1,187
    Rep Power
    184
    All modern (most up-to-date versions) browsers support web storage, but you are correct... older browsers do not support it. A workaround for this, would be to use a cookie for those non-supported browsers; if you wanted to implement web storage, that is. It may be a little more tedious to it this way; but usually with anything new; you have to create some type of workaround/hack to make something like this cross-browser compatible.

IMN logo majestic logo threadwatch logo seochat tools logo