2

I am using AddThis add on for sharing my site on facebook, twitter and email.

I want to know that out of facebook and twitter, from where the user clicks the shared link to redirect to my page.

If someone clicks on shared link from twitter below is the URL formed :

http://localhost:54820/Consumer/Categories.aspx?Check=NTI%3D#.T363yjFh748.twitter

you can see at the end of url twitter is appended.

If someone clicks on shared link from facebook below is the URL formed :

http://localhost:54820/Consumer/Categories.aspx?Check=NTI%3D#.T366Sb_aqUM.facebook

you can see at the end of url facebook is appended.

I am using Request.Url to get the url from address bar. But I get only http://localhost:54820/Consumer/Categories.aspx?Check=NTI%3D url. So I am not able to check whether the redirection of my site is done from facebook or twitter.

Gaurav123
  • 5,059
  • 6
  • 51
  • 81
  • Are you sure the twitter & facebook is added to the link by the addon? Say if you click the link from fb, are you seeing facebook added to your url? – Ramesh Apr 06 '12 at 10:12
  • Yes, If I click on sharef link from facebook. I am getting url with facebook appended at end of url. – Gaurav123 Apr 06 '12 at 10:20
  • Instead of url hash can't you pass the information as querystring? eg &src=.T366Sb_aqUM.facebook – Ramesh Apr 06 '12 at 10:26
  • Actually when user will click on facebook icon for sharing. Below url formed automatically by add on i think. http://localhost:54820/Consumer/Categories.aspx?Check=OA%3D%3D#.T37F3tTS5Ak.facebook so cann't append anything in querystring like src=T37F3tTS5Ak.facebook – Gaurav123 Apr 06 '12 at 10:33

1 Answers1

2

It is not possible to get the "hash parameter" on the server-side, but can access it via JavaScript (location.hash) and post the value to your server.

Here is an example: https://stackoverflow.com/a/1586300/123297

Community
  • 1
  • 1
philipproplesch
  • 2,127
  • 17
  • 20