http status code 302 - Google Analytics: track links from email to external page -


Google Analytics is driving my madness

There is an app in my app store. I want to add an email directly to my app's page in the App Store, but I want to track clicks.

So far, I have the link

  www.mypage.com/promolet/   

in that location an index.php The file which redirects to 302 is as follows:

  Header ("Location: http://www.mypage.com/index.php?page=App_store and utm_source = promoletter and utm_medium = Email & amp; utm_campaign = v1-promoletter ");   

I do this with two redirects because

  1. The URL looks good and
  2. I still have to edit the utm variable The newsletter has been sent

    Now, through my index.php page, an html page has been created which is another 302 redirect

      Http: /itunes.apple.com/ie/app/MY-APP/id-SO-AND-SO?ls=1&mt=8   

    as the above Using the php header function.

    Now, everything works great, but of course it is not being recorded in Analytics (hence the question :)). While writing this, I know because the ga.js file is never loaded because you have no output before the PHP header function.

    How to solve?

    The best way to resolve this is to use JavaScript redirects. Send an html page with Ga.js and a script tag:

      ...   

    Or to make sure that ga.js is loading:

      ...   

    I'm not sure whether it is possible that the ga pixel request is "spoof". You may also need cookies with those that are not available to you. But otherwise you may be able to do a fake GA pixel from your backend to track the right values.

    Javascript redirection can be a bit simpler :)

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -