B
B
bio2016-12-06 21:17:40
JavaScript
bio, 2016-12-06 21:17:40

How to correctly determine the source of traffic?

Good afternoon!
Tell me how to determine that the user came from a specific source?
I found out by the "poke" method (so I can be wrong) that:

  • referrer containing 'www.google.com' - google search
  • referrer containing 'market.yandex.ru' - yandex market
  • referrer containing 'yandex.ru/click' - Yandex search
  • referrer containing something else - a referral link (so far the rest are not interested, but most likely the definition is also for the main domain)

  • get parameter using 'gclid' - google ad
  • get parameter using 'yclid' - Yandex advertising

Am I correct? Are there any pitfalls with the definition of the source?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Alexander Aksentiev, 2016-12-06
@Sanasol

the referrer is not passed when going https -> http
so the first three options will not work in 99% of cases.
Well, other transitions from https sites will also not be visible.

D
Denis Ruchiev, 2017-04-07
@artgrosvil

$('#header_havigation li a').each(function () {.....
li has no href attribute....

S
Smeecy Smeecy, 2017-04-07
@Wekeed

And what did you write in the .active class?

F
Froggyweb, 2017-04-07
@Froggyweb

Generally the server part usually is engaged in it.
PS href is the full address, use pathname

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question