Segment.Spec.Product (Peacemaker v3.3.5-rc.7) View Source
Builds a token for creating a Product struct, that can be attached during the Order Completed tracking event via Segment.Spec.Order.add_product/2.
You can check out the Segment docs for more information
Link to this section Summary
Functions
Creates a token that can be added to the Order struct via Segment.Spec.Order.add_product/2.
Set the brand associated with the product
Set the product category being viewed
Set the coupon code associated with a product (e.g TRIPWIRENAME)
Set the image url of the product
Set the name of the product being viewed
Set the position in the product list (ex. 3)
Set the price ($) of the product being viewed
Set the database id of the product being viewed
Set the quantity of a product
Set the sku of the product being viewed
Set the URL of the product page
Set the variant of the product (e.g. Black)
Link to this section Types
Specs
Specs
Link to this section Functions
Specs
build(limelight_webhook_request()) :: t() | {atom(), Ecto.Changeset.t()}
Creates a token that can be added to the Order struct via Segment.Spec.Order.add_product/2.
NOTE: For now, this function was intended to be passed the response from PeacemakerV2.Products.get_product_attributes(product_sku, campaign_id)
Specs
set_brand(
%Segment.Spec.Product{
brand: term(),
category: term(),
coupon: term(),
image_url: term(),
name: term(),
position: term(),
price: term(),
product_id: term(),
quantity: term(),
sku: term(),
url: term(),
variant: term()
},
String.t()
) :: %Segment.Spec.Product{
brand: term(),
category: term(),
coupon: term(),
image_url: term(),
name: term(),
position: term(),
price: term(),
product_id: term(),
quantity: term(),
sku: term(),
url: term(),
variant: term()
}
Set the brand associated with the product
Specs
set_category(
%Segment.Spec.Product{
brand: term(),
category: term(),
coupon: term(),
image_url: term(),
name: term(),
position: term(),
price: term(),
product_id: term(),
quantity: term(),
sku: term(),
url: term(),
variant: term()
},
String.t()
) :: %Segment.Spec.Product{
brand: term(),
category: term(),
coupon: term(),
image_url: term(),
name: term(),
position: term(),
price: term(),
product_id: term(),
quantity: term(),
sku: term(),
url: term(),
variant: term()
}
Set the product category being viewed
Specs
set_coupon(
%Segment.Spec.Product{
brand: term(),
category: term(),
coupon: term(),
image_url: term(),
name: term(),
position: term(),
price: term(),
product_id: term(),
quantity: term(),
sku: term(),
url: term(),
variant: term()
},
String.t()
) :: %Segment.Spec.Product{
brand: term(),
category: term(),
coupon: term(),
image_url: term(),
name: term(),
position: term(),
price: term(),
product_id: term(),
quantity: term(),
sku: term(),
url: term(),
variant: term()
}
Set the coupon code associated with a product (e.g TRIPWIRENAME)
Specs
set_image_url(
%Segment.Spec.Product{
brand: term(),
category: term(),
coupon: term(),
image_url: term(),
name: term(),
position: term(),
price: term(),
product_id: term(),
quantity: term(),
sku: term(),
url: term(),
variant: term()
},
String.t()
) :: %Segment.Spec.Product{
brand: term(),
category: term(),
coupon: term(),
image_url: term(),
name: term(),
position: term(),
price: term(),
product_id: term(),
quantity: term(),
sku: term(),
url: term(),
variant: term()
}
Set the image url of the product
Specs
set_name(
%Segment.Spec.Product{
brand: term(),
category: term(),
coupon: term(),
image_url: term(),
name: term(),
position: term(),
price: term(),
product_id: term(),
quantity: term(),
sku: term(),
url: term(),
variant: term()
},
String.t()
) :: %Segment.Spec.Product{
brand: term(),
category: term(),
coupon: term(),
image_url: term(),
name: term(),
position: term(),
price: term(),
product_id: term(),
quantity: term(),
sku: term(),
url: term(),
variant: term()
}
Set the name of the product being viewed
Specs
set_position(
%Segment.Spec.Product{
brand: term(),
category: term(),
coupon: term(),
image_url: term(),
name: term(),
position: term(),
price: term(),
product_id: term(),
quantity: term(),
sku: term(),
url: term(),
variant: term()
},
String.t()
) :: %Segment.Spec.Product{
brand: term(),
category: term(),
coupon: term(),
image_url: term(),
name: term(),
position: term(),
price: term(),
product_id: term(),
quantity: term(),
sku: term(),
url: term(),
variant: term()
}
Set the position in the product list (ex. 3)
Specs
set_price(
%Segment.Spec.Product{
brand: term(),
category: term(),
coupon: term(),
image_url: term(),
name: term(),
position: term(),
price: term(),
product_id: term(),
quantity: term(),
sku: term(),
url: term(),
variant: term()
},
integer()
) :: %Segment.Spec.Product{
brand: term(),
category: term(),
coupon: term(),
image_url: term(),
name: term(),
position: term(),
price: term(),
product_id: term(),
quantity: term(),
sku: term(),
url: term(),
variant: term()
}
Set the price ($) of the product being viewed
Specs
set_product_id(
%Segment.Spec.Product{
brand: term(),
category: term(),
coupon: term(),
image_url: term(),
name: term(),
position: term(),
price: term(),
product_id: term(),
quantity: term(),
sku: term(),
url: term(),
variant: term()
},
String.t()
) :: %Segment.Spec.Product{
brand: term(),
category: term(),
coupon: term(),
image_url: term(),
name: term(),
position: term(),
price: term(),
product_id: term(),
quantity: term(),
sku: term(),
url: term(),
variant: term()
}
Set the database id of the product being viewed
Specs
set_quantity(
%Segment.Spec.Product{
brand: term(),
category: term(),
coupon: term(),
image_url: term(),
name: term(),
position: term(),
price: term(),
product_id: term(),
quantity: term(),
sku: term(),
url: term(),
variant: term()
},
integer()
) :: %Segment.Spec.Product{
brand: term(),
category: term(),
coupon: term(),
image_url: term(),
name: term(),
position: term(),
price: term(),
product_id: term(),
quantity: term(),
sku: term(),
url: term(),
variant: term()
}
Set the quantity of a product
Specs
set_sku(
%Segment.Spec.Product{
brand: term(),
category: term(),
coupon: term(),
image_url: term(),
name: term(),
position: term(),
price: term(),
product_id: term(),
quantity: term(),
sku: term(),
url: term(),
variant: term()
},
String.t()
) :: %Segment.Spec.Product{
brand: term(),
category: term(),
coupon: term(),
image_url: term(),
name: term(),
position: term(),
price: term(),
product_id: term(),
quantity: term(),
sku: term(),
url: term(),
variant: term()
}
Set the sku of the product being viewed
Specs
set_url(
%Segment.Spec.Product{
brand: term(),
category: term(),
coupon: term(),
image_url: term(),
name: term(),
position: term(),
price: term(),
product_id: term(),
quantity: term(),
sku: term(),
url: term(),
variant: term()
},
String.t()
) :: %Segment.Spec.Product{
brand: term(),
category: term(),
coupon: term(),
image_url: term(),
name: term(),
position: term(),
price: term(),
product_id: term(),
quantity: term(),
sku: term(),
url: term(),
variant: term()
}
Set the URL of the product page
Specs
set_variant(
%Segment.Spec.Product{
brand: term(),
category: term(),
coupon: term(),
image_url: term(),
name: term(),
position: term(),
price: term(),
product_id: term(),
quantity: term(),
sku: term(),
url: term(),
variant: term()
},
String.t()
) :: %Segment.Spec.Product{
brand: term(),
category: term(),
coupon: term(),
image_url: term(),
name: term(),
position: term(),
price: term(),
product_id: term(),
quantity: term(),
sku: term(),
url: term(),
variant: term()
}
Set the variant of the product (e.g. Black)