Home » Practical Applications of K-Means in Digital Marketing and Analytics

Practical Applications of K-Means in Digital Marketing and Analytics

Now that we know how it works, let’s see how to apply K-Means to the data we regularly handle at IKAUE, such as Google Analytics 4, Google Search Console, or product data.

Autoclustering to Create Macro Dimensions:
Segmenting Landing Pages (SEO/GA4)

The challenge : You have hundreds or thousands of pakistan phone number data landing pages. How do you group them by performance to know where to focus your optimization efforts (SEO, CRO)?

Data to use : Combined metrics from GSC (clicks, impressions, CTR, average position) and GA4 (sessions, conversion rate per session, revenue per session, average session duration) at the landing page level. Make sure they’re all numeric!

Example usage : Create clusters like “High traffic, low conversion”, “Hidden Gems (low visibility, high conversion)”, “Stars (high traffic, high conversion)”, “Problem pages”, etc.

Model creation query (fictitious example, K=5) :

Prediction and assignment query (fictional example):

Result (dummy table `landings_con_cluster_k5`):

Benefit:  Now you can analyze each cluster! Cluster 3 is your star, Cluster 1 needs more SEO visibility, Cluster 5 has a lot of traffic but low conversions (CRO issues or informative content?), Cluster 2 needs a thorough review… You can focus your resources where they’ll have the greatest impact.

Outlier Detection: Anomalous Keywords (GSC)

The challenge:  Identify Google Search Console keywords outbound strategies for authentic with strange behavior (many impressions and almost zero CTR, very high average position but no clicks…).

Data to use:  Clicks, impressions, CTR, average position per GSC query.

Example usage:  Use K-Means to find “normal” clusters and then search for keywords that are very far from any centroid.

Prediction query using distances (fictitious example on an already created `kmeans_keywords_gsc_

 

Benefit:  Investigate those keywords marked as outliers. Are they irrelevant? Is there a technical issue in the SERP? Is it cannibalization? It allows you to identify problems or opportunities that would otherwise go unnoticed.

Data Understanding: Grouping User Behaviors (GA4)

The challenge:  Can we identify groups of users with similar interaction gambler data patterns on our website or app using GA4 data exported to BigQuery?

Data to use:  Metrics aggregated by `user_pseudo_id` (or `user_id` if you have it set): total number of sessions, average session duration, total pageviews, number of key events (e.g. `purchase`, `add_to_cart`, `form_submit`), total revenue generated, days since last visit, etc.

Example usage: Create segments such as “Loyal Buyers,” “Occasional Blog Visitors,” “Lost Users,” “Newly Interested,” etc.

Query:  The structure would be very similar to the Landing Pages example, but selecting user-level metrics from the GA4 export table (grouping by `user_pseudo_id`). We won’t repeat it here for brevity.

Benefit: Being able to personalize the web experience for each cluster, target more targeted remarketing or email campaigns, understand which types of users convert best, etc.

 

Scroll to Top