Skip to content

Latest commit

 

History

History
140 lines (86 loc) · 5.57 KB

README.md

File metadata and controls

140 lines (86 loc) · 5.57 KB

Track

(track)

Overview

Available Operations

  • lead - Track a lead
  • sale - Track a sale
  • customer - Track a customer ⚠️ Deprecated

lead

Track a lead for a short link.

Example Usage

require 'dub'


s = ::OpenApiSDK::Dub.new
s.config_security(
  ::OpenApiSDK::Shared::Security.new(
    token: "DUB_API_KEY",
  )
)


req = ::OpenApiSDK::Operations::TrackLeadRequestBody.new(
  click_id: "<id>",
  event_name: "Sign up",
)
    
res = s.track.lead(req)

if ! res.object.nil?
  # handle response
end

Parameters

Parameter Type Required Description
request ::OpenApiSDK::Operations::TrackLeadRequestBody ✔️ The request object to use for the request.

Response

T.nilable(::OpenApiSDK::Operations::TrackLeadResponse)

sale

Track a sale for a short link.

Example Usage

require 'dub'


s = ::OpenApiSDK::Dub.new
s.config_security(
  ::OpenApiSDK::Shared::Security.new(
    token: "DUB_API_KEY",
  )
)


req = ::OpenApiSDK::Operations::TrackSaleRequestBody.new(
  amount: 996500,
  payment_processor: ::OpenApiSDK::Operations::PaymentProcessor::PADDLE,
  event_name: "Purchase",
)
    
res = s.track.sale(req)

if ! res.object.nil?
  # handle response
end

Parameters

Parameter Type Required Description
request ::OpenApiSDK::Operations::TrackSaleRequestBody ✔️ The request object to use for the request.

Response

T.nilable(::OpenApiSDK::Operations::TrackSaleResponse)

customer

Track a customer for an authenticated workspace.

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

require 'dub'


s = ::OpenApiSDK::Dub.new
s.config_security(
  ::OpenApiSDK::Shared::Security.new(
    token: "DUB_API_KEY",
  )
)


req = ::OpenApiSDK::Operations::TrackCustomerRequestBody.new(
  customer_id: "<id>",
)
    
res = s.track.customer(req)

if ! res.object.nil?
  # handle response
end

Parameters

Parameter Type Required Description
request ::OpenApiSDK::Operations::TrackCustomerRequestBody ✔️ The request object to use for the request.

Response

T.nilable(::OpenApiSDK::Operations::TrackCustomerResponse)