I was just rereading the thread, and I should probably clarify a bit. The original method was to insert the tracking code into the coupon code field, but this is a much more elegant solution.
The new method uses a custom database table to associate an order number with an arbitrary string to use as a tracking code. NOTE: this is not a coupon code, or anything created from within the ZC control panel, just a bit of text like "google" or "msn."
1. When a URL arrives with "tracking=google" I sessionize it
2. In includes/modules/pages/checkout_success/header_php.php you can locate the order id ($zv_orders_id)
3. Write the order id and sessionized tracking code to a custom table so that you don't have to ##############ize the ZC schema
Then, when I do my reporting I can do something like:
Code:
SELECT orders.order_total,custom_reporting.code FROM `orders`,`custom_reporting` WHERE custom_reporting.code = "google" and orders.orders_id = custom_reporting.orders_id;
Which will return any orders that came from google. Of course, you can write any number of queries to list all tracking codes, search by date range, etc.
Bookmarks