The “Share Data” node, an action-type node, is used to send data from a previous "Get Products" node. Its use allows receiving product data to be used for different purposes by the client. For example, it is possible to integrate it with native eCommerce components to display recommended products without requiring the use of a Web Content.
How to access it?
In your workflows, drag the "Share Data" node from the right menu to the design area. You can access its configuration by clicking (Edit node configuration).
Interface
The main interface of the "Share Data" node is composed of three blocks:
1. Identifier: to enter a term that identifies the node and, later, to retrieve the data in the eCommerce using that identifier.
2. Source node: to indicate to Connectif from which node to get the data. It can only be a source node of the “Get Products” type.
3. Source node fields: to select which fields we want to receive. Fields shown in grey are
mandatory and cannot be deselected.
Functionality
Action-type nodes are those that execute specific operations within flows. The “Share Data” node is used to send data to the eCommerce from a previous "Get Products" node. Its use allows receiving product data to later be used on the client side as desired.
One of its most common uses is to customize native components to display personalized products to the contact from a workflow without needing to use Web Content. Especially useful in VTEX integrations.
It works similarly to the Connectif "Show Web Content" node, with the difference that the data is not shown on the website, but retrieved through the assigned identifier and sent in the scrippet's response.
1. Using the node in a workflow to share data
The "Share Data" node can be used within a workflow exactly like a "Show Web Content" node, with the difference that, in this case, no content is displayed on the page but the eCommerce receives the data to later use it as desired.
In the following example, it is used along with the "On Page Visit" trigger to extract visited products and send them to the eCommerce.
2. Configuration of the "Share Data" node
In the node interface, assign an Identifier (1) to later retrieve the node’s data (section 3).
Select the Source Node (2), which must always be a "Get Products" node, from which the product information shared in this "Share Data" node will be extracted.
Choose the Fields from the source node (3), to select which product information will be shared with the eCommerce.
3. Retrieving node data for use in the eCommerce
Once the node is configured and the workflow activated, to retrieve this data in the eCommerce and later use it in native components, the following function must be used:
const identifier = "academy-example";
const sharedData = window.connectif.managed.getSharedDataById(identifier);
In this function, the "identifier" must always match the one set in the "Share Data" node. Following our example with identifier "academy-example", once retrieved, the code might look like this:
const identifier = "academy-example"; const getAndProcessSharedData = (identifier) => { const sharedData = window.connectif.managed.getSharedDataById(identifier); if (sharedData && sharedData.products.length > 0) { // process the data found according to need } }; const handleSharedDataReceivedEvent = (event) => { if (event?.detail?.id === identifier) { getAndProcessSharedData(identifier); } }; document.addEventListener( "connectif.managed.shared_data_received", handleSharedDataReceivedEvent ); if ( window.connectif && window.connectif.managed ) { getAndProcessSharedData(identifier); }
Keep learning!
To make the most of your Connectif account, we recommend continuing with the following articles:
- Action-type nodes, to learn about other nodes that execute specific actions in Connectif.
- Types of A/B/X tests and configuration, to try different content variations and discover which performs best.
- Types of workflows and their characteristics, to understand how each of them behaves and optimize performance.
- Copy and paste nodes, to speed up your workflow design process and avoid possible errors.