-
Notifications
You must be signed in to change notification settings - Fork 284
Tiktok web crm #3128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tiktok web crm #3128
Conversation
@@ -159,3 +358,17 @@ function validateRequestPage(payload: Payload) { | |||
|
|||
return requestPage | |||
} | |||
|
|||
function validateRequestLead(payload: Payload) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please define a return type.
description: | ||
'Lead source of TikTok leads. Please set this field to the name of your CRM system, such as HubSpot or Salesforce.', | ||
type: 'string', | ||
default: { '@path': '$.properties.lead_event_source' } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommend adding this
required: {
conditions: [
{
fieldKey: 'event_source',
operator: 'is',
value: 'crm'
}
]
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also
depends_on: {
conditions: [
{
fieldKey: 'event_source',
operator: 'is',
value: 'crm'
}
]
}
This will hide the field if event_source is not crm
label: 'State of the Vehicle', | ||
type: 'string', | ||
description: 'Vehicle status. Supported values: "New", "Used", "CPO".', | ||
default: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
think about removing the default.
{ value: 'CPO', label: 'CPO' } | ||
] | ||
}, | ||
mileage: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
split this into mileage_value and mileage_unit fields.
default: { | ||
'@path': '$.properties.transmission' | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove defaults.
default: { | ||
'@path': '$.properties.body_style' | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove defaults.
body_style: { | ||
label: 'Body Type of the Vehicle', | ||
type: 'string', | ||
description: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to enumerate
fuel_type: { | ||
label: 'Fuel Type of the Vehicle', | ||
type: 'string', | ||
description: 'Vehicle fuel type. Supported values: "Diesel", "Electric", "Flex", "Gasoline", "Hybrid", "Other".', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to enumerate in the description
{ value: 'Other', label: 'Other' } | ||
] | ||
}, | ||
preferred_price_range: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Split into preferred_price_range_min and preferred_price_range_max
lead_id?: string | ||
lead_event_source?: string | ||
} | ||
|
||
export interface TikTokConversionsProperties { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
define types for vehicle and travel fields.
define types for crm and web payloads.
Update util logic to ensure the correct types.
}, | ||
mileage: { | ||
label: 'Milage of the Vehicle', | ||
travel_fields: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue as lead_fields
where types were not generated
}, | ||
preferred_price_range: { | ||
label: 'Preferred Price Range of the Vehicle', | ||
auto_fields: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue as lead_fields
where types were not generated
const baseRequestProperties: TikTokConversionsProperties = buildBaseRequestProperties(payload) | ||
|
||
if (payload.event_source === 'web') { | ||
if (payload.travel_fields) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I check for travel & auto fields this way to build the properties objects?
Or do i need to check if the actual variables exist (i.e. payload.travel_fields?.city
)?
Hi @jae-rhee-tiktok I moved the PR to this internally raised PR #3133 I also did a lot of refactoring. Shall we schedule a call to finish this off? |
WIP - TicTok CRM
Testing
TBD