Skip to content

Instantly share code, notes, and snippets.

@gurdasnijor
Last active January 22, 2021 17:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gurdasnijor/748ded4696cc4a0b45c718c43271756b to your computer and use it in GitHub Desktop.
Save gurdasnijor/748ded4696cc4a0b45c718c43271756b to your computer and use it in GitHub Desktop.
create journey mutation
mutation {
createJourney(
workspaceId: "fUWqmMQQC1M4ALKaerfQxx",
spaceId: "spa_1mkMoi0PxXlBQEHLGIRZm6MDRtk",
input: {
description: "a cool descript",
key: "some_key",
name: "cool journey",
definition: {
version: "1.2.0"
initial: "visited_site_without_adding_to_cart"
key: "journey_def_v3.1"
states: {
visited_site_without_adding_to_cart: {
meta: {
type: "audience"
audience_ast: {
children: [
{
children: [
{
children: [
{
children: [
{
options: {
durationBetween: [0, 604800]
durationBetweenUnits: ["day", "day"]
durationRelativeParent: true
}
type: "event.count"
value: "Added Item To Cart"
}
{ type: "constant.integer", value: "1" }
]
type: "operator"
value: "="
}
]
type: "operator"
value: "not"
}
]
options: {
durationBetween: [86400, 604800]
durationBetweenUnits: ["day", "day"]
exportRef: "viewed-homepge-0"
}
type: "event.count"
value: "Viewed Homepge"
}
{ type: "constant.integer", value: "1" }
]
type: "operator"
value: ">="
}
name: "Visited Site Without Adding To Cart"
}
after: {
viewed_shirts: {
delay: { units: "days", amount: 86400 }
target: "viewed_shirts"
}
viewed_sweatshirts: {
delay: { units: "days", amount: 86400 }
target: "viewed_sweatshirts"
}
viewed_pants: {
delay: { units: "days", amount: 86400 }
target: "viewed_pants"
}
}
}
viewed_shirts: {
meta: {
type: "audience"
audience_ast: {
children: [
{ type: "trait.string", value: "last_product_viewed" }
{ type: "constant.string", value: "shirts" }
]
type: "operator"
value: "="
}
name: "Viewed Shirts"
}
on: {
vetern_user_abandon_shirts: {
target: "vetern_user_abandon_shirts"
condition: {
children: [
{ type: "trait.float", value: "lifetime_checkouts" }
{ type: "constant.float", value: "0" }
]
type: "operator"
value: ">"
}
}
new_user_abandon_shirts: {
target: "new_user_abandon_shirts"
condition: {
children: [
{ type: "trait.float", value: "lifetime_checkouts" }
{ type: "constant.float", value: "0" }
]
type: "operator"
value: "<="
}
}
}
}
vetern_user_abandon_shirts: {
meta: { type: "audience", name: "Vetern User Abandon Shirts" }
}
new_user_abandon_shirts: {
meta: { type: "audience", name: "New User Abandon Shirts" }
}
viewed_sweatshirts: {
meta: {
type: "audience"
audience_ast: {
children: [
{ type: "trait.string", value: "last_product_viewed" }
{ type: "constant.string", value: "sweatshirts" }
]
type: "operator"
value: "="
}
name: "Viewed Sweatshirts"
}
on: {
completed_shirt_checkout_email_106: {
target: "completed_shirt_checkout_email_106"
condition: {
children: [
{
children: [{ type: "trait.string", value: "email" }]
type: "operator"
value: "is not null"
}
{
children: [
{
children: [
{
children: [
{
type: "event.property.string"
value: "email_id"
}
{ type: "constant.string", value: "103" }
]
type: "operator"
value: "="
}
]
options: { duration: 604800, durationUnit: "day" }
type: "event.count"
value: "Click Coupon Email Link"
}
{ type: "constant.integer", value: "1" }
]
type: "operator"
value: ">="
}
]
type: "operator"
value: "and"
}
}
didnt_complete_shirt_checkout_email_106: {
target: "didnt_complete_shirt_checkout_email_106"
condition: {
children: [
{
children: [{ type: "trait.string", value: "email" }]
type: "operator"
value: "is not null"
}
{
children: [
{
children: [
{
children: [
{
type: "event.property.string"
value: "email_id"
}
{ type: "constant.string", value: "103" }
]
type: "operator"
value: "="
}
]
options: { duration: 604800, durationUnit: "day" }
type: "event.count"
value: "Click Coupon Email Link"
}
{ type: "constant.integer", value: "1" }
]
type: "operator"
value: ">="
}
]
type: "operator"
value: "and"
}
}
is_valuable_customer: {
target: "is_valuable_customer"
condition: {
children: [{ type: "trait.string", value: "email" }]
type: "operator"
value: "is not null"
}
}
}
}
is_valuable_customer: {
meta: {
type: "audience"
audience_ast: {
children: [
{ type: "trait.string", value: "valuable_customer" }
{ type: "constant.string", value: "true" }
]
type: "operator"
value: "="
}
name: "Is Valuable Customer"
}
on: {
completed_shirt_checkout_email_13: {
target: "completed_shirt_checkout_email_13"
condition: {
children: [
{
children: [{ type: "trait.string", value: "email" }]
type: "operator"
value: "is not null"
}
{
children: [
{
children: [
{
children: [
{
type: "event.property.string"
value: "email_id"
}
{ type: "constant.string", value: "13" }
]
type: "operator"
value: "="
}
]
options: { duration: 604800, durationUnit: "day" }
type: "event.count"
value: "Click Coupon Email Link"
}
{ type: "constant.integer", value: "1" }
]
type: "operator"
value: ">="
}
]
type: "operator"
value: "and"
}
}
didnt_complete_shirt_checkout_email_13: {
target: "didnt_complete_shirt_checkout_email_13"
condition: {
children: [
{
children: [{ type: "trait.string", value: "email" }]
type: "operator"
value: "is not null"
}
{
children: [
{
children: [
{
children: [
{
type: "event.property.string"
value: "email_id"
}
{ type: "constant.string", value: "103" }
]
type: "operator"
value: "="
}
]
options: { duration: 604800, durationUnit: "day" }
type: "event.count"
value: "Click Coupon Email Link"
}
{ type: "constant.integer", value: "1" }
]
type: "operator"
value: ">="
}
]
type: "operator"
value: "and"
}
}
}
}
completed_shirt_checkout_email_106: {
meta: {
type: "audience"
audience_ast: {
children: [
{
children: [
{
children: [
{
type: "event.property.string"
value: "product_type"
}
{ type: "constant.string", value: "shirt" }
]
type: "operator"
value: "="
}
]
options: { duration: 604800, durationUnit: "day" }
type: "event.count"
value: "Completed Checkout"
}
{ type: "constant.integer", value: "1" }
]
type: "operator"
value: ">="
}
name: "Completed Shirt Checkout Email 106"
}
}
didnt_complete_shirt_checkout_email_106: {
meta: {
type: "audience"
audience_ast: {
children: [
{
children: [
{
children: [
{
type: "event.property.string"
value: "product_type"
}
{ type: "constant.string", value: "shirt" }
]
type: "operator"
value: "="
}
]
options: { duration: 604800, durationUnit: "day" }
type: "event.count"
value: "Completed Checkout"
}
{ type: "constant.integer", value: "0" }
]
type: "operator"
value: "="
}
name: "Didnt Complete Shirt Checkout Email 106"
}
}
completed_shirt_checkout_email_13: {
meta: {
type: "audience"
audience_ast: {
children: [
{
children: [
{
children: [
{
type: "event.property.string"
value: "product_type"
}
{ type: "constant.string", value: "shirt" }
]
type: "operator"
value: "="
}
]
options: { duration: 604800, durationUnit: "day" }
type: "event.count"
value: "Completed Checkout"
}
{ type: "constant.integer", value: "1" }
]
type: "operator"
value: ">="
}
name: "Completed Shirt Checkout Email 13"
}
}
didnt_complete_shirt_checkout_email_13: {
meta: {
type: "audience"
audience_ast: {
children: [
{
children: [
{
children: [
{
type: "event.property.string"
value: "product_type"
}
{ type: "constant.string", value: "shirt" }
]
type: "operator"
value: "="
}
]
options: { duration: 604800, durationUnit: "day" }
type: "event.count"
value: "Completed Checkout"
}
{ type: "constant.integer", value: "0" }
]
type: "operator"
value: "="
}
name: "Didnt Complete Shirt Checkout Email 13"
}
}
viewed_pants: {
meta: {
type: "audience"
audience_ast: {
children: [
{ type: "trait.string", value: "last_product_viewed" }
{ type: "constant.string", value: "shirts" }
]
type: "operator"
value: "="
}
name: "Viewed Pants"
}
}
}
}
}
) {
id
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment