1 Reply Latest reply on Oct 21, 2012 3:52 PM by Sham HC

    Capture HTTP Referer using Dispatcher

    Jayatl Level 1

      Hello,

       

      I wanted to know if it was possible to capture the HTTP Referrer on a page when using the Dispatcher to change information on the page. For instance, if the referrer was organic search from Google and "my product name" was in the querystring - I'd change the display of a given parsys.  My thoughts are the Client Context and Teaser component would be right for this task; however I'm unclear about:

       

      1. How do you capture the HTTP Referrer using the client context?  Are there any examples of this?
      2. Since the client-content is JS, doesn't this mean CQ renders the default then the JS loads the dynamic content into the teaser?  If I have this correct, wouldn't this be visible to users on slower systems - like IE7?
      3. Because it is technically dynamic, does this prevent the dispatcher from caching the page or does the dispatcher cache everything except the teaser/client context?

       

      Thanks in advance for any assistance anyone can provide.  Using 5.5 SP1

        • 1. Re: Capture HTTP Referer using Dispatcher
          Sham HC Level 7

          Generally client browser will specify an optional header "Referer" containing the address (URI) of the document from which the URI in the request was obtained. Configure dispatcher to allow Referer header and capture using <%=slingRequest.getHeader("Referer") %>

           

          In case you want to refer from querystring you can use request.getParameter("<variableName>");

          1 person found this helpful