Send RFM score to Google Analytics
You can power your Google Analytics data with information collected in Synerise. You can do it by sending an event to Google Analytics with the data extracted from Synerise such as the customer attributes, customer activities, results of analyses, predictions, and so on.
In this particular use case, we use the Automation module to send each visitor’s result of an RFM analysis to Google Analytics. The workflow is triggered every week for visitors from the last 7 days and sends the RFM analysis results of each customer to Google Analytics as an rfm.score
event. The event contains two parameters:
score
contains numeric information about the customer’s score,rfmSegmentName
contains the name of the RFM segment the customer belongs to.
Prerequisites
- Get the measurement ID associated with a stream in your Google Analytics panel. Navigate to Admin > Data Streams > {stream name} > Measurement ID.
- Create an API secret in your Google Analytics panel. To create a new secret, navigate to Admin > Data Streams > {stream name} > Measurement Protocol > Create.
- Implement Synerise JS SDK on your website.
- Implement transaction events using SDK or API.
- Enable saving Google Analytics ID in profiles.
- Create an RFM analysis.
- Establish a connection between Synerise and Google Analytics.
Process
In this use case, you will go through the following steps:
- Create an expression that returns the name of the RFM segment a customer belongs to.
- Create a workflow that sends events to Google Analytics.
Create an expression that returns RFM segment name
In this part of the process, you will create an expression that retrieves a segment name from an RFM segmentation to which a customer belongs.
- Go to Analytics > Expressions > New expression.
- Enter a meaningful name of the expression.
- Leave the Expression for at default (Attribute).
- Click the Select node.
- From the dropdown list, select Profile.
- Click the unnamed node.
- On the bottom of the page, click Choose attribute.
- From the dropdown list, select Segmentations.
- Find the RFM segmentation and select it.
- Save the expression.
Create a workflow
Create a workflow that is triggered for the customers who visited your website during the last 7 days. The system will send an rfm.score
event with the score a customer received in the RFM analysis and with the name of the segment they belong to. The RFM result will be saved in Google Analytics for each customer, using the customer’s Google Analytics ID saved as a profile attribute in Synerise.
This workflow will be triggered once a week, for the group of customers who were active on the website during the last 7 days.
- In Synerise, go to Automation > Workflows > New workflow.
- Enter the name of the workflow.
Define the audience of the workflow
The workflow is triggered for customers who visited a website during the last 7 days. Define the conditions in the following way:
- As the first node, add Audience. In the configuration of the node:
- Set the Run trigger option to repeatable.
- Set the interval to 1 week.
- In the Begin at field, select the first launch of the trigger.
- From the Timezone dropdown list, select the time zone consistent with the time zone selected for your workspace.
- In the Define audience section, click the New audience tab.
- From the Choose filter dropdown list, select page.visit.
- In the right bottom corner, set the date to Last 7 days.
- Confirm by clicking Apply.
Configure the Google Analytics node
In this step, you will configure the settings of the Google Analytics integration in the Send Event node. This includes:
- Selecting the connection (for authorization purposes)
- Defining the customer identifier - you will use an insert that retrieves the value of the
cid
attribute that stores the Google Analytics ID - Defining the event and event parameters to be sent to Google Analytics
You can find the detailed instructions for each action below.
- On the Audience node, click THEN.
- From the node list, select Google Analytics > Send Event.
- In the configuration of the node:
-
Select the connection.
If you havenโt established a connection yet, see Create a connection. -
In the Customer ID field, enter
{{ customer['cid'] }}
This way, you will retrieve the value of thecid
attribute. -
In the Event name field, enter
rfm.score
-
In the Event parameters field, enter the parameters of the event in the form of the JSON object.
The object uses the{% expression %}
insert to refer to the value of the RFM-related expressions.
For example:
{ "score": "{% expression %} rfm-score-expression {% endexpression %}", "rfmSegmentName": "{% expression %} rfm-segment-name-expression {% endexpression %}" }
- Replace
rfm-score-expression
with the ID of the expression that calculates the RFM score. - Replace
rfm-segment-name-expression
with ID of the expression you created in this part of the process.
- Replace
-
- Confirm by clicking Apply.
Add the finishing node
-
On the Send Event, click THEN.
-
Add the End node.
-
Activate the workflow by clicking Save & Run.
Check the use case set up on the Synerise Demo workspace
You can check the configuration of:
- The expression that retrieves the name of the RFM segment
- The expression that calculates RFM
- The workflow that sends events to Google Analytics with RFM results
If you don’t have access to the Synerise Demo workspace, please leave your contact details in this form, and our representative will contact you shortly.