3

Hi I am using mixpanel and GA to track the user behavior. As referral source is mostly given in some cases it is not, such as instagram. Therefore I have the referral URL .../ig to get referrals from instagram. It directly reroutes to '/'.

Therefore it is not tracked by GA and mixpanel as such. To have a tracking as well I do the following in the rootScope

 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 located in my run-block so that before the rerouting it gets attached the utm and can be tracked. It seems it gets rerouted before identifying the utm. It does not work unfortunately. What do I do wrong?

Dribel
  • 465
  • 1
  • 10
  • 24

0 Answers0