Targeting on URL path params / querystring

Is it possible to target on URL params, like utm_campaign added to the URL path?

I was sure that adding “URL path + contains + utm_campaign=vip-promo” will work, like here:
image

But it doesn’t…

We can’t predict all params added to the URL and its order, so we can’t use is for this. Contains seems to be the best option, but it doesn’t work.

Maybe I should configure this targeting in a different way?

Otherwise, we will have to use Next.js Middleware and set UTM params as Custom Attributes, and target those attributes instead of targeting on the path.

Custom Attributes will give us additional behavior (persistence):
when user will visit the same page next time but without UTM params we can still serve the same page he saw with UTM params.

But sometimes we would like to target only when specific params are included in the URL, without this persistence.

Ok, I guess, since we are using Next’s getStaticProps Builder doesn’t have access to HTTP headers and all params in the URL sting?

So the Next.js Middleware is the only way in this case?

Hi @LucasMatuszewski ,

For troubleshooting purposes, can you check if it works if you use one of the two conditions and not both at the same time (with the AND condition).
However in this case, you might find custom targeting feature helpful. here is a link to our documentation that talk about custom targeting:

Also if you need documentation about targeting feature as well:

I hope this information helpful