You are here

public function GoogleAdwordsTracker::addTracking in Google AdWords Conversion Tracking 8

Register an AdWord Tracking

@returns null

Parameters

$conversion_id:

null $label:

null $value:

null $language:

null $color:

null $format:

File

src/GoogleAdwordsTracker.php, line 49
Contains Drupal\google_adwords\GoogleAdwordsTracker.

Class

GoogleAdwordsTracker
Class GoogleAdwordsTracker.

Namespace

Drupal\google_adwords

Code

public function addTracking($conversion_id, $label = NULL, $value = NULL, $language = NULL, $color = NULL, $format = NULL) {

  /**
   * @todo get these default values from the global settings
   */
  $label = $label ? $label : base64_encode($conversion_id);
  $language = $language ? $language : 'en';
  $color = $color ? $color : 'FFFFFF';
  $format = $format ? $format : 1;

  // add this tracking to our array
  static::$trackings[$conversion_id] = array(
    'conversion_id' => $conversion_id,
    'label' => $label,
    'language' => $language,
    'color' => $color,
    'format' => $format,
    'value' => $value,
  );
}