BigQuery + GA4: Page Navigation Report

If you've been working with GA4 for some time, you may have noticed that certain dimensions and metrics that were available in Universal Analytics are not present in GA4. For example, the Navigation report, where we could select a URL from our website and it would show the previous and next page paths in percentages, is no longer available:

 

UA - Exit pages-1

Neither of the two dimensions you see — Previous Page Path and Next Page — exist in GA4. However, the navigation report that existed in Universal Analytics was always very useful when we wanted to understand general behavior during navigation, focusing on specific content. It helps to understand user flow and improve the navigation experience or content strategy for the website.

In this post, we will explain how to generate this report from BigQuery.

Don't be scared! If you haven’t yet ventured into BigQuery, even though you already have the connection between GA4 and BigQuery set up, don’t worry, we will make it easy for you. You’ll only need to copy and paste the query we provide and make a few adjustments.

We’ll explain what each part of the function does, in case you're interested. But if not, just scroll down to the query section and copy it.

This BigQuery query uses data from Google Analytics 4 to analyze user navigation on a website, specifically around a given page URL. It is done in several stages:

"prep" subquery:

  • Selects 'user_pseudo_id' (an anonymous user identifier), 'session_id' (user session identifier), 'page' (URL of the page viewed), and 'event_timestamp' (the timestamp when the page view occurred).
  • Filters to include only page view events (event_name = 'page_view').
  • The data is extracted from the event tables for a specific date range in the Google Analytics 4 dataset (in this case, for the year 2023).

"prep_navigation" subquery:

  • Uses the 'prep' temporary table to retrieve a sequence of pages visited by each user and session.
  • Applies LAG and LEAD window functions to get the previous ('previous_page') and next ('next_page') pages, respectively, for each page view, ordered by 'event_timestamp' in ascending order. This is partitioned by 'user_pseudo_id' and 'session_id', meaning the page sequence is specific to each user's session.

Main query:

  • Replaces null previous and next pages with '(entrance)' and '(exit)' respectively, indicating that if there is no previous page, the page is the entry point, and if there is no next page, it is the exit.
  • Counts the number of unique sessions ('count') where a specific page has been visited, using 'COUNT(DISTINCT ...)' on the concatenation of 'user_pseudo_id' and 'session_id'.
  • Filters to show data only for the specific URL of the page you want to analyze.
  • Groups the results by 'previous_page', 'page', and 'next_page'.
  • Filters to ensure that the page is not the same as the previous or next page to avoid self-references.
  • Orders the results by 'count' in descending order.

Here’s the query you need:

WITH
  prep AS (
  SELECT
    user_pseudo_id,
    (
    SELECT
      value.int_value
    FROM
      UNNEST(event_params)
    WHERE
      event_name = 'page_view'
      AND KEY = 'ga_session_id') AS session_id,
    (
    SELECT
      value.string_value
    FROM
      UNNEST(event_params)
    WHERE
      event_name = 'page_view'
      AND KEY = 'page_location') AS page,
    event_timestamp
  FROM
    -- Aquí pon el nombre de tu conjunto de datos de GA4.En events_2023* puedes poner una fecha concreta: _20231001 (1 de octubre de 2023), _202310* (todo octubre de 2023), _2023* (todo lo que llevamos de 2023)...
    `<project>.<dataset>.events_2023*`
  WHERE
    event_name = 'page_view'
  ),
  prep_navigation AS (
  SELECT
    user_pseudo_id,
    session_id,
    LAG(page,1) OVER (PARTITION BY user_pseudo_id, session_id ORDER BY event_timestamp ASC)AS previous_page,
    page,
    LEAD(page,1) OVER (PARTITION BY user_pseudo_id, session_id ORDER BY event_timestamp ASC)AS next_page,
    event_timestamp
  FROM
    prep
  )
SELECT
  IFNULL(previous_page,'(entrance)') AS previous_page,
  page,
  IFNULL(next_page,'(exit)') AS next_page,
  COUNT(DISTINCT CONCAT(user_pseudo_id,session_id)) AS count
FROM
  prep_navigation
WHERE
  -- Copia y pega abajo la url de la página que quieres consultar.
  page = "https://www.hikeproject.com/como-visualizar-porcentajes-en-un-scorecard-de-data-studio/"
GROUP BY
  previous_page,
  page,
  next_page
HAVING
  page != previous_page
  AND page != next_page
ORDER BY
  count desc

To query for a specific date range, for example, from September 2nd to October 15th, you need to replace the query snippet:

sql
 

FROM
  -- Aquí pon el nombre de tu conjunto de datos de GA4.En events_2023* puedes poner una fecha concreta: _20231001 (1 de octubre de 2023), _202310* (todo octubre de 2023), _2023* (todo lo que llevamos de 2023)...
  `<project>.<dataset>.events_2023*`
WHERE
  event_name = 'page_view'),

Y lo sustituyes por: 


FROM
  `<project>.<dataset>.events_*`
WHERE
  event_name = 'page_view'
  AND _TABLE_SUFFIX BETWEEN '20230902'
  AND '20231015'),

And that’s it!

Once you run the query, you'll get a table like this:

(img: BQ - Query Results)

BQ - Query Results

The central column corresponds to the selected URL for analysis (Page), the left column shows the previous page, and the right column shows the next page.

This way, you can see how the post:

https://www.hikeproject.com/como-visualizar-porcentajes-en-un-scorecard-de-data-studio/

performed between September 2nd and October 15th:

With this type of report, you can not only analyze specific content on your website but also analyze user behavior in a process or task. For example, on a flight booking page, you can analyze what users do after performing a search, what percentage return to the homepage for another search, and what percentage move on to the next screen to choose a fare. It’s also very useful for analyzing the homepage of the website, especially for sites with multiple objectives on their homepage. Returning to the example of a flight booking page: searching for flights, checking in for a flight, finding information about an already purchased flight, or contacting for an issue or question.

Did you use the navigation reports in Universal Analytics? Were you missing them in GA4?

Hope this helps! Thanks for visiting our blog and using it as a source of knowledge for your daily learning.

PREVIOUS
NEXT

EXPERT TIPS

Subscribe to boost your business.

LATESTS ARTICLES

Personalized marketing at scale: what AI on your data really means

Personalization is no longer optional.
Brands that understand this are already integrating AI into their marketing systems. Not to personalize a first name in an email, but to build unique, real-time experiences across channels, based on actual data.

This doesn’t depend on a single tool. It requires a clear strategy. It involves your data, your technical architecture, and your teams. Here’s what you need to make it work at scale.

Synthetic Data: How to Turn Information into Business Value

Artificial intelligence (AI) and machine learning increasingly rely on high-quality data. However, obtaining large volumes of real-world information can be expensive, time-consuming, and, in many sectors, limited by privacy regulations. This is where synthetic data comes into play—a technology that allows the creation of artificial information with properties similar to real data, offering versatile solutions for training models, automating processes, and protecting privacy.

Although the concept may seem futuristic, synthetic data is already transforming sectors such as finance, healthcare, manufacturing, and automotive, enabling small and medium-sized enterprises (SMEs) to compete with resources comparable to those of large corporations.

What is synthetic data?

Synthetic data refers to artificially generated datasets designed to mimic the statistical characteristics and patterns of real data. It is created using statistical techniques, generative neural networks, or advanced AI models such as transformers and variational autoencoders.

Unlike real data, synthetic data can provide a balance between utility and privacy, as it does not contain identifiable information about real individuals. This makes it an ideal tool for training AI algorithms, testing systems, and generating insights without compromising security or individual rights.

Types of synthetic data

Synthetic data can be classified by format and level of synthesis:

Main formats

  • Tabular: Useful for relational databases and statistical analysis.

  • Text: Used in natural language processing (NLP) and automated content generation.

  • Multimedia: Includes images, videos, and unstructured data, essential for computer vision, object recognition, and image classification.

Level of synthesis

  • Fully synthetic: Generates completely new data without using identifiable real-world information. Ideal for training models in scenarios where original data is scarce, such as financial fraud detection.

  • Partially synthetic: Replaces only sensitive information from real data while preserving structure and patterns. Highly useful in clinical and medical research.

  • Hybrid: Combines real and artificial data, offering a balance between realism and anonymization, suitable for customer analysis or system testing.

Techniques for generating synthetic data

Various methodologies exist to create synthetic data, from traditional approaches to advanced AI-based techniques:

  • Statistical methods: Rely on the distribution and correlation of data, generating new samples through random sampling or interpolation/extrapolation, especially for time series or tabular data.

  • Generative Adversarial Networks (GANs): Consist of a generator producing data and a discriminator distinguishing real from artificial data. Iterative training allows the creation of images and datasets almost indistinguishable from real ones.

  • Transformer models: Process sequences of data through encoders and decoders, capturing complex patterns and relationships in text or tabular data, forming the basis of models like GPT.

  • Variational autoencoders (VAE): Compress input data into lower-dimensional representations and then reconstruct artificial variations, useful for images and time series.

  • Agent-based modeling: Simulates complex environments with autonomous entities interacting under defined rules, generating behavioral data applicable to transportation, epidemiology, or financial markets.

Key benefits of synthetic data

  • Customization and control: Enables the creation of datasets tailored to specific needs, improving analysis and data management.

  • Efficiency: Eliminates slow, costly collection of real data, and being pre-labeled, accelerates AI model training and process automation.

  • Data protection: Without containing identifiable information, it helps comply with privacy regulations and avoids intellectual property issues.

  • Richness and diversity: Allows inclusion of extreme cases, outliers, or underrepresented groups, enhancing coverage and model robustness.

Challenges and considerations

While synthetic data offers many advantages, careful implementation is necessary:

  • Bias: It can inherit biases from the original data. Integrating multiple sources and diversifying training sets can mitigate this.

  • Model collapse: Training a model repeatedly on only artificial data can degrade performance. Combining real and synthetic data prevents this issue.

  • Balance between accuracy and privacy: Adjusting the amount of personal data retained versus statistical fidelity is critical depending on the use case.

  • Verification: Testing and validation are required to ensure the quality and consistency of generated data.

Use cases by sector

  • Automotive: Enables training of autonomous driving systems, improved traffic simulations, and transportation optimization without relying on real incidents.

  • Finance: Used for fraud detection, risk assessment, and simulation of complex financial scenarios while protecting sensitive customer information.

  • Healthcare: In clinical trials and pharmaceutical development, synthetic data enables creation of artificial medical records, anonymized clinical datasets, or medical images for research without compromising privacy.

  • Manufacturing: Supports training of computer vision models for quality inspection and predictive maintenance using synthetic sensor data, anticipating failures and optimizing industrial processes.

How to start with synthetic data in your company

  1. Identify data needs: Determine what information is missing or hard to obtain due to legal or logistical constraints.

  2. Choose appropriate tools: Libraries and solutions such as Synthetic Data Vault or predefined IBM datasets simplify data generation.

  3. Pilot small projects: Start with a limited dataset to validate quality, usefulness, and reliability.

  4. Integrate and train models: Use synthetic data alongside real data to train AI systems and improve predictions or automations.

  5. Monitor results: Evaluate effectiveness, adjusting parameters and techniques as needed.

Conclusion

Synthetic data is a strategic tool that combines security, efficiency, and scalability. It allows companies to train AI models faster and more accurately, explore new scenarios without risk, and protect sensitive information.

For small and medium-sized enterprises, it represents a unique opportunity to compete in innovation and automation without relying solely on costly or limited real data. Adopting this technology can enhance efficiency, data protection, and AI quality, making it a fundamental ally in digital transformation.

 
 

Agentic AI: How Intelligent Automation Empowers SMEs

Artificial intelligence is no longer an exclusive resource for large corporations—it has become a key enabler of growth at any business scale. What once sounded futuristic is now within reach for startups and SMEs seeking to compete in increasingly dynamic markets. Within this landscape, one of the most promising innovations is agentic AI, a technology that doesn’t just execute commands but reasons, decides, and acts autonomously.

The term might sound technical, but the idea is simple: while traditional AI solutions work like assistants that wait for instructions, agentic AI becomes an independent collaborator that understands context, learns from experience, and makes decisions aligned with your business objectives. For a small company, this means saving time on repetitive tasks, responding better to customers, and making faster, data-driven decisions.

What agentic AI means for an SME

Automation has always been seen as a path to boosting workplace efficiency. However, it has often been limited to rigid workflow programming, chatbots with predetermined responses, or management systems that only work within fixed parameters. Agentic AI breaks that barrier: it doesn’t just obey—it interprets and adapts.

Take a simple example. A traditional chatbot answers FAQs but fails when faced with off-script requests. An AI agent, on the other hand, remembers past interactions, understands the customer’s history, and can even anticipate what that person might need. If someone repeatedly checks the price of a service, the AI doesn’t just reply—it can suggest scheduling a sales call or automatically send a personalized proposal.

The impact goes far beyond sales. Agentic AI can organize invoices, filter emails, identify inventory trends, or prioritize business opportunities. For small businesses, often operating with limited resources and lean teams, having this type of support can mean the difference between stagnation and growth.

How intelligent automation transforms operations

One of the most appealing aspects of agentic AI is its ability to operate independently, without constant human supervision. This frees teams from routine tasks and allows them to focus on higher-value, strategic activities.

Some of the most relevant benefits for SMEs include:

  • Always-on customer service: digital agents available 24/7 that not only respond but learn from customer tone and questions to deliver personalized solutions.

  • Faster commercial processes: identification of potential customers based on behavior, lead prioritization, and automated follow-ups.

  • Real-time data analysis: instead of waiting for weekly or monthly reports, AI agents can instantly detect consumption patterns or stock issues.

  • Frictionless scalability: the technology grows with the business, adapting to demand peaks or an expanding client base without immediately hiring extra staff.

In other words, agentic AI doesn’t replace teams—it becomes a strategic partner that multiplies their capabilities.

La Inteligencia Artificial en atención al cliente: 10 maneras de usarla -  Cepymenews

Real applications in small businesses

To better understand the value of agentic AI, let’s ground it in concrete scenarios:

  • Automated marketing: AI agents monitor campaigns, adjust budgets, and predict the best times to publish on social media—making every marketing dollar work harder.

  • Smart sales: if a client visits the pricing page multiple times, AI flags them as a hot lead and automatically books a meeting with a sales rep.

  • Customer support: a digital agent can handle basic questions about hours, policies, or products and escalate sensitive cases to a human team.

  • E-commerce shopping assistants: they remember customer preferences and suggest relevant products, improving the shopping experience and boosting average order value.

These applications aren’t futuristic—they already exist in accessible tools that let SMEs start small and scale gradually.

How to get started

The process of adopting agentic AI can be broken into simple phases:

  1. Identify pain points: start with time-consuming, low-value tasks like repetitive inquiries or database updates.

  2. Choose the right tools: you don’t need a massive investment. There are AI solutions designed for SMEs that integrate with existing CRMs or POS systems.

  3. Run a pilot project: begin with something manageable, such as a chatbot for FAQs. This validates results without major risks.

  4. Train the agent: outcomes depend on the quality of input data. Feed the system customer info, product details, and past interactions.

  5. Measure and improve continuously: track performance and adjust responses or workflows as the AI learns about your business.

The key is to start small, validate results, and expand functions strategically.

Common challenges and how to overcome them

Of course, every innovation comes with obstacles. The most common when implementing agentic AI in small businesses are:

  • Learning curve: it may feel complex at first. Rely on tutorials, vendor support, and gradual training.

  • Data security: a valid concern. The solution is choosing platforms that guarantee encryption, transparency, and regulatory compliance.

  • Fear of losing the human touch: automation doesn’t mean dehumanization. Use AI for repetitive tasks, reserving humans for emotional and strategic interactions.

  • Tight budgets: many SMEs worry about costs, but today there are affordable options built into CRM systems with no hidden fees or heavy upfront investments.

Each challenge has a solution, and the balance of effort versus benefit clearly favors adoption.

Chatbots vs Conversational AI: Is There Any Difference?

A long-term growth tool

More than a trend, agentic AI represents a new paradigm in business management. For small companies, it can become a true growth driver, freeing time, reducing costs, and improving customer experience.

Its most compelling aspect is continuous learning: the more it interacts, the more precise it becomes. This means your automation investment doesn’t stagnate—it improves over time, something traditional processes rarely achieve.

The real question is no longer whether small businesses can afford to implement agentic AI, but whether they can afford not to—when automation and AI are setting the pace of the market.

Conclusion

Agentic AI is here to stay. Its ability to act independently, learn from every interaction, and adapt to market changes makes it one of the most powerful tools SMEs can adopt today.

Implementing it doesn’t require tech expertise or big budgets. All it takes is identifying repetitive tasks, launching a pilot, and letting automation do the rest.

If your goal is to enhance workplace efficiency, increase sales, and secure long-term business growth, agentic AI is the partner you’ve been waiting for. The next strategic decision for your company won’t be taken alone—you’ll take it with the help of artificial intelligence.

 

5 common customer data mistakes to avoid

Introduction

In 2025, customer data has become one of the most valuable assets for businesses. However, as its importance grows, so do the risks associated with managing it. From data quality to the implementation of artificial intelligence, organizations must be aware of common mistakes that can compromise their digital strategy. Below are five critical errors companies should avoid to ensure success and maintain customer trust.

data
Mallorca 184, 08036
Barcelona, Spain