In your request ".ourdomain.com" will actually contain the root domain and not the subdomain.
Subdomains will look like this "test.ourdomain.com" or "staging.ourdomain.com". If your tag requested you to pass in the subdomain you might want to pass in 'test.ourdomain.com' or 'staging.ourdomain.com' for example. Passing in '.ourdomain.com' would be the same as passing the root domain of your site.
To answer your question, you can store the current domain into a data source variable and be able to manipulate it to the format you like.
In Tealium, there is a data source called 'domain' that will be able to grab all of your sites domains including the subdomain (this will take you halfway there?)
For example here are some different examples that can be stored inside the 'domain' data source:
I hope this gives you more direction in what you are trying to accomplish. Please reach out to your account manager if you like to discuss in more detail.