# Target based on a URL parameter

To enable a feature based on a URL parameter, first [pass the page URL to Hypertune](/guides/pass-the-page-url-to-hypertune.md).

Then add a rule to your flag to check if the URL contains the parameter:

<figure><img src="/files/3mT4NNQAKcfpRQQTaO7U" alt=""><figcaption></figcaption></figure>

The order of targeting rules is important.

In the example above, the rule runs before the default rule that contains the `Experiment` expression. As a result, users with the matching URL parameter will exit the flag logic immediately. They won’t enter the experiment, which keeps exposures and analytics clean.

For this reason, we recommend keeping all targeting logic within a single flag rather than spreading it across multiple flags or hardcoding it in your application.

Hypertune makes this possible via its flexible configuration language, [Hyperlang](/concepts/logic.md#hyperlang).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hypertune.com/guides/target-based-on-a-url-parameter.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
