Skip to content

Support subdomain matching#34

Merged
strzibny merged 8 commits into
masterfrom
dsojevic/match-subdomains
Jun 29, 2026
Merged

Support subdomain matching#34
strzibny merged 8 commits into
masterfrom
dsojevic/match-subdomains

Conversation

@dsojevic

Copy link
Copy Markdown
Contributor
  • Fixes issue with domain matching in result links
    • Previously include? would be used to check but it would falsely match if the domain was anywhere in the URL, e.g. for the domain example.com, it would also match this URL: https://site.info/example.com or this URL: https://www.weareexample.com/
  • Adds match_subdomain attribute to sites
  • When toggled on, links from subdomains will also be considered a match for the site, when toggled off, only the exact domain (with www. prefixes also considered as matching) will be considered a match
CleanShot 2026-06-29 at 10 46 06

@strzibny strzibny left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot David. This is good.

I think you missed the main place where we need to pass the match_subdomains which is here:

result = client.extract_position(results, target.site.domain)

I also left some small comments that would also be nice to address.

Comment thread app/services/serp_api_client.rb Outdated
Comment thread app/services/serp_api_client.rb Outdated
Comment thread app/services/serp_api_client.rb
@dsojevic

Copy link
Copy Markdown
Contributor Author

I think you missed the main place where we need to pass the match_subdomains which is here:
...
I also left some small comments that would also be nice to address.

Thanks @strzibny, I'd adjusted that line previously but I guess I missed committing it and clearly blew it away with another command 😅 -- added it back in now.

Have also addressed the other comments.

@dsojevic
dsojevic requested a review from strzibny June 29, 2026 11:35
@strzibny
strzibny merged commit 99b7dca into master Jun 29, 2026
1 of 5 checks passed
@strzibny

Copy link
Copy Markdown
Contributor

Thanks David.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants