Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Woocommerce offline transactions to GA scenario config
{
"name": "Woocommerce POS to GA",
"flow": [
{
"id": 1,
"module": "woocommerce:WatchOrders",
"version": 2,
"parameters": {
"limit": 10,
"__IMTCONN__": 521435
},
"mapper": {},
"metadata": {
"designer": {
"x": 0,
"y": 150
},
"restore": {
"__IMTCONN__": {
"label": "My WooCommerce connection"
}
},
"parameters": [
{
"name": "__IMTCONN__",
"type": "account",
"label": "Connection",
"required": true
},
{
"name": "limit",
"type": "number",
"label": "Limit",
"required": true
}
]
}
},
{
"id": 5,
"module": "builtin:BasicRouter",
"version": 1,
"mapper": null,
"metadata": {
"designer": {
"x": 300,
"y": 150
}
},
"routes": [
{
"flow": [
{
"id": 3,
"module": "http:ActionSendData",
"version": 3,
"parameters": {
"handleErrors": false
},
"filter": {
"name": "POS",
"conditions": [
[
{
"a": "{{1.paymentMethod}}",
"b": "pos_cash",
"o": "text:contain:ci"
}
]
]
},
"mapper": {
"qs": [],
"url": "https://www.google-analytics.com/collect",
"data": "v=1&t=pageview&tid=UA-XXXXXX-1&cid=555&dh=terminal42.com.ua&dp=%2Fpos&dt=POS&ti={{1.id}}&ta=POS&tr={{1.total}}&tt={{1.totalTax}}&pa=purchase&pr1id={{1.lineItems[].productId}}&pr1nm={{1.lineItems[].name}}&pr1qt={{1.lineItems[].quantity}}&pr1pr={{1.lineItems[].price}}",
"gzip": true,
"method": "post",
"headers": [],
"timeout": "",
"authPass": "",
"authUser": "",
"bodyType": "raw",
"contentType": "",
"shareCookies": false,
"followRedirect": true,
"useQuerystring": false,
"rejectUnauthorized": true
},
"metadata": {
"designer": {
"x": 600,
"y": 0
},
"restore": {
"qs": {
"mode": "chose",
"items": []
},
"method": {
"mode": "chose",
"label": "POST"
},
"headers": {
"mode": "chose",
"items": []
},
"bodyType": {
"label": "Raw"
},
"contentType": {
"label": ""
}
},
"parameters": [
{
"name": "handleErrors",
"type": "boolean",
"label": "Evaluate all states as errors (except for 2xx and 3xx )",
"required": true
}
],
"expect": [
{
"name": "url",
"type": "url",
"label": "URL",
"required": true
},
{
"name": "method",
"type": "select",
"label": "Method",
"required": true,
"validate": {
"enum": [
"get",
"head",
"post",
"put",
"patch",
"delete"
]
}
},
{
"name": "qs",
"spec": [
{
"name": "name",
"type": "text",
"label": "Name",
"required": true
},
{
"name": "value",
"type": "text",
"label": "Value"
}
],
"type": "array",
"label": "Query String",
"labels": {
"add": "Add parameter",
"edit": "Edit parameter"
}
},
{
"name": "headers",
"spec": [
{
"name": "name",
"type": "text",
"label": "Name",
"required": true
},
{
"name": "value",
"type": "text",
"label": "Value"
}
],
"type": "array",
"label": "Headers",
"labels": {
"add": "Add a header",
"edit": "Edit a header"
}
},
{
"name": "authUser",
"type": "text",
"label": "User name"
},
{
"name": "authPass",
"type": "password",
"label": "Password"
},
{
"name": "timeout",
"type": "uinteger",
"label": "Timeout",
"validate": {
"max": 300,
"min": 1
}
},
{
"name": "shareCookies",
"type": "boolean",
"label": "Share cookies with other HTTP modules",
"required": true
},
{
"name": "rejectUnauthorized",
"type": "boolean",
"label": "Reject connections that are using unverified (self-signed) certificates",
"required": true
},
{
"name": "followRedirect",
"type": "boolean",
"label": "Follow redirect",
"required": true
},
{
"name": "useQuerystring",
"type": "boolean",
"label": "Disable serialization of multiple same query string keys as arrays",
"required": true
},
{
"name": "gzip",
"type": "boolean",
"label": "Request compressed content",
"required": true
},
{
"name": "bodyType",
"type": "select",
"label": "Body type",
"validate": {
"enum": [
"raw",
"x_www_form_urlencoded",
"multipart_form_data"
]
}
},
{
"name": "contentType",
"type": "select",
"label": "Content type",
"validate": {
"enum": [
"text/plain",
"application/json",
"application/xml",
"text/xml",
"text/html",
"custom"
]
}
},
{
"name": "data",
"type": "buffer",
"label": "Request content"
}
],
"advanced": true
}
}
]
},
{
"flow": [
{
"id": 6,
"module": "http:ActionSendData",
"version": 3,
"parameters": {
"handleErrors": false
},
"filter": {
"name": "Refund",
"conditions": [
[
{
"a": "{{1.status}}",
"b": "refunded",
"o": "text:equal:ci"
}
]
]
},
"mapper": {
"qs": [],
"url": "https://www.google-analytics.com/collect",
"data": "v=1&t=event&tid=UA-XXXXXX-1&cid=555&ec=Ecommerce&ea=Refund&ni=1&ti={{1.id}}&pa=refund",
"gzip": true,
"method": "post",
"headers": [],
"timeout": "",
"authPass": "",
"authUser": "",
"bodyType": "raw",
"contentType": "",
"shareCookies": false,
"followRedirect": true,
"useQuerystring": false,
"rejectUnauthorized": true
},
"metadata": {
"designer": {
"x": 600,
"y": 300
},
"restore": {
"qs": {
"mode": "chose",
"items": []
},
"method": {
"mode": "chose",
"label": "POST"
},
"headers": {
"mode": "chose",
"items": []
},
"bodyType": {
"label": "Raw"
},
"contentType": {
"label": ""
}
},
"parameters": [
{
"name": "handleErrors",
"type": "boolean",
"label": "Evaluate all states as errors (except for 2xx and 3xx )",
"required": true
}
],
"expect": [
{
"name": "url",
"type": "url",
"label": "URL",
"required": true
},
{
"name": "method",
"type": "select",
"label": "Method",
"required": true,
"validate": {
"enum": [
"get",
"head",
"post",
"put",
"patch",
"delete"
]
}
},
{
"name": "qs",
"spec": [
{
"name": "name",
"type": "text",
"label": "Name",
"required": true
},
{
"name": "value",
"type": "text",
"label": "Value"
}
],
"type": "array",
"label": "Query String",
"labels": {
"add": "Add parameter",
"edit": "Edit parameter"
}
},
{
"name": "headers",
"spec": [
{
"name": "name",
"type": "text",
"label": "Name",
"required": true
},
{
"name": "value",
"type": "text",
"label": "Value"
}
],
"type": "array",
"label": "Headers",
"labels": {
"add": "Add a header",
"edit": "Edit a header"
}
},
{
"name": "authUser",
"type": "text",
"label": "User name"
},
{
"name": "authPass",
"type": "password",
"label": "Password"
},
{
"name": "timeout",
"type": "uinteger",
"label": "Timeout",
"validate": {
"max": 300,
"min": 1
}
},
{
"name": "shareCookies",
"type": "boolean",
"label": "Share cookies with other HTTP modules",
"required": true
},
{
"name": "rejectUnauthorized",
"type": "boolean",
"label": "Reject connections that are using unverified (self-signed) certificates",
"required": true
},
{
"name": "followRedirect",
"type": "boolean",
"label": "Follow redirect",
"required": true
},
{
"name": "useQuerystring",
"type": "boolean",
"label": "Disable serialization of multiple same query string keys as arrays",
"required": true
},
{
"name": "gzip",
"type": "boolean",
"label": "Request compressed content",
"required": true
},
{
"name": "bodyType",
"type": "select",
"label": "Body type",
"validate": {
"enum": [
"raw",
"x_www_form_urlencoded",
"multipart_form_data"
]
}
},
{
"name": "contentType",
"type": "select",
"label": "Content type",
"validate": {
"enum": [
"text/plain",
"application/json",
"application/xml",
"text/xml",
"text/html",
"custom"
]
}
},
{
"name": "data",
"type": "buffer",
"label": "Request content"
}
],
"advanced": true
}
}
]
}
]
}
],
"metadata": {
"version": 1,
"scenario": {
"roundtrips": 1,
"maxErrors": 3,
"autoCommit": false,
"sequential": false,
"confidential": false,
"dataloss": false,
"dlq": false
},
"designer": {
"orphans": []
},
"zone": "eu1.integromat.com"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.