Action Container: Technical Note
Each time the contact does something (action), orders, abandons his basket, a record is created in the action list. The action list contains one record per action. Multiple actions can be created per contact (it is a 1:n relation). Each action record has a field or multiple fields that stores the content for the action email. These articles can be stored in 2 formats in that field: XML and JSON.
Example; an action list called 'Abandon Basket' with a field ORDERLINES_CONTENT that stores a JSON format
The following format must be respected:
JSON:
[{
"ID"
: 1,
"PARAM"
: "ACTIONCONTAINERNAME",
"CONTENT"
: {
"FIELD1"
: "Field 1 data",
"FIELD2"
: "Field 2 data"
}
},
{
"ID"
: 2,
"PARAM"
: "ACTIONCONTAINERNAME",
"CONTENT"
: {
"FIELD1"
: "Field 1 data",
"FIELD2"
: "Field 2 data"
}
}]
XML:
<PARAMETERS>
<PARAMETERNAME="ACTIONCONTAINERNAME">
<ARTICLES>
<ARTICLEID="1">
<FIELD1><![CDATA[Field
1 data]]></FIELD1>
<FIELD2><![CDATA[Field
2 data]]></FIELD2>
</ARTICLE>
<ARTICLEID="2">
<FIELD1><![CDATA[Field
1 data]]></FIELD1>
<FIELD2><![CDATA[Field
2 data]]></FIELD2>
</ARTICLE>
</ARTICLES>
</PARAMETER>
</PARAMETERS>
Where 'Param' (JSON) / 'Parameter Name' (XML) must correspond to the
name of the action container (used when creating the action container).
The reason for this is that it is possible to call multiple article containers
through the PARAMETER tag for one single email and one contact. The advantage
is that data can be delivered combined and stored in one single field
in the database. By using the exact name of the action container, the
system knows where to retrieve the articles.
The Article IDs must be unique. If the ID is not set, the article is not
loaded. If there are duplicate IDs, only the first one is loaded.
The 'Field' names are also used in the definition of the action container.
So if the JSON/XML is created before the action container, write these
down or else take the fields used in the action container.
The 'CDATA' tags in XML are recommended and used to avoid bad parsing of
the XML due to invalid characters.
As action articles can only be used for one particular contact, limit the number of articles that is stored in an action record to those required for the contact.
Example of record in an action list; the ORDERLINES_CONTENT contains the JSON with the articles to use in the action container
Before the action list can be used in a journey we need to add the action codes to this list. These action codes represent the possible values for the ACTIONCODE field in the action list and allow filtering records with a certain action code in the journey. For more information on this check out the topic on action lists.
Action journey
In a journey an audience component can be configured to use an action list. This also requires the selection of 1 or more action codes that are defined on the action list. Whenever the journey 'sees' new records in the action list with one of the selected action codes it processes them as defined in the journey. The journey will only process records with a certain value, e.g. "Basket_abandon". Multiple journeys can use the same action list, each processing records with a specific value. For instance, a second "order confirmation" journey could process records with ACTIONCODE value "order_confirm"
Below is an example of a journey using the action list 'Abandoned basket'. An email will be send whenever an action record is added with that action code.
Only records in the action list that have an ACTIONCODE that matches one of the selected codes are used in the journey.