You likely want to be able to pass some tracking information about the visitors to your Magento site through to your back-end systems. I usually implement tracking using the same method as Google Analytics, just for convenience. Also, there is a ready-made URL Builder for clients non-google campaigns. This sends tracking data through to the site but you need a custom module to read those parameters and store them in a cookie. Your order export module can then read the cookie and include that information with the order.

You can intercept a Magento event that is called at the start of every request using this config.xml…


And then in the method you specify you can…

public function interceptMethodNameCanBeAnything($observer) {
    $request = $observer->getEvent()->getData('front')->getRequest();
    $utm_source = $request->utm_source;

    //do whatever you want with your variable here
  • Chantelle

    Big follower on this blog, loads of your articles or blog posts have definitely helped me out. Looking forward to updates!

  • Manisha

    $request = $observer->getEvent()->getData(‘front’)->getRequest();
    $utm_source = $request->utm_source;
    i have used into my observer but shown following error
    “Call to a member function getRequest() on a non-object”
    need your helps more….