Assets for the Movable Ink integration

Important: This integration is only available under controlled availability with Movable Ink. Please reach out to Movable Ink to check eligibility.

This integration lets you stream any event data within Oracle Infinity to Movable Ink's Customer Data API. Event data can then be used to personalize Movable Ink content across email and mobile messages.

In this topic, you can access information about the following assets:

Required parameters per Movable Ink event

Back to top

This section details the required parameters per Movable Ink event:

In addition to the events outlined above, Movable Ink now has support for Custom Events. A Custom Event can be any event captured by Oracle Infinity.

Note: Any data transformations within Oracle are not needed because Movable Ink's Solutions team will complete an event mapping within MI and can add JSON to transform data (ex. reformat a timestamp, convert a number to a string, etc.)

Product Viewed

  • Description: Upon view of a product within your website/mobile app.

Required Variables

Below is a sample event schema.

Movable Ink Parameter

Required

Recommended Infinity parameter

Description

Sample value

Notes

timestamp

Yes

datetime_utc

The time when the event occurred (Unix Time)

2023-10-05T10:02:35.738Z

 

user_id or anonymous_id

Yes

wt.dcsvid

The unique identifier of the profile / anonymous profile that triggered this event.

wt.dcsvid=customerid14323

Please speak to Movable Ink for suggestions on what identifier to use per customer.

properties.id

Yes

wt.pn_sku

or 

wt.pn_id

The unique identifier of the product.

wt.pn_sku=56544-abc

wt.pn_id=56544

Only one is required.

timezone

No

ext.geo.tzname

The time zone of where the event took place (TZ database name in the IANA Time Zone Database)

ext.geo.tzname = 'asia/kolkata'

 

 

properties.title

No

wt.product_name

The title or name of the product.

wt.product_name=All-Purpose Cleaning Wipes

 

properties.price

No

wt.product_price

The product price

wt.product_price=14.99

Must be in decimal form (that is, no currency symbol).

properties.url

No

wt.es

The URL of the product.

wt.es=https://mysite.com/product/56544

If tracking mobile app, the URL must point to your product page on your website (so that Movable Ink can visit the page to grab information about the page).

properties.categories

No

wt.cg_n

An array of Categories with which this product is associated

wt.cg_n=bathroom

If using Category View event, then this value must match list_id within that event.

properties.category[i].id

No

data.wt.cg_n

For each Category, the unique identifier of the Category.

wt.cg_n = 'collections'

 

 

properties.category[i].url

No

 

For each Category, the URL of the Category.

 

 

properties.meta

No

ext.browser.name

A map of meta data to provide additional context about the event.

ext.browser.name = 'chrome'

 

Note: Movable Ink's Customer Data API is flexible. Movable Ink does not require that event data sent use the exact same parameter names outlined here. For example, if the parameters in the event payload is originally "wt.product_price", it can be sent to Movable Ink with the label "wt.product_price" and does not have to be updated to use the label 'Price'.

Back to required parameters list

Cart Add

  • Description: Adding a product to your cart within your website/mobile app.

Required variables

Below is a sample event schema.

Movable Ink Parameter

Required

Recommended Infinity parameter

Description

Sample value

Notes

timestamp

Yes

datetime_utc

The time when the event occurred (Unix Time)

2023-10-05T10:02:35.738Z

 

user_id or anonymous_id

Yes

wt.dcsvid

The unique identifier of the profile / anonymous profile that triggered this event.

wt.dcsvid=customerid14323

Please speak to Movable Ink for suggestions on what identifier to use per customer.

properties.id

Yes

wt.pn_sku

or 

wt.pn_id

The unique identifier of the product.

wt.pn_sku=56544-abc

wt.pn_id=56544

Only one is required.

timezone

No

ext.geo.tzname

The time zone of where the event took place (TZ database name in the IANA Time Zone Database)

ext.geo.tzname = 'asia/kolkata'

 

 

properties.title

No

wt.product_name

The title or name of the product.

wt.product_name=All-Purpose Cleaning Wipes

 

properties.url

No

wt.es

The URL of the product.

wt.es=https://mysite.com/product/56544

If tracking mobile app, the URL must point to your product page on your website (so that Movable Ink can visit the page to grab information about the page).

properties.categories

No

wt.cg_n

An array of Categories with which this product is associated

wt.cg_n=bathroom

If using Category View event, then this value must match list_id within that event.

properties.category[i].id

No

data.wt.cg_n

For each Category, the unique identifier of the Category.

wt.cg_n = 'collections'

 

 

properties.category[i].url

No

 

For each Category, the URL of the Category.

 

 

properties.meta

No

ext.browser.name

A map of meta data to provide additional context about the event.

ext.browser.name = 'chrome'

 

Note: Movable Ink does not require that event data sent use the exact same parameter names outlined here. For example, if the parameters in the event payload is originally "wt.product_price", it can be sent to Movable Ink with the label "wt.product_price" and does not have to be updated to use the label 'Price'.

Back to required parameters list

Conversion

  • Description: Completing an order within your website/mobile app.

Required variables

Below is a sample event schema.

Movable Ink Parameter

Required

Recommended Infinity parameter

Description

Sample value

Notes

timestamp

Yes

datetime_utc

The time when the event occurred (Unix Time)

2023-10-05T10:02:35.738Z

 

user_id or anonymous_id

Yes

wt.dcsvid

The unique identifier of the profile / anonymous profile that triggered this event.

wt.dcsvid=customerid14323

Please speak to Movable Ink for suggestions on what identifier to use per customer.

properties.id

Yes

wt.pn_sku

or 

wt.pn_id

The unique identifier of the product.

wt.pn_sku=56544-abc

wt.pn_id=56544

Only one is required.

properties.products

Yes

wt.product_name

An array of products purchased with this order.

wt.product_name=[tv,laptop]

 

properties.products[i].id

Yes

wt.pn_sku

or 

wt.pn_id

For each product, a unique identifier of the product.

wt.pn_sku=56544-abc

wt.pn_id=56544

 

timezone

No

ext.geo.tzname

The time zone of where the event took place (TZ database name in the IANA Time Zone Database)

ext.geo.tzname = 'asia/kolkata'

 

properties.revenue

No

wt.cart_subtotal

The revenue generated by the purchase of this order.

wt.cart_subtotal=34.97

Must be in decimal form (that is, no currency symbol)

properties.products[i].title

No

wt.product_name

For each product, a title or name of the product.

wt.product_name=All-Purpose Cleaning Wipes

 

properties.products[i].price

No

wt.product_price

The product price.

wt.product_price=14.99

Must be in decimal form (that is, no currency symbol).

properties.products[i].quantity

No

wt.tx_u

For each product, the quantity of this product purchased.

wt.tx_u=1;2

Delimiter must be ';'

properties. products[i].url

No

wt.es

For each product, the URL of the product.

wt.es=https://mysite.com/product/56544

If tracking mobile app, the URL must point to your product page on your website (so that Movable Ink can visit the page to grab information about the page).

Note: Movable Ink does not require that event data sent use the exact same parameter names outlined here. For example, if the parameters in the event payload is originally "wt.product_price", it can be sent to Movable Ink with the label "wt.product_price" and does not have to be updated to use the label 'Price'.

Back to required parameters list

Identify

  • Description: Any point during a user's website or mobile application visit where they declare their customer ID (for example, logging in or completing a purchase).

Required variables

Below is a sample event schema.

Movable Ink Parameter

Required

Recommended Infinity parameter

Description

Sample value

Notes

timestamp

Yes

datetime_utc

The time when the event occurred (Unix Time)

2023-10-05T10:02:35.738Z

 

user_id or anonymous_id

Yes

wt.dcsvid

The unique identifier of the profile / anonymous profile that triggered this event.

wt.dcsvid=customerid14323

Please speak to Movable Ink for suggestions on what identifier to use per customer.

timezone

No

ext.geo.tzname

The time zone of where the event took place (TZ database name in the IANA Time Zone Database)

ext.geo.tzname = 'asia/kolkata'

 

 

Note: Movable Ink does not require that event data sent use the exact same parameter names outlined here. For example, if the parameters in the event payload is originally "wt.product_price", it can be sent to Movable Ink with the label "wt.product_price" and does not have to be updated to use the label 'Price'.

Back to required parameters list

Search

  • Description: Upon search within your website or mobile application.

Required variables

Below is a sample event schema.

Movable Ink Parameter

Required

Recommended Infinity parameter

Description

Sample value

Notes

timestamp

Yes

datetime_utc

The time when the event occurred (Unix Time)

2023-10-05T10:02:35.738Z

 

user_id or anonymous_id

Yes

wt.dcsvid

The unique identifier of the profile / anonymous profile that triggered this event.

wt.dcsvid=customerid14323

Please speak to Movable Ink for suggestions on what identifier to use per customer.

properties.query

Yes

wt.product_name

The title or name of the product

wt.product_name=All-Purpose Cleaning Wipes

 

timezone

No

ext.geo.tzname

The time zone of where the event took place (TZ database name in the IANA Time Zone Database)

ext.geo.tzname = 'asia/kolkata'

 

 

properties.url

No

wt.es

The URL of the product.

wt.es=https://mysite.com/product/56544

If tracking mobile app, the URL must point to your product page on your website (so that Movable Ink can visit the page to grab information about the page).

Note: Movable Ink does not require that event data sent use the exact same parameter names outlined here. For example, if the parameters in the event payload is originally "wt.product_price", it can be sent to Movable Ink with the label "wt.product_price" and does not have to be updated to use the label 'Price'.

Back to required parameters list

Category View

  • Description: Upon view of a listings page for your product (for example, a page listing all of the clothing on your website).

Required variables

Below is a sample event schema.

Movable Ink Parameter

Required

Recommended Infinity parameter

Description

Sample value

Notes

timestamp

Yes

datetime_utc

The time when the event occurred (Unix Time)

2023-10-05T10:02:35.738Z

 

user_id or anonymous_id

Yes

wt.dcsvid

The unique identifier of the profile / anonymous profile that triggered this event.

wt.dcsvid=customerid14323

Please speak to Movable Ink for suggestions on what identifier to use per customer.

properties.id

Yes

wt.pn_sku

or 

wt.pn_id

The unique identifier of the product.

wt.pn_sku=56544-abc

wt.pn_id=56544

Only one is required.

timezone

No

ext.geo.tzname

The time zone of where the event took place (TZ database name in the IANA Time Zone Database)

ext.geo.tzname = 'asia/kolkata'

 

 

properties.title

No

wt.product_name

The title or name of the product.

wt.product_name=All-Purpose Cleaning Wipes

 

properties.url

No

wt.es

The URL of the product.

wt.es=https://mysite.com/product/56544

If tracking mobile app, the URL must point to your product page on your website (so that Movable Ink can visit the page to grab information about the page).

Note: Movable Ink does not require that event data sent use the exact same parameter names outlined here. For example, if the parameters in the event payload is originally "wt.product_price", it can be sent to Movable Ink with the label "wt.product_price" and does not have to be updated to use the label 'Price'.

Back to required parameters list

Custom Event

  • Description: A Custom Event can be any event captured by Oracle Infinity.

Required variables

Below is a description of the data which must be collected for this event by Oracle Infinity.

Movable Ink Parameter

Required

Recommended Infinity parameter

Description

Sample value

Notes

timestamp

Yes

datetime_utc

The time when the event occurred (Unix Time)

2023-10-05T10:02:35.738Z

 

user_id or anonymous_id

Yes

wt.dcsvid

The unique identifier of the profile / anonymous profile that triggered this event.

wt.dcsvid=customerid14323

Please speak to Movable Ink for suggestions on what identifier to use per customer.

timezone

No

ext.geo.tzname

The time zone of where the event took place (TZ database name in the IANA Time Zone Database)

ext.geo.tzname = 'asia/kolkata'

 

properties.meta

No

 

A map of meta data to provide additional context about the event.

 

 

Note: Movable Ink does not require that event data sent use the exact same parameter names outlined here. For example, if the parameters in the event payload is originally "wt.product_price", it can be sent to Movable Ink with the label "wt.product_price" and does not have to be updated to use the label 'Price'.

Query Templates

Back to top

Note: The below query templates are built assuming you are passing in the parameters exactly as per the Audit Tagging section (for example, Product Viewed). The parameter display names need not match exactly as per the event schema (For example, Timestamp vs time vs time_stamp can be used for time stamp). However, the parameter's original name as per Required Parameters Per Event, should be used to ensure it is capturing the correct information (datetime_utc for Time stamp). If you do not use the parameters as specified, you will need to update your Queries accordingly. If you are uncomfortable with Query Templates, you may be interested in an Oracle Consulting Services engagement to support you (please reach out to your Oracle representative for more details).

This section details the query templates and sample requests for each Movable Ink event:

Product Viewed

Select data.wt.dcsvid AS 'user_id', data.wt.pn_id AS 'product_id', data.wt.product_price AS 'product_price', data.wt.product_name AS 'product_name', data.wt.es AS 'page_url', data.wt.cg_n AS 'product_category', ext.geo.tzname AS 'time_zone', data.wt.a_nm AS 'app_name', data.wt.av AS 'app_version', data.wt.co_f AS 'anonymous_id', datetime_utc AS 'timestamp', LATEST(data.mi_u) AS 'user_id_qsp' WHERE session.closed='false' AND data.wt.tx_e='v' AND (EXISTS(data.wt.pn_id) OR EXISTS(data.wt.pn_sku)) AND EXISTS(data.wt.es)

Sample request (for building query)

This sample request is used for firing sample requests when creating your queries:

https://dc.oracleinfinity.io/{ENTERACCOUNTGUID}/dcs.gif?wt.tx_e=v&wt.pn_id=sample_product_id&wt.es=sample_url&wt.product_price=14.99&wt.dcsvid=sample_customer_id&wt.cg_n=sample_category&wt.product_name=sample_product_name&wt.a_nm=sample_app_name&wt.av=sample_app_version&mi_ecmp=sample_campaign_name&mi_u=sample_mi_id&wt.co_f=sample_anonymous_id

Note: If you're not using the recommended parameters from the query template, then you will need to amend the sample request to use the parameters you are using (see How do I Fire the Correct Sample Request?).

Back to list of query templates and sample requests

Cart Add

Select data.wt.dcsvid AS 'user_id', data.wt.pn_id AS 'product_id', data.wt.product_price AS 'product_price', data.wt.product_name AS 'product_name', data.wt.es AS 'page_url', data.wt.cg_n AS 'product_category', ext.geo.tzname AS 'time_zone', data.wt.a_nm AS 'app_name', data.wt.av AS 'app_version', data.wt.co_f AS 'anonymous_id', datetime_utc AS 'timestamp', LATEST(data.mi_u) AS 'user_id_qsp' WHERE session.closed='false' AND data.wt.tx_e='a' AND (EXISTS(data.wt.pn_id) OR EXISTS(data.wt.pn_sku)) AND EXISTS(data.wt.es) AND data.wt.es LIKE '*{change to URL search term for product pages, for example "product.php"}*'

Important: Product URL is mandatory for Cart Add event. Therefore, by default the Query above only triggers for products added on a product page. This is because the query can simply send the page URL collected by default (wt.es) ) as the Product URL; however, in order to do this, the query must filter to run only on product pages. Therefore, you must update the following code to filter for your product pages only:
data.wt.es LIKE '*{change to URL search term for product pages, for example "product.php"}*'
For example, if your product pages all have a URL format of http://mywebsite.com/product/14234 then you could update the query as follows (see IQL Syntax for syntax support):
data.wt.es LIKE '*/product/*'

If you wish to support add to basket events on pages other than product pages, then please see Passing Product URLs for Cart Add Event.

Sample Request (for building query)

This sample request is used for firing sample requests when creating your queries:

https://dc.oracleinfinity.io/{ENTERACCOUNTGUID}/dcs.gif?wt.tx_e=a&wt.pn_id=sample_product_id&wt.es=sample_url&wt.product_price=14.99&wt.dcsvid=sample_customer_id&wt.cg_n=sample_category&wt.product_name=sample_product_name&wt.a_nm=sample_app_name&wt.av=sample_app_version&mi_ecmp=sample_cam paign_name&mi_u=sample_mi_id&wt.co_f=sample_anonymous_id

Note: If you're not using the recommended parameters from the Queries template, then you will need to amend the sample request to use the parameters you are using (see How do I Fire the Correct Sample Request?).

Back to list of query templates and sample requests

Conversion

Select data.wt.dcsvid AS 'user_id', data.wt.pn_id AS 'product_id', data.wt.product_price AS 'product_price', data.wt.product_name AS 'product_name', data.wt.es AS 'page_url', data.wt.tx_s AS 'plp', data.wt.tx_u AS 'pq', ext.geo.tzname AS 'time_zone', data.wt.cart_subtotal AS 'osubt', data.wt.cart_tax AS 'tax', data.wt.tx_i AS 'oid', data.wt.a_nm AS 'app_name', data.wt.av AS 'app_version', data.wt.co_f AS 'anonymous_id', datetime_utc AS 'timestamp', LATEST(data.mi_u) AS 'user_id_qsp' WHERE session.closed='false' AND data.wt.tx_e='p' AND (EXISTS(data.wt.pn_id) OR EXISTS(data.wt.pn_sku))

Sample Request (for building query)

This sample request is used for firing sample requests when creating your queries:

https://dc.oracleinfinity.io/{ENTERACCOUNTGUID}/dcs.gif?wt.tx_e=p&wt.pn_id=sample_product_id;another_id&wt.es=sample_url&wt.product_price=14.99;99.99&wt.dcsvid=sample_customer_id&wt.cg_n=sample_category;another_category&wt.product_name=sample_product_name;another_product_name&wt.tx_u=1;2&wt.tx_i=sample_order_id&wt.cart_subtotal=999.99&wt.a_nm=sample_app_name&wt.av=sample_app_version&mi_ecmp=sample_campaign_name&mi_u=sample_mi_id&wt.cart_tax=10.00&wt.co_f=sample_anonymous_id

Note: If you're not using the recommended parameters from the query template, then you will need to amend the sample request to use the parameters you are using (see How do I Fire the Correct Sample Request?).

Back to list of query templates and sample requests

Identify

Select data.wt.dcsvid AS 'user_id', ext.geo.tzname AS 'time_zone', data.wt.a_nm AS 'app_name', data.wt.av AS 'app_version', data.wt.co_f AS 'anonymous_id', datetime_utc AS 'timestamp', LATEST(data.mi_u) AS 'user_id_qsp' WHERE session.closed='true' ANY(EXISTS(data.wt.co_f)) AND (ANY(EXISTS(data.wt.dcsvid)) OR ANY(EXISTS(data.mi_u)))

Sample Request (for building query)

This sample request is used for firing sample requests when creating your queries:

https://dc.oracleinfinity.io/{ENTERACCOUNTGUID}/dcs.gif?wt.dcsvid=sample_customer_id&wt.a_nm=sample_app_name&wt.av=sample_app_version&mi_ecmp=sample_campaign_name&mi_u=sample_mi_id&wt.co_f=sample_anonymous_id

Note: If you're not using the recommended parameters from the queries template, then you will need to amend the sample request to use the parameters you are using (see How do I Fire the Correct Sample Request?).

Back to list of query templates and sample requests

Search

Select data.wt.dcsvid AS 'user_id', data.wt.oss AS 'query', data.wt.es AS 'page_url', ext.geo.tzname AS 'time_zone', data.wt.a_nm AS 'app_name', data.wt.av AS 'app_version', data.wt.co_f AS 'anonymous_id', datetime_utc AS 'timestamp', LATEST(data.mi_u) AS 'user_id_qsp' WHERE session.closed='false' AND EXISTS(data.wt.oss) AND EXISTS(data.wt.es)

Sample Request (for building query)

This sample request is used for firing sample requests when creating your queries:

https://dc.oracleinfinity.io/{ENTERACCOUNTGUID}/dcs.gif?wt.dcsvid=sample_customer_id&wt.a_nm=sample_app_name&wt.av=sample_app_version&mi_ecmp=sample_campaign_name&mi_u=sample_mi_id&wt.co_f=sample_anonymous_id&wt.oss=sample_query

Note: If you're not using the recommended parameters from the query template, then you will need to amend the sample request to use the parameters you are using (see How do I Fire the Correct Sample Request?).

Back to list of query templates and sample requests

Category View

Select data.wt.dcsvid AS 'user_id', data.wt.cg_n AS 'product_list_id', data.wt.es AS 'page_url', ext.geo.tzname AS 'time_zone', datetime_utc AS 'timestamp', data.wt.a_nm AS 'app_name', data.wt.av AS 'app_version', data.wt.co_f AS 'anonymous_id', LATEST(data.mi_u) AS 'user_id_qsp' WHERE session.closed='false' data.wt.tx_e='cv' AND EXISTS(data.wt.cg_n) AND EXISTS(data.wt.es)

Sample Request (for building query)

This sample request is used for firing sample requests when creating your queries:

https://dc.oracleinfinity.io/{ENTERACCOUNTGUID}/dcs.gif?wt.tx_e=cv&wt.dcsvid=sample_customer_id&wt.a_nm=sample_app_name&wt.av=sample_app_version&mi_ecmp=sample_campaign_name&mi_u=sample_mi_id&wt.co_f=sample_anonymous_id&wt.cg_n=sample_product_list_id

Note: If you're not using the recommended parameters from the query template, then you will need to amend the sample request to use the parameters you are using (see How do I Fire the Correct Sample Request?).

Back to list of query templates and sample requests

Custom Event

Select data.wt.dcsvid AS 'user_id', data.wt.es AS 'page_url', ext.geo.tzname AS 'time_zone', data.wt.a_nm AS 'app_name', data.wt.av AS 'app_version', datetime_utc AS 'timestamp'

Sample Request (for building query)

This sample request is used for firing sample requests when creating your queries:

https://dc.oracleinfinity.io/{ENTERACCOUNTGUID}/dcs.gif? wt.es=sample_url&wt.dcsvid=sample_customer_id&wt.a_nm=sample_app_name&wt.av=sample_app_version

Back to list of query templates and sample requests

Destination Templates

Back to top

Each of your chosen events will use the Infinity Connection — they will allow your events to be sent to Movable Ink in the correct format. To format the data, you will need to use the following templates per event (see Building your Destinations):

Product Viewed

{ {# Hard-coded Vars#} "event":"Product Viewed", "type":"track" {# Base Vars #} {# User ID Logic#} {% if (events[0]['user_id'] != "") and (events[0]['user_id_qsp'] == "")%} ,"user_id":"{{events[0]['user_id']}}" {% endif %} {% if (events[0]['user_id'] == "") and (events[0]['user_id_qsp'] != "")%} ,"user_id":"{{events[0]['user_id_qsp']}}" {% endif %} {% if (events[0]['user_id'] != "") and (events[0]['user_id_qsp'] != "")%} ,"user_id":"{{events[0]['user_id']}}" {% endif %} {% if events[0]['anonymous_id'] != ""%} ,"anonymous_id":"{{events[0]['anonymous_id']}}" {% endif %} {% if events[0]['timestamp'] != ""%} ,"timestamp":"{{events[0]['timestamp']}}" {% endif %} {# Campaign #} {% if events[0]['campaign_name'] != ""%} ,"campaign": { "name": "{{events[0]['campaign_name']}}" } {% endif %} {# Context #} {% if (events[0]['time_zone'] != "") or (events[0]['app_name'] != "") or (events[0]['app_version'] != "")%} ,"context" : { {# Timezone #} {# {% if (events[0]['time_zone'] != "")%} "timezone":"{{events[0]['time_zone']}}" {% if (events[0]['app_name'] != "") or (events[0]['app_version'] != "")%} , {% endif %} {% endif %} #} {# Apps #} {% if (events[0]['app_name'] != "") or (events[0]['app_version'] != "")%} "app":{ {% if (events[0]['app_name'] != "")%} "name":"{{events[0]['app_name']}}" {% if (events[0]['app_version'] != "")%} , {% endif %} {% endif %} {% if (events[0]['app_version'] != "")%} "version":"{{events[0]['app_version']}}" {% endif %} } {% endif %} } {% endif %} {# Products #} {% if (events[0]['page_url'] != "") and ((events[0]['product_sku']!= "") or (events[0]['product_id']!= ""))%} ,"properties": { "url":"{{events[0]['page_url']}}" {% if events[0]['product_price'] != ""%} ,"price":{{events[0]['product_price']|number_format(2, '.')}} {% endif %} {% if events[0]['product_category'] != ""%} ,"category":"{{events[0]['product_category']}}" {% endif %} {% if events[0]['product_name'] != ""%} ,"name":"{{events[0]['product_name']}}" {% endif %} {% if events[0]['product_id'] != ""%} ,"product_id":"{{events[0]['product_id']}}" {% endif %} {% if events[0]['product_sku'] != ""%} ,"sku":"{{events[0]['product_sku']}}" {% endif %} } {% endif %} }

Note: This code block is not prettified to ensure that it will fit within the character limit in the Twig input within the Infinity user interface.

Cart Add

{ {# Hard-coded Vars#} "event":"Product Added", "type":"track" {# Base Vars #} {# User ID Logic#} {% if (events[0]['user_id'] != "") and (events[0]['user_id_qsp'] == "")%} ,"user_id":"{{events[0]['user_id']}}" {% endif %} {% if (events[0]['user_id'] == "") and (events[0]['user_id_qsp'] != "")%} ,"user_id":"{{events[0]['user_id_qsp']}}" {% endif %} {% if (events[0]['user_id'] != "") and (events[0]['user_id_qsp'] != "")%} ,"user_id":"{{events[0]['user_id']}}" {% endif %} {% if events[0]['anonymous_id'] != ""%} ,"anonymous_id":"{{events[0]['anonymous_id']}}" {% endif %} {% if events[0]['timestamp'] != ""%} ,"timestamp":"{{events[0]['timestamp']}}" {% endif %} {# Campaign #} {% if events[0]['campaign_name'] != ""%} ,"campaign": { "name": "{{events[0]['campaign_name']}}" } {% endif %} {# Context #} {% if (events[0]['time_zone'] != "") or (events[0]['app_name'] != "") or (events[0]['app_version'] != "")%} ,"context" : { {# Timezone #} {# {% if (events[0]['time_zone'] != "")%} "timezone":"{{events[0]['time_zone']}}" {% if (events[0]['app_name'] != "") or (events[0]['app_version'] != "")%} , {% endif %} {% endif %} #} {# Apps #} {% if (events[0]['app_name'] != "") or (events[0]['app_version'] != "")%} "app":{ {% if (events[0]['app_name'] != "")%} "name":"{{events[0]['app_name']}}" {% if (events[0]['app_version'] != "")%} , {% endif %} {% endif %} {% if (events[0]['app_version'] != "")%} "version":"{{events[0]['app_version']}}" {% endif %} } {% endif %} } {% endif %} {# Products #} {% if (events[0]['product_url'] != "") and ((events[0]['product_sku']!= "") or (events[0]['product_id']!= ""))%} ,"properties": { "url":"{{events[0]['product_url']}}" {% if events[0]['product_category'] != ""%} ,"price":{{events[0]['product_price']|number_format(2, '.')}} {% endif %} {% if events[0]['product_category'] != ""%} ,"category":"{{events[0]['product_category']}}" {% endif %} {% if events[0]['product_name'] != ""%} ,"name":"{{events[0]['product_name']}}" {% endif %} {% if events[0]['product_sku'] != ""%} ,"sku":"{{events[0]['product_sku']}}" {% endif %} {% if events[0]['product_id'] != ""%} ,"product_id":"{{events[0]['product_id']}}" {% endif %} } {% endif %} }

Note: This code block is not prettified to ensure that it will fit within the character limit in the Twig input within the Infinity user interface.

Back to Destination templates

Conversion

Note: If your line items per product variable are delimited by anything other than a ';' then please amend the ';' to the correct character in the below template under the line {% set _splitChar=";" %}

{% set _splitChar=";" %} { "event":"Order Completed", "type":"track" {% if (events[0]['uid'] != "") and (events[0]['uid_qsp'] == "")%} ,"user_id":"{{events[0]['uid']}}" {% endif %} {% if (events[0]['uid'] == "") and (events[0]['uid_qsp'] != "")%} ,"user_id":"{{events[0]['uid_qsp']}}" {% endif %} {% if (events[0]['uid'] != "") and (events[0]['uid_qsp'] != "")%} ,"user_id":"{{events[0]['uid']}}" {% endif %} {% if events[0]['aid'] != ""%} ,"anonymous_id":"{{events[0]['aid']}}" {% endif %} {% if events[0]['ts'] != ""%} ,"timestamp":"{{events[0]['ts']}}" {% endif %} {% if events[0]['cn'] != ""%} ,"campaign": { "name": "{{events[0]['cn']}}" } {% endif %} {% if (events[0]['tz'] != "") or (events[0]['an'] != "") or (events[0]['av'] != "")%} ,"context" : { {% if (events[0]['an'] != "") or (events[0]['av'] != "")%} "app":{ {% if events[0]['an'] != ""%} "name":"{{events[0]['an']}}" {% if events[0]['av'] != ""%} , {% endif %} {% endif %} {% if events[0]['av'] != ""%} "version":"{{events[0]['av']}}" {% endif %} } {% endif %} } {% endif %} ,"properties": { {% if events[0]['oid'] != ""%} "checkout_id":"{{events[0]['oid']}}", {% endif %} {% if events[0]['osubt'] is not empty%} {% if events[0]['osubt'] != ""%} "revenue":{{events[0]['osubt']|number_format(2, '.')}}, {% endif %} {% endif %} {% if events[0]['psku'] is not empty %} {% if events[0]['psku'] is not iterable %} {% set pskus_del=events[0]['psku'] %} {% else %} {% set pskus_del=events[0]['psku']|join(_splitChar) %} {% endif %} {% set arr_psku=pskus_del|split(_splitChar) %} {% if events[0]['pp'] is not empty %} {% if events[0]['pp'] is not iterable %} {% set pp_del=events[0]['pp'] %} {% else %} {% set pp_del=events[0]['pp']|join(_splitChar) %} {% endif %} {% set arr_pp=pp_del|split(_splitChar) %} {% endif %} {% if events[0]['plp'] is not empty %} {% if events[0]['plp'] is not iterable %} {% set plp_del=events[0]['plp'] %} {% else %} {% set plp_del=events[0]['plp']|join(_splitChar) %} {% endif %} {% set arr_plp=plp_del|split(_splitChar) %} {% endif %} {% if events[0]['pq'] is not empty %} {% if events[0]['pq'] is not iterable %} {% set pq_del=events[0]['pq'] %} {% else %} {% set pq_del=events[0]['pq']|join(_splitChar) %} {% endif %} {% set arr_pq=pq_del|split(_splitChar) %} {% endif %} {% if events[0]['pid'] is not empty %} {% if events[0]['pid'] is not iterable %} {% set pid_del=events[0]['pid'] %} {% else %} {% set pid_del=events[0]['pid']|join(_splitChar) %} {% endif %} {% set arr_pid=pid_del|split(_splitChar) %} {% endif %} {% if events[0]['pn'] is not empty %} {% if events[0]['pn'] is not iterable %} {% set pname_del=events[0]['pn'] %} {% else %} {% set pname_del=events[0]['pn']|join(_splitChar) %} {% endif %} {% set arr_pname=pname_del|split(_splitChar) %} {% endif %} "products":[ {% for item in arr_psku %} {% set i=loop.index0 %} { "_ora":"start" {% if arr_psku is not empty %} {% if arr_psku[i] != "" %} ,"sku":"{{arr_psku[i]}}" {% endif %} {% endif %} {% if arr_pid is not empty %} {% if arr_pid[i] != "" %} ,"product_id":"{{arr_pid[i]}}" {% endif %} {% endif %} {% if arr_pp is not empty %} {% if arr_pp[i] is not empty %} ,"price":{{arr_pp[i]|number_format(2, '.')}} {% endif %} {% endif %} {% if arr_pq is not empty %} {% if arr_pq[i] != ""%} ,"quantity":{{arr_pq[i]|number_format}} {% endif %} {% endif %} {% if arr_pname is not empty %} {% if arr_pname[i] != ""%} ,"name":"{{arr_pname[i]}}" {% endif %} {% endif %} {% if (arr_plp is not empty) and (arr_pq is not empty) %} {% if (arr_plp[i] != "") and (arr_pq[i] != "") %} {% if arr_pp is empty%} ,"price":{{((arr_plp[i]|number_format) / (arr_pq[i]|number_format))|number_format(2, '.') }} {% endif %} {% endif %} {% endif %} } {% if not (loop.last) %} , {% endif %} {% endfor %} ] {% endif %} } }

Note: This code block is not prettified to ensure that it will fit within the character limit in the Twig input within the Infinity user interface.

Identify

{ {# Hard-coded Vars#} "type":"identify" {# Base Vars #} {# User ID Logic#} {% if (events[0]['user_id'] != "") and (events[0]['user_id_qsp'] == "")%} ,"user_id":"{{events[0]['user_id']}}" {% endif %} {% if (events[0]['user_id'] == "") and (events[0]['user_id_qsp'] != "")%} ,"user_id":"{{events[0]['user_id_qsp']}}" {% endif %} {% if (events[0]['user_id'] != "") and (events[0]['user_id_qsp'] != "")%} ,"user_id":"{{events[0]['user_id']}}" {% endif %} {% if events[0]['anonymous_id'] != ""%} ,"anonymous_id":"{{events[0]['anonymous_id']}}" {% endif %} {% if events[0]['timestamp'] != ""%} ,"timestamp":"{{events[0]['timestamp']}}" {% endif %} {# Context #} {% if (events[0]['time_zone'] != "") or (events[0]['app_name'] != "") or (events[0]['app_version'] != "")%} ,"context" : { {# Timezone #} {# {% if (events[0]['time_zone'] != "")%} "timezone":"{{events[0]['time_zone']}}" {% if (events[0]['app_name'] != "") or (events[0]['app_version'] != "")%} , {% endif %} {% endif %} #} {# Apps #} {% if (events[0]['app_name'] != "") or (events[0]['app_version'] != "")%} "app":{ {% if (events[0]['app_name'] != "")%} "name":"{{events[0]['app_name']}}" {% if (events[0]['app_version'] != "")%} , {% endif %} {% endif %} {% if (events[0]['app_version'] != "")%} "version":"{{events[0]['app_version']}}" {% endif %} } {% endif %} } {% endif %} }

Note: This code block is not prettified to ensure that it will fit within the character limit in the Twig input within the Infinity user interface.

Search

{ {# Hard-coded Vars#} "event":"Products Searched", "type":"track" {# Base Vars #} {# User ID Logic#} {% if (events[0]['user_id'] != "") and (events[0]['user_id_qsp'] == "")%} ,"user_id":"{{events[0]['user_id']}}" {% endif %} {% if (events[0]['user_id'] == "") and (events[0]['user_id_qsp'] != "")%} ,"user_id":"{{events[0]['user_id_qsp']}}" {% endif %} {% if (events[0]['user_id'] != "") and (events[0]['user_id_qsp'] != "")%} ,"user_id":"{{events[0]['user_id']}}" {% endif %} {% if events[0]['anonymous_id'] != ""%} ,"anonymous_id":"{{events[0]['anonymous_id']}}" {% endif %} {% if events[0]['timestamp'] != ""%} ,"timestamp":"{{events[0]['timestamp']}}" {% endif %} {# Campaign #} {% if events[0]['campaign_name'] != ""%} ,"campaign": { "name": "{{events[0]['campaign_name']}}" } {% endif %} {# Context #} {% if (events[0]['time_zone'] != "") or (events[0]['app_name'] != "") or (events[0]['app_version'] != "")%} ,"context" : { {# Timezone #} {# {% if (events[0]['time_zone'] != "")%} "timezone":"{{events[0]['time_zone']}}" {% if (events[0]['app_name'] != "") or (events[0]['app_version'] != "")%} , {% endif %} {% endif %} #} {# Apps #} {% if (events[0]['app_name'] != "") or (events[0]['app_version'] != "")%} "app":{ {% if (events[0]['app_name'] != "")%} "name":"{{events[0]['app_name']}}" {% if (events[0]['app_version'] != "")%} , {% endif %} {% endif %} {% if (events[0]['app_version'] != "")%} "version":"{{events[0]['app_version']}}" {% endif %} } {% endif %} } {% endif %} {# Search Data#} {% if (events[0]['query'] != "") and (events[0]['page_url'] != "")%} ,"properties": { "query":"{{events[0]['query']}}", "url":"{{events[0]['page_url']}}" } {% endif %} }

Note: This code block is not prettified to ensure that it will fit within the character limit in the Twig input within the Infinity user interface.

Category View

{ {# Hard-coded Vars#} "event":"Product List Viewed", "type":"track" {# Base Vars #} {# User ID Logic#} {% if (events[0]['user_id'] != "") and (events[0]['user_id_qsp'] == "")%} ,"user_id":"{{events[0]['user_id']}}" {% endif %} {% if (events[0]['user_id'] == "") and (events[0]['user_id_qsp'] != "")%} ,"user_id":"{{events[0]['user_id_qsp']}}" {% endif %} {% if (events[0]['user_id'] != "") and (events[0]['user_id_qsp'] != "")%} ,"user_id":"{{events[0]['user_id']}}" {% endif %} {% if events[0]['anonymous_id'] != ""%} ,"anonymous_id":"{{events[0]['anonymous_id']}}" {% endif %} {% if events[0]['timestamp'] != ""%} ,"timestamp":"{{events[0]['timestamp']}}" {% endif %} {# Campaign #} {% if events[0]['campaign_name'] != ""%} ,"campaign": { "name": "{{events[0]['campaign_name']}}" } {% endif %} {# Context #} {% if (events[0]['time_zone'] != "") or (events[0]['app_name'] != "") or (events[0]['app_version'] != "")%} ,"context" : { {# Timezone #} {# {% if (events[0]['time_zone'] != "")%} "timezone":"{{events[0]['time_zone']}}" {% if (events[0]['app_name'] != "") or (events[0]['app_version'] != "")%} , {% endif %} {% endif %} #} {# Apps #} {% if (events[0]['app_name'] != "") or (events[0]['app_version'] != "")%} "app":{ {% if (events[0]['app_name'] != "")%} "name":"{{events[0]['app_name']}}" {% if (events[0]['app_version'] != "")%} , {% endif %} {% endif %} {% if (events[0]['app_version'] != "")%} "version":"{{events[0]['app_version']}}" {% endif %} } {% endif %} } {% endif %} {# Product List Data#} {% if (events[0]['page_url'] != "") and (events[0]['product_list_id'] != "")%} ,"properties": { "list_id":"{{events[0]['product_list_id']}}", {% if events[0]['product_category'] != ""%} "category":"{{events[0]['product_category']}}", {% endif %} "url":"{{events[0]['page_url']}}" } {% endif %} }

Note: This code block is not prettified to ensure that it will fit within the character limit in the Twig input within the Infinity user interface.

Learn more

Movable Ink integration overview