Library / Monitoring, Ops & Incidents
Monitoring, Ops & Incidents
Track Keyword Rankings in Postgres with BigQuery Data
When you run it, it pulls ranking keywords by URL from BigQuery, finds new keyword opportunities and stores the ranking history in Postgres.
What it does
### Automation Description This automation serves two main purposes: 1. It monitors keyword rankings for all keywords in your rank tracking table 2. It displays keywords where you already have favorable Google rankings in a separate table The ability clearly shows whether you rank in the top 3, top 10, or top 20 for specific keywords and URLs. Additionally, it displays rankings for both mobile and desktop devices. ### Required Tables To use this automation, you need to create the following tables: #### 1. Top Ranking Keywords This table is used to identify keyword opportunities. It helps you quickly find keywords where you already rank in the top 3, 10, or 20 positions. This information is particularly valuable for creating content that matches these search queries. sql CREATE TABLE IF NOT EXISTS public.top_ranking_keywords ( data_date date NOT NULL, query text COLLATE pg_catalog."default" NOT NULL, url text COLLATE pg_catalog."default" NOT NULL, device text COLLATE pg_catalog."default", result_type text COLLATE pg_catalog."default", total_impressions integer, total_clicks integer, avg_position double precision, ctr_percentage double precision, position_bucket text COLLATE pg_catalog."default", domain text COLLATE pg_catalog."default", CONSTRAINT ranking_primary_key PRIMARY KEY (data_date, query, url) ) #### 2. Tracked Keywords Add the keywords you want to monitor rankings for in this table. sql CREATE TABLE IF NOT EXISTS public.tracked_keywords ( domain text COLLATE pg_catalog."default" NOT NULL, keyword text COLLATE pg_catalog."default" NOT NULL, created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP, CONSTRAINT tracked_keywords_primary_key PRIMARY KEY (domain, keyword) ) #### 3. Rank Tracking by Keywords This table exclusively tracks the rankings of keywords listed in the tracked_keywords table. sql CREATE TABLE IF NOT EXISTS public.rank_tracking_by_keywords ( data_date date NOT NULL, url text COLLATE pg_catalog."default" NOT NULL, device text COLLATE pg_catalog."default", keyword text COLLATE pg_catalog."default" NOT NULL, clicks integer, impressions integer, "position" double precision, ctr double precision, domain text COLLATE pg_catalog."default", CONSTRAINT tracked_keyword_primary_key PRIMARY KEY (data_date, url, keyword) )
The steps
- Get Ranking Keywords by URL
- Domains
- Split Out
- Loop Over Items
- If
- Loop Over Items1
- If1
- Get Keyword Opportunities
- get_date_of_last_run
- get_keywords_to_track
- merge_query_params
- concat_keywords
- get_date
- get_date_of_last_run_1
21 steps in total.
Similar automations
Monitoring, Ops & IncidentsTrack Keyword Rankings in Google Sheets with BigQuery24 stepsMonitoring, Ops & IncidentsTrack SEO Keyword Rankings by Email with Groq AI10 stepsMonitoring, Ops & IncidentsMonitor Google Keyword Rankings with Bright Data MCP10 stepsMonitoring, Ops & IncidentsTrack Website Keyword Rankings with SERP Data and Alerts18 steps