Home App Docs Blog Github

Trouble showing content based on UTM params

I’m trying to have sections hide and show based on UTM params.

I am able to get this to work inside builder but if I try to load a page with params locally or online it does not seem to work.

I’ve attached some screenshots.

Am I doing something wrong or is there a different way to achieve this.

I’ve also tried to use targeting options where the URL paths contains a param like utm_intent=purchase

but this also hasn’t worked.

Any assistance or advice would be greatly appreciated

I am only able to upload one image

Hey @digitaljosh6, thanks so much for reaching out! Would you mind sharing the Builder url for the content entry and we can take a look (the url should start with builder.io/content…). Thanks!

Hey thanks for getting back to me on this.

This space has no shopify API connection

This space has a shopify connection

One other thing I’ve noticed while working on this is once you start the data binding process for show/hide, the elements disappear inside the builder iframe which makes sense however it does make it tricky to get back to the code for the lamen.

Another thing I’ve tried to get working is different page templates based on query params in the URL using targeting which also doesn’t seem to work correctly.

I’ve tried targeting on this as an example;
(had to remove the link part due to post limits)

Its the same space as the above shopify one but a template where I’ve targeted the url path to contain “utm_intent=purchase”

Any assistance is greatly appreciated. Thanks a lot.

Is there any update on this question? I was about to ask a similar question, but think it may be the same issue.

In my case, I’m loading a page where the original URL has query params on the end, but these aren’t showing on the state object within the Builder JS side.

Original URL example: https://members.walden.local:3000/c/home?url_some=param&other=value

State object on Builder side:

The query is empty. Think this might be similar to the case discussed above - perhaps these are both cases where query is empty, and query.utm_intent is returning undefined

Hey @digitaljosh6 and @jballo, the simplest option here would be to utilize data bindings, specifically #4 in this post. We have a couple fiddle examples there to show how it’s set up, but if you have any questions, please reach out!

Hi Kara! I think I might be having a different issue then. For me, what I’m doing is visiting a page I can serve from builder, such as /somepage and I have some query params on the end, such as /somepage?some_param=12. I am not seeing these params come through to the state object in the Builder side

Do I need to do something special to allow query params to be read through?

My URL: https://members.walden.local:3000/recipes?meat_type=Lamb

The state object has the path but not the URL param:

Hi @jballo!

Can you send us a github repo or codesandbox so we can reproduce this on our end? Thanks!

Hi Maddy - can you try this on our builder account, visiting members.waldenlocaltesting.com/recipes?some=param ?

I can post a code snippet if needed, but can guarantee that we are passing the full URL through to builder when fetching the page. We are doing this on the server side, and then rendering the HTML returned into the page we return to the end user.

Having the same issue here
The query params are not present in the state.location.query object
if you visit this page: test-query you will see the error

My company is trying to decide a tool and we like Builder but if we cannot use the query params we are blocked and will have to choose another tool, any suggestions here?