Home Setting tracking cookie on client side vs server side?
Reply: 1

Setting tracking cookie on client side vs server side?

maverick
1#
maverick Published in 2018-02-13 20:14:12Z

We want to set tracking cookie to check how many users we are getting through various marketing campaigns. On each campaign URL of our website, we add following query string parameters:- utm_source, utm_medium and utm_campaign.

Sample URL:- https://example.com/?utm_source=facebook&utm_medium=cpc&utm_campaign=jan

Anytime, we get request from any URL on our server, we check:

  1. If url has utm_* parameters, we save those in the cookie.
  2. If there's no such utm_* parameters in the url and If referer host is our website i.e. https://example.com/, we save that in cookie for 6 months.
  3. If there's no such utm_* parameters in the url and referer is one of search engine, we save search engine name in cookie.

and we have few more similar conditions.

Should we write this logic on server side (C#) OR Client side(javascript)?

Nate
2#
Nate Reply to 2018-02-13 22:50:40Z

Technically you can do it on either end; but in reality, you might have slightly better luck with a server side approach as it will be harder for browsers to get around (either they accept cookies or not). Things like noscript and adblockers could interfere with a client side implementation.

Additionally, if you do things server side, you could store that information along with a thumb print of the browser in a database and compare against that for future visits. That would work even if cookies are being blocked/cleared.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.365312 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO