We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3232
    • 380 Posts
    I am looking to set up redirect as a way to track media sources and currently I am using weblinks and google anaylitics.

    But since redirects don’t get parsed, it doesn’t get the google analytics code injected and doesn’t register at google.

    Does anyone know if there is a snippet or way to redirect a normal document to the homepage, that gets fully parsed so that it can be "counted" as a page?

    Any suggestions are welcome.

    Thanks
    Brian
      • 3232
      • 380 Posts
      lets see if i can explain a little better..

      I set up a few redirects that are eached tied to a different media source.

      domain.com/offer1
      domain.com/offer2

      each of these redirects point to the same page.

      but i want to track how many people enter through these pages. since the redirect doesn’t actually render it never loads the analytic code and therefore doesn’t register as an entry in the reports.

      I would be willing to change these weblinks to documents if I could find a snippet that would force a redirect after the page parses


        • 7231
        • 4,205 Posts
        Try adding html headers to your redirect page. This should cause the page to "load" before it gets redirected.
          [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

          Something is happening here, but you don't know what it is.
          Do you, Mr. Jones? - [bob dylan]
          • 27708 MODX Staff
          • 2,502 Posts
          What I normally do in this case is to not worry about the specific stats for the redirect but look at the referrer count for the landing page. For instance if your redirected URL is http://www.mywebpage.com/offer1/ and the landing page is http://www.mywebpage.com/offerlandingpage.html all you have to do is look at the referrers for the http://www.mywebpage.com/offerlandingpage.html and the total of how many came from http://www.mywebpage.com/offer1/.

          You can also do this with domain names as well. I have a client who uses individual domains for different campaigns even though they all land on a common landing page so all we do is look at the referrer stats and you can see how many come from which each URL. It even works where the domain forwarding is cloaked using a frame to wrap the landing page (to show the originating URL in the address bar).
            Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub