Passing query parameters | Community
Skip to main content
bkmills
New Participant
May 1, 2024
Solved

Passing query parameters

  • May 1, 2024
  • 1 reply
  • 1726 views

Hello,

 

I've been tasked with trying to figure out if it's possible to pass a query parameter from a page where AT.js runs (2.x) to a page where it doesn't. For additional context, the query parameter would been to added to a button element on the page where Target runs to an element on the subsequent page without Target.

 

I don't think it's possible given the absence of the lib, but wanted to ask the community before traveling down the rabbit hole.

 

Thanks!

 

Cc: @amelia_waliany

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by viveksachdeva

Hey Brion,

In general, in a setup with AT and AEM, there are 2 possibilities:

- You change links via AT. For that, you need to have AT loaded on the page where you want to modify CTA, etc. But since you mentioned, no AT script is loaded, this one is not feasible.

- Second option would be to bake that in application logic. So, in your banner configuration, you can have a flag to add query parameter based on the condition you want. Something like preserve query parameter or something, and then handle it in component code. This could serve the purpose in your case.

 

Thanks!

 

1 reply

viveksachdeva
New Participant
May 2, 2024

Hi there,

 

Just to clarify my understanding of your question, you want to add query parameter to a button link on a page that has AT lib loaded, and upon clicking the button, user would be taken to a page which doesnt have AT lib loaded. Is that understanding correct?

  1. I assume purpose of this thing would be to track conversion via button click?  If it is, you can simply get this report from the AT or AA rather than adding query parameter
  2. If you anyway want to add a query param, it should be totally possible. Using AT, you can modify the link on source page. For those users who see this personalized experience, once they click on the button, they will be taken to target page with the query parameter configured. It doesnt matter whether new page has AT or not.
bkmills
bkmillsAuthor
New Participant
May 6, 2024

Hello @viveksachdeva ,

 

Thank you for your response!

 

Let me add a bit more context: I have a promotional banner on a page where I'll be changing the query parameter via AT (yes, for tracking purposes). The following page in the user flow--that doesn't have AT--has the same promo banner. The query parameter on this page would also need to be changed to match the one I'm changing on the previous page.

So a visitor doesn't necessarily have to click on the promo banner. However, if they click any number of CTAs on the page with AT and are redirected to the page without AT is where I need to change/pass the query parameter.

I can't think of a way that this is possible, but I'm doing my due diligence to rule it out if necessary.

 

Thanks,

Brion

viveksachdeva
viveksachdevaAccepted solution
New Participant
May 6, 2024

Hey Brion,

In general, in a setup with AT and AEM, there are 2 possibilities:

- You change links via AT. For that, you need to have AT loaded on the page where you want to modify CTA, etc. But since you mentioned, no AT script is loaded, this one is not feasible.

- Second option would be to bake that in application logic. So, in your banner configuration, you can have a flag to add query parameter based on the condition you want. Something like preserve query parameter or something, and then handle it in component code. This could serve the purpose in your case.

 

Thanks!