Segmented Push with GA4

2024-01-30 14:17:18 UTC

After the change from Universal Analytics (UA) to GA4 it is no longer possible to share your build segments with others and therefore we have had to remove the old integration with our hub. Nevertheless, the capability to send push messages to specific user groups through the Visiolink hub still exists; the only difference is that you need to construct your segments outside of GA4.

This guide will walk you through the process of building segments outside GA4 and integrating them into Visiolink’s Hub. We recommend using Google Sheets for this purpose due to its seamless integration with GA4.

  1. Begin by creating a new sheet in Google Sheets.
  2. In the new sheet go to ‘Extensions’ hover over ‘Add-ons’ and select ‘Get add-ons’. 
  3. Search for ‘GA4 Magic reports’ and install the solution. While there are various alternatives available, we specifically recommend this one.
  4. Once the add-on is installed you can find it under ‘Extensions’.
  5. Click on ‘Extensions’ and go to GA4 magic reports and click ‘Create new reports’.
  6. You can now create a report or a segment as you would do in GA4.

Important: Use the same login on Google sheet as you have on your GA4 property.  
You need to be in incognito browser to run and schedule reports!!

Example of building a segment: 

After the installation you are now ready to build segments in Google sheet with GA4.

Here is an example of building a segment and integrating it with Visiolink's hub for sending push messages. The segment we are building is users that have been active within the last 7 days:

A screenshot of a computer

Description automatically generated

  1. Choose your start and end date. In this case we are using the last 7 days.
  2. Choose the metrics of interest. In this example, we are interested in users, using active7daysUsers (alternative activeUsers).
  3. Define Dimensions: In the Dimension column add vl_value_user_id and vl_value_push_token1-8. The user_id can be used to identify the user where the push token is needed to send push message to a user’s device. 
  4. Save and Run: Save and run the report. A new sheet with the report's name will be created. 
  5. Integrate with Visiolink Hub: To integrate this segment with Visiolink's hub for sending push messages, create a new sheet (e.g., 'push messages').
  6. Gather Push Columns: Use a formula to gather the current 8 push columns into one:
    ='Active users last 7 days'!A22&'Active users last 7 days'!B22&'Active users last 7 days'!C22&'Active users last 7 days'!D22&'Active users last 7 days'!E22&'Active users last 7 days'!F22&'Active users last 7 days'!G22&'Active users last 7 days'!H22
  7. Share the Sheet: Once you have a sheet with only one column containing users' push tokens, share it with Visiolink's hub. Go to 'File,' click on 'Share,' and then 'Publish to web.'
  8. Publish CSV Link: Select the sheet with push tokens, share it as a comma-separated values (.csv), and click 'Publish.' A screenshot of a computer

Description automatically generated
  9. Save & copy the generated link.  
  10. Go to and create a new push messages 
  11. Add CSV link: In the 'token Segments csv link' box, add the CSV link containing the push tokens. 
  12. Add any additional information and schedule the push messages. Your push messages will only be sent to the tokens within your csv link. 

Automatic update of you segments in Google sheet:

To ensure the automatic update of your segments in Google Sheets, you can schedule the report to run automatically. For instance, in the case of the example where you want to track the last 7 days of active users, follow these steps:

  1. Firstly, it is important to update the date period, so it is dynamic instead of containing specific dates. Therefore, set the start date to be ‘8daysAgo’ and the end date to be ‘1daysAgo’. 
  2. Go to ‘Extension’ click on ‘Ga4 Magic reports’ and select ‘Schedule reports’. 
  3. Select when the report should run and click ‘Save’ (see picture below).

If you need help with a segment you can contact Visiolink BI team they can help you set up the analysis and generate the needed csv file you will need to send segmented push messages. 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request