If you want to avoid coding, SankeyJourney is the best solution for visualizing customer journeys with Sankey diagrams. It offers many features that allow you to customize your diagrams and explore your data in an interactive and intuitive way. Some of the main features of Sankey Journey include:
- Uploading a CSV file containing your event data
- Mapping columns to user_id, event_name, and event_timestamp
- Generating a Sankey diagram in a few seconds
- Editing the Sankey diagram using various settings such as the number of steps, event filtering, color palette, label size, event grouping, and event looping
- Interacting with the graph by clicking on nodes and segments to filter the diagram
If you prefer to code your Sankey diagrams, Python offers many libraries that can help you visualize customer journeys. Here is a step-by-step tutorial on how to create a Sankey diagram using the Plotly library in Python:
!pip install plotly
import plotly.graph_objects as go
import pandas as pd
df = pd.read_csv('your_data.csv')
fig = go.Figure(data=[go.Sankey(
node = dict(
pad = 15,
thickness = 20,
line = dict(color = "black", width = 0.5),
label = df['event_name'].unique(),
color = "blue"
),
link = dict(
source = df['event_name'],
target = df['event_name'].shift(-1),
value = df['user_id']
))])
In this example, we are creating a Sankey diagram using the event_name column as both the source and target nodes and the user_id column as the value to represent the flow between the nodes.
fig.update_layout(title_text="Customer Journey Sankey Diagram",
font=dict(size=12, color='black'),
plot_bgcolor='white',
paper_bgcolor='white',
sankey={
"link": {
"color": 'lightblue',
"thickness": 0.5,
"valueformat": ".0f",
"label": "User ID"
},
"node": {
"label": df['event_name'].unique(),
"color": 'blue'
}
})
fig.show()
SankeyJourney is the best tool for visualizing customer journeys with Sankey diagrams if you prefer an easy-to-use web-based interface. However, if you prefer to code your Sankey diagrams, Python offers many libraries such as Plotly that can help you create customized and interactive Sankey diagrams.
If you want to know more generating Snakey diagram with or without code, check this article about the advantages of using SankeyJourney instead of Python.