Skip to main content
Solved

Do URL wildcards work for subdomains?

  • January 8, 2024
  • 1 reply
  • 62 views

As the title says, can I use a wildcard for a subdomain while setting up a URL rule?

We have URLs with different subdomains depending on certain factors/environments: subdomain1.company.com, subdomain2.company.com etc.

Let’s say I want to track a page which would have URLs like subdomain1.company.com/testfeature, subdomain2.company.com/testfeature and so on.

Do I always need to add an OR condition for URLs while setting up tracking for this feature or can I use a wildcard?

Also, let’s say that so far we were only tracking subdomain1.com URLs for all our features but need to change the rules to track both subdomain1 and subdomain2 (Or a generic variation if possible), is there an automated way to do this or would I manually need to change the rules for all features? 

Best answer by Stuart

Hi @Simarpreet Singh,

 

To my knowledge, wildcards can be used anywhere within a URL when creating a URL rule as part of mapping a feature.

 

For example, if you have different domains like gainsight.com, gainsight.eu, gainsight.co.uk, then the URL rule could simply be gainsight.*/[desired path].

 

In your scenario, either [subdomain1], [subdomain2] can be replaced in entirety with a wildcard, or you can replace the number (making [subdomain]*).

 

With respect to an automated way to replace URLs, this can be completed using the host settings, which is a gear icon in the top right corner of the mapping screen:

 

 

 

enter the new URL into the ‘New Host URL’ field column and press update, and this will update the URL rules across your feature mappings.

 

Hope this helps!

 

Stuart

View original
Did you find this topic helpful?

1 reply

Stuart
Forum|alt.badge.img+3
  • Helper ⭐️⭐️
  • 144 replies
  • Answer
  • January 8, 2024

Hi @Simarpreet Singh,

 

To my knowledge, wildcards can be used anywhere within a URL when creating a URL rule as part of mapping a feature.

 

For example, if you have different domains like gainsight.com, gainsight.eu, gainsight.co.uk, then the URL rule could simply be gainsight.*/[desired path].

 

In your scenario, either [subdomain1], [subdomain2] can be replaced in entirety with a wildcard, or you can replace the number (making [subdomain]*).

 

With respect to an automated way to replace URLs, this can be completed using the host settings, which is a gear icon in the top right corner of the mapping screen:

 

 

 

enter the new URL into the ‘New Host URL’ field column and press update, and this will update the URL rules across your feature mappings.

 

Hope this helps!

 

Stuart


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings