Class: Applicants::AffiliateTracking

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/applicants/affiliate_tracking.rb

Constant Summary collapse

HAS_OFFERS_OFFER_ID =

HasOffers offer id generated and given by Ethan Allen It is generated for this HasOffers event in a new tester workflow In this case, the HasOffers event is after an “Applicant video upload”

2
HAS_OFFERS_GOAL_ID =

HasOffers goal id generated and given by Ethan Allen Tracks how far along the new tester workflow a tester has gotten. One stage of it is “Applicant video upload” and the 2nd stage is after they are approved (which is tracked in the Orders app)

4

Class Method Summary collapse

Class Method Details

.has_offers_goal_url(transaction_id) ⇒ Object



30
31
32
33
34
35
36
37
38
# File 'app/models/applicants/affiliate_tracking.rb', line 30

def self.has_offers_goal_url(transaction_id)
  return if transaction_id.blank?

  # HasOffers goal url as defined in the documentation
  # http://support.hasoffers.com/hc/en-us/articles/203338487-Postback-Tracking
  # Order of query string parameters is important
  # Example: http://usertesting.go2cloud.org/aff_goal?a=lsr&goal_id=4&transaction_id=TRANSACTION_ID
  URI("http://usertesting.go2cloud.org/aff_goal?a=lsr&goal_id=#{HAS_OFFERS_GOAL_ID}&transaction_id=#{transaction_id}")
end

.has_offers_offer_url(transaction_id) ⇒ Object



20
21
22
23
24
25
26
27
28
# File 'app/models/applicants/affiliate_tracking.rb', line 20

def self.has_offers_offer_url(transaction_id)
  return if transaction_id.blank?

  # HasOffers offer url as defined in the documentation
  # http://support.hasoffers.com/hc/en-us/articles/203338487-Postback-Tracking
  # Order of query string parameters is important
  # Example: http://usertesting.go2cloud.org/aff_lsr?offer_id=2&transaction_id=TRANSACTION_ID
  URI("http://usertesting.go2cloud.org/aff_lsr?offer_id=#{HAS_OFFERS_OFFER_ID}&transaction_id=#{transaction_id}")
end