E-commerce

How to create custom segments in Google Analytics to refine your e‑commerce analysis?

How to create custom segments in Google Analytics to refine your e‑commerce analysis?

October 29, 2026

Wondering how to segment your traffic in Google Analytics to gain ultra‑precise insights?

In just a few minutes, you will learn to create custom segments like 'Registered Visitors' or 'Repeat Customers' and leverage them to boost your sales.

These segments allow you to isolate key behaviors, avoid overly broad analyses, and drive targeted actions, while remaining compatible with GA's technical limits.

So, how do you create custom segments in Google Analytics? Here is the agenda:

  • What is the principle of segmentation and why are default segments not enough?

  • How to set up a 'Registered Visitor' segment using a custom variable or an event?

  • What steps to follow to define a 'Repeat Customer' segment and avoid false positives?

  • How to integrate these segments into your GA reports and Qstomy dashboards?

  • What concrete benefits to expect in terms of conversion and loyalty?

Let's go.

By the end of this article, you will have a ready‑to‑deploy toolkit, complete with code examples, screenshots, and best practices to avoid common pitfalls.

Summary

What is the principle of segmentation and why are default segments not enough?

Segmentation involves splitting your store's traffic into homogeneous groups to analyze their behaviors separately. Google Analytics offers automatic segments: New Visitors, Returning Visitors, Organic Non‑Paid Traffic, Paid Traffic, which cover most classic cases. However, your e‑commerce often has specific categories that do not fit these criteria, such as registered users or repeat buyers. Ignoring these nuances means hiding conversion and loyalty opportunities. By creating custom segments, you gain a granular vision that aligns your marketing actions with the reality of your customer base.

For example, if you notice that 30% of your sales come from a small group of loyal customers, isolating this group allows you to test specific retention campaigns and directly measure the impact on recurring revenue. Additionally, segmentation facilitates the detection of abnormal behaviors (fraud, bots) by separating them from the normal flow.

Convert over 2,000 customers on average per month with Qstomy.

The world’s 1st Shopify AI dedicated to customer conversion

Empowering 200+ e-commerce merchants

How to set up a 'Registered Visitor' segment using a custom variable or an event?

Start by identifying how your site marks a registered visitor: generally via a cookie containing an ID or a 'registered' field in your database. Then, choose the technique best suited to your configuration.

Via a custom variable

Insert this script on the registration confirmation page:

ga('set', 'dimension1', 'Registered');

In GA, create an advanced segment, select the custom dimension 'Registered', condition 'equals' 'Registered'. All visits where the variable was set will then be grouped.

Via a non‑interaction event

If you prefer events, trigger them during registration:

ga(’send’, ’event’, ’Inscription’, ’Enregistrement’, {nonInteraction: true});

Then create a segment based on the 'Registration / Sign‑up' event. The visitor will be included even if the event occurs mid‑session.

To ensure robustness, remember to synchronize the tagging with your CRM: a unique customer ID stored server‑side can be sent via the function gtag(’set’, {’user_id’: USER_ID});, ensuring that every registered visitor is correctly recognized even if they change devices.

What steps to follow to define a 'Repeat Customer' segment and avoid false positives?

A repeat customer has already made at least one previous purchase. To identify them, first create a cookie named firstPurchase upon the first conversion; for example:

document.cookie = ’firstPurchase=1; path=/; expires=Thu, 31 Dec 2030 23:59:59 GMT’;

On subsequent visits, test for the presence of this cookie. If the cookie exists, trigger a custom variable or an event:

ga('set', 'dimension2', 'Repeat Customer');

Then, create a segment that filters sessions where dimension2 equals 'Repeat Customer'. This approach excludes the first purchase visit from the segment, thus avoiding false positives.

A variant involves counting the number of purchases via an incremental counter stored in the cookie (e.g. purchaseCount=2then trigger the segment only from the second transaction, which provides additional granularity to differentiate frequent buyers from occasional ones.

How to create a segment via the Advanced Segments interface in Google Analytics?

In any GA report, click the button Advanced segments en haut, puis choisissez Create a segment. Select Conditions, choose the dimension or event you configured (e.g., Custom Dimension 1 = Registered). You can add multiple filters and define whether they are cumulative (AND) or alternative (OR). Once satisfied, name the segment, e.g., 'Registered Visitors', and save. You then have the option to share the segment with other profiles by clicking More options and by selecting the relevant accounts.

It is recommended to preview the segment in 'Preview' mode before saving it, to verify the volume of selected users and ensure it does not include unwanted traffic. You can also apply a date filter to test the segment over a recent period and validate data stability.

How to apply a segment to a Qstomy dashboard to track key metrics?

Qstomy natively integrates GA segments via its reporting engine. In your Qstomy dashboard, choose the module you want to analyze (e.g., conversion rate, average order value). In the module settings, select Filter by segment and choose the segment you created, 'Registered Visitors' or 'Returning Customers'. The displayed metrics will then reflect only these groups, allowing you to quickly compare their performance.

For more ideas on traffic optimization, consult our article How to drive traffic to an online store (SEO, ads, social media)?

In practice, you can create Qstomy alerts that notify you as soon as a segment's abandonment rate exceeds a critical threshold, giving you the opportunity to intervene immediately with a targeted campaign or promotional offer.

How to combine multiple conditions (e.g., registered visitor + organic source) within a single segment?

GA allows you to create complex rules by adding multiple condition lines. For example, first select the custom dimension 'Registered', then add a second condition: Source / support must be 'organic'. Choose the operator AND so that both criteria are met simultaneously. You can also create 'OR' groups to capture variants (e.g., source = organic ou direct). This granularity helps you isolate the best acquisition channels for your most engaged users.

An advanced tip is to nest time-based conditions, such as 'Session duration > 3 minutes', to retain only registered visitors who show real interest, thereby increasing the relevance of your analysis and the quality of insights gained.

What limits on variables and events should you keep in mind with GA Universal?

GA Universal offers only five custom dimensions (slots 1 to 5) and a limited number of non-interaction events per session. It is therefore crucial to prioritize the most strategic variables, for example, reserving slots 1 and 2 for 'Registered' and 'Returning Customer' statuses. If you exceed the limits, new variables will simply be ignored, which can lead to gaps in your segments. Remember to regularly clean obsolete variables or migrate to GA4, which offers more flexible audiences.

To anticipate these limits, it is recommended to group related information into a single dimension using pipe-separated formats (e.g. Registered|VIP|Newsletter), and then use regular expressions in segments to filter each value individually.

How to migrate these segments to Google Analytics 4?

GA4 uses audiences instead of classic segments. Reproduce your logic by creating a 'Registered Visitor' audience that triggers when a custom dimension (e.g., user_property_registered = true) is met. Similarly, define a 'Returning Customer' audience based on a repeated purchase event. Once created, these audiences are available in all reports and can be imported into Google Ads. To deepen your configuration, read our guide Google Analytics for Marketing: Ads, Traffic, and Performance (GA4).

Note that GA4 allows up to 500 active audiences, providing considerable flexibility for hyper-specific targeting strategies. Remember to test each audience with a small advertising budget before fully integrating it into your campaigns.

How to measure the impact of segments on conversion rate?

Once your segments are active, compare the conversion rate (CR) of each group with the overall CR. In GA, create a cross-tabulation: Dimensions → Segment, Metrics → Transactions / Sessions. You will immediately see if registered visitors or repeat customers show a higher CR. You can then adjust your campaigns or messages based on the best-performing groups. For additional advice on optimizing CR, consult How to improve e-commerce conversion rates and sales?

In addition to CR, monitor the average revenue per user (ARPU) by segment. A significant difference indicates where to focus upselling efforts or loyalty programs.

How to leverage segments to personalize the shopping experience on Shopify?

Thanks to the native integration of Qstomy with Shopify, you can trigger different product recommendations based on the segment. For example, a registered visitor will see upsells based on their history, while a repeat customer will be offered loyalty deals. Use the module Chatbot IA to display relevant product comparisons in real-time, based on the current segment. This personalization increases conversion chances and enhances customer satisfaction.

It is also possible to adapt abandoned cart messages: registered visitors can receive a gentle reminder, while repeat customers receive a special offer ("10% additional discount") to encourage them to complete the purchase.

How does Qstomy help create and leverage custom segments?

Qstomy automates the collection of essential signals for segmentation: it detects registrations, first orders, and customer returns via lightweight scripts injected into your Shopify store. These data points are immediately transformed into custom dimensions or GA events, without you having to touch the code. Then, Qstomy exposes ready-to-use reports where each segment appears as a distinct view, with key KPIs (revenue, average order value, abandonment rate). You can also activate alerts when a segment shows a performance drop, allowing you to intervene quickly.

To go further, Qstomy offers automations based on segments: for example, automatically triggering a product recommendation email as soon as a visitor becomes a 'Repeat Customer', or launching a dedicated retargeting campaign via Google Ads.

What checklist before launching your custom segments?

Checklist rapide

  • Define criteria : registration, first order, source, etc.

  • Implement tracking : custom variable or non-interaction event.

  • Verify persistence : cookies ou user‑ID durables.

  • Create the segment in GA and test it on a small sample.

  • Integrate into Qstomy dashboards to track KPIs.

FAQ

  • Do segments slow down site loading? No, they are calculated server-side in GA.

  • Can I modify an existing segment? Yes, via the menu Advanced Segments at any time.

  • How many segments can I create? GA allows up to 200 active segments simultaneously.

By following this checklist, you will be ready to leverage the power of granular targeting and grow your store.

To go further: How to create a payment gateway for an e-commerce site? - Qstomy, How does SEO work for e-commerce sites? - Qstomy, How to optimize an e-commerce site for Google (step-by-step guide) - Qstomy.

Additionally, remember to document each segment in your internal Wiki so that the entire marketing team can reuse the same criteria and avoid creating redundant segments.

Enzo

October 29, 2026

Convert over 2,000 customers on average per month with Qstomy.

The world’s 1st Shopify AI dedicated to customer conversion

Empowering 200+ e-commerce merchants

Subscribe to the newsletter and get a personalized e-book!

No-code solution, no technical knowledge required. AI trained on your e-shop and non-intrusive.

*Unsubscribe at any time. We do not send spam.

Subscribe to the newsletter and get a personalized e-book!

No-code solution, no technical knowledge required. AI trained on your e-shop and non-intrusive.

*Unsubscribe at any time. We do not send spam.