You are here

function uc_googleanalytics_order in Ubercart 6.2

Same name and namespace in other branches
  1. 5 uc_googleanalytics/uc_googleanalytics.module \uc_googleanalytics_order()

Implements hook_order().

File

uc_googleanalytics/uc_googleanalytics.module, line 48
Adds the required Javascript to the checkout completion page to allow e-commerce statistics tracking through Google Analytics.

Code

function uc_googleanalytics_order($op, $arg1, $arg2) {

  // If a new order is created during the checkout process...
  if ($op == 'new' && arg(0) == 'cart') {

    // Store the order ID for later use.
    $_SESSION['ucga_order_id'] = $arg1->order_id;
  }
}