Unable to read UTM Params in AEM Cloud Publish Instance , But able to read these params in AEM Cloud Author and local author & local publish | Community
Skip to main content
March 20, 2024
Solved

Unable to read UTM Params in AEM Cloud Publish Instance , But able to read these params in AEM Cloud Author and local author & local publish

  • March 20, 2024
  • 2 replies
  • 1145 views

 

AEM Cloud : utm_source , utm_medium query parameters unable to fetch these values from slingHttpServletRequest object using request.getQueryString() but whereas other parameters  are showing up ex : utm2_source , a=b .

 

 Ex URL : https://publish-p23444-exxxys.adobeaemcloud.com/content/xyz/abcd/en.html?utm_source=xyz&utm_medium=cpc&param=value&lid=1234&ds_s_kwgid=1234&ds_url_v=2&gclid=Te1234&a=b&utm2_source=abcd.

 

From above URL utm_source & utm_medium  are missing in  request.getQueryString() only in publish and able to get in author.

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 somen-sarkar

Hi @asateesh ,

So the utm parameters are getting passed to publisher instance from dispatcher as per logs . 

  • For UTM params, request.getQueryString() is it  returning null or some other object? 
  •  What is your current /ignoreUrlParams  configuration for the dispatcher  ?

It may be an encoding issue also. Have you checked if you are passing another query param with an _ character ,  are you able to get the value ?

 

Thanks,

Somen.

2 replies

arunpatidar
Community Advisor
Community Advisor
March 20, 2024

Hi @asateesh 
Please check https://github.com/adobe/aem-dispatcher-optimizer-tool/blob/main/docs/Rules.md#dot---the-dispatcher-publish-farm-cache-should-have-its-ignoreurlparams-rules-configured-in-an-allow-list-manner 

 

It could be by design, since these are known param and not suppose to be used at server side.

 

But you can try to add ignoreUrlParams block 

 

/ignoreUrlParams {
  /0002 { /glob "utm_source" /type "deny" }  
}

 

Arun Patidar
asateeshAuthor
March 20, 2024

Thank you for replying Arun ,

 

I want the request parameters to passed to publish instance the above configuration you are asking me to 

 

ignoreUrlParams to cache the url even if we have this query param passed through URL.
 
My Ask is the UTM parameters are getting passed to publish instance ( checked the Publish AEM Access  Log ) but when I am trying to read from request.getQueryString() other query parameters I am able to get accept the UTM parameters. 
 
 
somen-sarkar
Community Advisor
somen-sarkarCommunity AdvisorAccepted solution
Community Advisor
March 20, 2024

Hi @asateesh ,

So the utm parameters are getting passed to publisher instance from dispatcher as per logs . 

  • For UTM params, request.getQueryString() is it  returning null or some other object? 
  •  What is your current /ignoreUrlParams  configuration for the dispatcher  ?

It may be an encoding issue also. Have you checked if you are passing another query param with an _ character ,  are you able to get the value ?

 

Thanks,

Somen.

kautuk_sahni
Community Manager
Community Manager
March 20, 2024

@asateesh Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

Kautuk Sahni