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

jssocials counter counts separately for logged users and guests #219

Open
OksanaRozsokha opened this issue Nov 1, 2018 · 0 comments
Open

Comments

@OksanaRozsokha
Copy link

Hi. Thank you for great plugin!
I use jssocials to share posts on my website. It was so nice with that. But when I had to add the counter for shares I am having some problems.
When i share a post as a logged user in our system, the counter works fine(it shows number 1 as expected). But when I log out and go to this post, the counter does not show the number of shares and when I share this post again it also shows number 1.
It looks like it counts separately for logged users and guests. Now i can see only the number of the shares of all logged users if I logged too. And when I log out I can see only the number of the shares of all non-logged users.

I`m not sure, but maybe the reason for that is difference in url parameter. In our system, referral is added to the url for logged users.

For example, the urls looks like:
https://www.example.com - for non-logged users
https://www.google.com?ref=id - for logged users

Maybe plugin detects these urls as different? Is there a way to share a page with a dynamic url or Is there any other way to solve this problem?

I tried to add a referral with id=0 (https://www.google.com?ref=0) for non-loged users but it didn`t help.

Here is my code:
$(document).ready(function(){
$('#share-page').jsSocials({
showLabel: false,
showCount: "inside",
shareIn: "popup",
url: "#{target_url + person_referral_code.to_s}",
shares: [
{ share: "facebook", label: "Share" },
"twitter",
"linkedin",
{ share: "email", label: "Email" },
{ share: "googleplus", label: "Share" }
]
});
});

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

No branches or pull requests

1 participant