Skip to main content
All CollectionsTrack everything !Sources of visits and contacts
For the visits, what are the rules for medium and source determination?
For the visits, what are the rules for medium and source determination?

A detailed article on the identification of mediums and the source of a visit, as well as the url parameters.

Andjie Pasquier avatar
Written by Andjie Pasquier
Updated over 2 years ago

Prerequisite:

  • Understand the utm parameters

This post will give you precise rules used to calculate the medium and the source of a visit.
There is no constraint on a visit's source; however, only nine mediums are available.

Medium determination 

First rule: url parameters 

The first thing Plezi will look for is two url parameters. If the url contains a gclid parameter, the visit will have the Sponsored links medium. If it contains a cid  parameter, the visit will have the Marketing email medium.

Second rule: utm_medium parameter

If the two parameters above are not in the url, Plezi will try to find a utm_medium parameter. Calculation rules are:

  • Social media : social, social-network, social-media, sm, social network, social media

  • Paid search : cpc, ppc, paidsearch, cpa

  • Affiliates : affiliate, partner

  • Display : display, cpm, banner 

  • Marketing Email : email

  • Other mediums : all the other keywords

Keywords are case-insensitive. 'sOcIal-mEdIa' will be considered the same as 'social-media'.

Third rule: referer

If none of cases above are met, Plezi will check the website who sent the visior on your website. This information is stored in the "referer" parameter of the request sent by our script.

  • Social media : referer contains Foursquare, Yelp, Yammer, Facebook, Twitter, LinkedIn, YouTube, Instagram, Tumblr, Pinterest, SlideShare, Digg, Reddit, Sphinn, MySpace, Propeller,Fark, Tipd, LiveJournal, Slashdot, Ning, Metacafe.

  • Organic search : referer contains google, yahoo, bing, qwant, ecosia, baidu, duckduckgo

  • Referer : if there is a referer, but not among the ones above.

  • Direct traffic : no referer.

Source determination

First rule: url parameters

As for the medium, first rule is to check if url contains a gclid parameter. If it does, the source will be Google.

Second rule: utm_source parameter

Plezi will then check if the url contains a utm_source parameter. If that's the case, the source will be the parameter's value.
If the parameter is fb, source will be Facebook.
If the parameter is ig, source will be Instagram.

Third rule: referer

Last rule is to use the visit's referer to know the source. If the referer is plezi.co/a_great_article, the source is plezi: the domain of the referer is the source. If no referer is provided, the source will be (none).

Bonus: contacts not created on the website, but elsewhere 

If a contact is not created from your website, the medium of its first touch will always be Offline. Source will depend on how they were created:

  • if they were created by a CRM import, the source will be the CRM's name,

  • if they were created by a contact import, the source will be Contact import,

  • if they were created by Zapier, the source will be Zapier by default, unless a source was provided upon the contact creation. To know how to do that, have a look here.

  • if they were created with the API, the source will be API by default, unless a source was provided upon the contact creation.

Did this answer your question?