3 min.
Forget Google Analytics: How to Send Online Traffic Sources Directly to Your CRM
1L’art de la gestion de projet2Un projet à succès commence par une bonne gouvernance3Cascade, agilité, demandes de changement?

Forget Google Analytics: How to Send Online Traffic Sources Directly to Your CRM

E-commerce Analytics & Tracking

If you've been in the business of generating leads for a long time, your  CRM  (CRM) has probably become your best friend and you're no doubt relying on it to grow your customer base. But not knowing all the channels/touchpoints that bring new customers into your  CRM  can cost you money. The ideal is to know how to quantify the contribution of each digital marketing channel in the conversion of customers and their entry into your  CRM .


Thanks to a simple manipulation, you will be able to send and store this information in your  CRM  as soon as the customer converts. This will avoid the hassle of associating customer info or emails from your  CRM  with Analytics data (and only if data tracking is adequate).

This is where the powers of marketing analytics and web analytics collide. Marketing analytics goes deeper than  web analytics, in that marketing analytics analyzes as much data as possible from customer touchpoints (both online and offline) in order to analyze performance. marketing and optimize return on investment (ROI) across all channels.

Here is what you will learn in this article:

  1. How to collect traffic referral details in a browser, store them in cookies and export them to your  CRM .
  2. How traffic source data is displayed in the  CRM  of a particular customer's profile.
  3. The analytics and optimizations you can get from importing these traffic sources.

Please note that it is not necessary to have advanced technological knowledge to understand this blog, but you will probably need to contact a developer who knows your system well to implement these solutions properly.


The first step is to download and install the  GetSetReff script   . This is a script for GTM (Google Tag Manager), but you can easily adapt it to work without a tag manager using a Javascript Ninja . The purpose of this script is to do the following things:

  1. Store all referrers of a visitor. If the referrer of a user's first visit is Google Organic, the second is Facebook and the third is Adwords, these three referrers will be stored in a cookie.
  2. Read the Google Analytics UTM parameters and identify the marketing campaigns you have retained.
  3. Store the duration of visits and the number of pages viewed.

The above three pieces of information will be stored in the user's cookies until they are deleted. The name of this cookie will be _reff. Now that you know in which cookie the session/visit referrers will be stored, you will need to create the following 4 new fields in your GRC database to store the _reff cookie values ​​for each customer:

  • Referent
  • Source
  • Media
  • Country

If you wish, you can also create 2 additional fields to store the duration of visits and the number of pages consulted. In order to extract cookie _reff values ​​(the information), first see the "Possible _reff values" section on  this page .

The “Referrer” field above will contain different referrers from multiple visits. Each visit/session is separated by a vertical bar (|).  It is important to store the referrer of each visit when there are several visits from the same user. You can keep the vertical bar as a separator or choose a sign that suits you. If you don't want to store the duration of visits and the number of pages viewed, all you have to do is delete the visit details (the numbers after the "&" sign) before storing everything in your CRM.

Note that the Source, Media and Campaign fields above  will only be populated when the "c" (campaign), "m" (media) and "s" (source) are present in the _reff cookie  or when the URL of the landing page is marked with UTM parameters. You can ask your developer to leave these 3 fields empty or to indicate "N/A" in your CRM for users who do not reach the site via UTM marked URLs.

Below you will find some cases where the 4 fields could be automatically filled in your  CRM .

  • A user buys a product from your online store
  • A user subscribes to your newsletters (even if the user in question only indicates an email address)
  • A user creates an account
  • A user completes and submits your contact form
  • A user clicks a link to download your mobile app
  • Any other form of conversion that may occur on your site

For users who complete several of the steps described above in different sessions, it would be important to think about the best way to handle these cases. For example, if the same user subscribes to the newsletter on Day 1 and buys a product on Day 3, should the _reff values ​​from Day 1 be overwritten with those from Day 3? Or should you instead store the _reff values ​​of all sessions and use a specific separator to separate the first session from the second, third, etc. ? In fact, the answer to these questions depends on the flexibility of your  CRM .

Remember that in cases where the same user deletes their cookies or switches devices on a subsequent visit, the referrer of the original visit will disappear from the _reff cookie. You will therefore probably end up with a single referrer, that of the visit/session preceding the conversion.

 In addition to the 4 fields that should be created in the RCMP database , a fifth field for the "CID" should also be created if possible.  The "CID" is the customer ID that Google Analytics automatically generates for each user who visits a website. This is how GA identifies unique visitors (by assigning them a unique random number). You will find the CID in the cookie named _ga. Make sure that the CID is sent to the GRC database   each time the above 4 steps occur. Storing the CID can help you identify your customers and what they are doing on your site. You can even use it in GA Reports to track and analyze which user is viewing your newsletters.


In the image above, you can see a typical customer profile page as depicted in a CRM. At the bottom of the table, I added the 5 fields mentioned earlier: referrer, campaign, source, media and GA ID. Each “>” sign separates unique sessions. This client, Jack Bauer, generated 4 sessions/visits before his conversion. Here's how it all went:

  1. First visit/session: Google Organic
  2. Second visit/session: Facebook
  3. Third visit/session: UTM branded campaign on Twitter.
  4. Fourth visit/session: Adwords (session where the conversion took place)

Of course, this is only one of the ways to visualize these 5 fields. Feel free to use your creativity to adapt everything to your needs.

3) Analytics and optimizations that can be gained from importing traffic sources

Once the referrer data is in your  CRM , you can easily answer the following types of questions:

  • How many touchpoints on average it took for customers to convert (subscribing to newsletters, purchasing a product, filling out a form, downloading the app, etc.) Indeed, that's a bit like the  Multi-Channel Funnels  reports in GA.
  • Which channel tends to be the first point of contact and which tends to close the sale (last point of contact)?
  • Who are your most profitable customers? By doing some cross-analysis with LTV ( lifetime value) data,  you can find your most profitable customer traffic sources. Maybe they're from that expensive native ad you bought in The  New York Times  ? Maybe that will convince you to buy more.
  • What is the best channel I can use to reach specific customers in an upsell campaign?

Yes, I know you already perform this type of analysis using analytics tools like Google Analytics. The difference here is that rather than analyzing unidentified users (#GA), you will be able to find out exactly which channels attended and converted each of these customers and that is a significant advantage.

So ! Now you know you don't have to rely entirely on an analytics tool to know where your customers are coming from. With a little bit of ingenuity, you can access this data through your CRM. Have you ever tried it? Feel free to share your experience in the comments section. All questions are also welcome!