Utm_source tracking is not tracked

Hi I am using mixpanel and GA to track user behavior. The referral source is most often given in some cases it is not, for example, instagram. So I have a referral url ... / ig to get referrals from instagram. It redirects '/' directly.

Therefore, it is not tracked by GA and the mixpanel per se. To track also do the following in the root directory

 if($location.path().indexOf('/ig')!==-1){
        var currentLocation=$location.path();
        $location.path(currentLocation+'/?utm_source=instagram&utm_medium=referral&utm_campaign=instagramTraction');
      }

      

This code above is in my launcher so it is attached to utm before redirection and can be tracked. It seems to be redirecting before identifying utm. Unfortunately this doesn't work. What am I doing wrong?

+3


source to share





All Articles