class Kameleoon::Conversion

Attributes

goal_id[RW]
negative[RW]
revenue[RW]

Public Class Methods

new(goal_id, revenue = 0.0, negative = false) click to toggle source

@param [Integer] goal_id Id of the goal associated to the conversion @param [Float] revenue Optional field - Revenue associated to the conversion. @param [Boolean] negative Optional field - If the revenue is negative. By default it's positive.

# File lib/kameleoon/data.rb, line 116
def initialize(goal_id, revenue = 0.0, negative = false)
  @instance = DataType::CONVERSION
  @sent = false
  @goal_id = goal_id
  @revenue = revenue
  @negative = negative
end

Public Instance Methods

obtain_full_post_text_line() click to toggle source
# File lib/kameleoon/data.rb, line 124
def obtain_full_post_text_line
  nonce = Kameleoon::Utils.generate_random_string(NONCE_LENGTH)
  "eventType=conversion&goalId=" + @goal_id.to_s + "&revenue=" + @revenue.to_s + "&negative=" + @negative.to_s + "&nonce=" + nonce
end