M
M
maxeee522021-01-21 11:29:09
PHP
maxeee52, 2021-01-21 11:29:09

How to catch a transition from a border, from an advertisement, or via a direct link (without UTM tags) on the site?

There is a need for CRM when ordering to transfer the source of the transition to the site.
With advertising, let's say, it's understandable. There I have a UTM tag that I can build on.
But how can I find out whether the order was from organic or the transition was through a link?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Puma Thailand, 2021-01-21
@opium

There are goals in the metrics and analytics, try them through them, and you can always track the client by the cookie and write all the information about him to the database

T
tatarrr95, 2021-01-28
@tatarrr95

I do the following. When a user enters the site, I will check if he has a utm tag. If not, I check through javascript what the referrer field is equal to. If referrer = yandex.ru or google.com, it means organic. Also, through this field, I check other sources that are important to me. Then you add this information to your form in hidden fields and they will be sent to crm.
Personally, I have tilde integration with Bitrix. For end-to-end analytics, it is easier for Bitrix to understand information about sources from UTM tags. The tilde writes these yutm tags to cookies and passes the cookies to Bitrix. That is, in order for me to have a beautiful end-to-end analytics, I do this:

function set_cookie ( name, value, exp_y, exp_m, exp_d, path, domain, secure ){
        var cookie_string = name + "=" + escape ( value );
        if ( exp_y )
        {
        var expires = new Date ( exp_y, exp_m, exp_d );
        cookie_string += "; expires=" + expires.toGMTString();
        }
        if ( path )
            cookie_string += "; path=" + escape ( path );
        if ( domain )
            cookie_string += "; domain=" + escape ( domain );
        if ( secure )
            cookie_string += "; secure";
        document.cookie = cookie_string;
    }
    function get_cookie ( cookie_name ){
        var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' );
        if ( results )
            return ( unescape ( results[2] ) );
        else
            return null;
    }
    
    $(document).ready(function() {
        ref = null;
        if (document.referrer) {
           url = document.referrer; 
           ref = url.match(/:\/\/(.[^/]+)/)[1];
        }
        if(ref){
            if (!get_cookie("TILDAUTM")){
                var current_date = new Date;
                var cookie_year = current_date.getFullYear()+1;
                var cookie_month = current_date.getMonth();
                var cookie_day = current_date.getDate()+1;
                set_cookie ( "TILDAUTM", "utm_source="+ref+"|||", cookie_year, cookie_month, cookie_day );
            }
        }
    });

Then, in end-to-end analytics, I add the sources I need (Google organics, Yandex, etc.) and that's it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question