вместо
data['product_id'] = $tmp['product_id'];
if (isset($tmp['tracking'])) {
$data['tracking'] = $tmp['tracking'];
}
добавьте
$allowed_parameters = array(
'product_id', 'tracking',
// Compatibility with "OCJ Merchandising Reports" module.
// Save and pass-thru module specific GET parameters.
'uri', 'list_type',
// Compatibility with Google Analytics
'gclid', 'utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',
'type', 'source', 'block', 'position', 'keyword',
// Compatibility with Yandex Metrics, Yandex Market
'yclid', 'ymclid', 'openstat', 'frommarket',
'openstat_service', 'openstat_campaign', 'openstat_ad', 'openstat_source',
// Compatibility with Themeforest Rgen templates (popup with product preview)
'urltype'
);
foreach($allowed_parameters as $ap) {
if (isset($tmp[$ap])) {
$data[$ap] = $tmp[$ap];
}
}