You are here

function google_adwords_add_tracking in Google AdWords Conversion Tracking 7.2

Same name and namespace in other branches
  1. 7 google_adwords.module \google_adwords_add_tracking()

Register a new conversion tracking.

The rules integration calls this function. Use this to set a custom tracking not related to a entity.

File

./google_adwords.module, line 221
Google Adwords Conversion Tracking Module.

Code

function google_adwords_add_tracking($conversion_id, $label = NULL, $value = NULL, $language = NULL, $color = NULL, $format = NULL, $currency = NULL) {
  $label = $label ? $label : base64_encode($conversion_id);
  $language = $language ? $language : 'en';
  $color = $color ? $color : 'FFFFFF';
  $format = $format ? $format : 1;
  $currency = $currency ? $currency : 'EUR';
  $_SESSION['google_adwords_rules_traking_codes'][$conversion_id] = array(
    'conversion_id' => $conversion_id,
    'conversion_label' => $label,
    'conversion_language' => $language,
    'conversion_color' => $color,
    'conversion_format' => $format,
    'conversion_value' => $value,
    'conversion_currency' => $currency,
  );
}