Is it possible to have the getQueryParam Plug-in values be auto-generated or recorded into a custom page properties field for use in AEM content authoring? | Community
Skip to main content
FDmAmG
Level 2
April 21, 2021
Solved

Is it possible to have the getQueryParam Plug-in values be auto-generated or recorded into a custom page properties field for use in AEM content authoring?

  • April 21, 2021
  • 1 reply
  • 1146 views

Trying to configure our AEM authoring to capture our campaign links as you would typically see them in Google Analytics. 

 

Is the approach here the best way to go about it? getqueryparam implementation 

 [https://experienceleague.adobe.com/docs/analytics/implementation/vars/plugins/getqueryparam.html?lang=en#example-%236]

We're not using Adobe Campaign. Our current internal tracking code reg ex in rule builder includes:

URL:channelZone:link / Image:description:placement:cmp

//e.g.: URL?intcmp=wsp_deals-landing-page_link_private-room-sale_deals

Is it possible to have those URL query parameters embedded or auto-generated in a field within AEM authoring when building a landing page, so that we don't need to enter manually per internal campaign? And what is the best way to go about it?

There are manual solutions available https://utmsmartmanager.com/adobe-analytics-utm-builder/ or publicly available UTM "standardizers" but want to explore integrating this capability into our AEM authoring/publishing configuration. 

Thank you for the feedback!

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 Asutosh_Jena_

Hi @fdmamg 

 

If I understand the requirement here, you are trying to read the values from certain parameter and store those values in AEM page properties which you want to do it only while authoring.

 

If this is the requirement, you can do it using the Sling Model in Java. You just need to create a model class which will read the query parameter value (whichever you want) and then set those values into AEM page property with respective name.

Now you need to ensure that this logic should work only on author instance and in edit mode, so you can add the necessary condition checks in sling model to for WCMMode.Edit and Runmode author.

 

Once you have the logic in place, when you open any page with edit mode and have the requried query param in the URL, the values will be automatically set in the page properties and once you publish the page, the same content will be replicated to publish instance. For validation you can open the page property and check the custom tab, you should be able to see the query param values.

 

Thanks!

1 reply

Asutosh_Jena_
Community Advisor
Asutosh_Jena_Community AdvisorAccepted solution
Community Advisor
April 22, 2021

Hi @fdmamg 

 

If I understand the requirement here, you are trying to read the values from certain parameter and store those values in AEM page properties which you want to do it only while authoring.

 

If this is the requirement, you can do it using the Sling Model in Java. You just need to create a model class which will read the query parameter value (whichever you want) and then set those values into AEM page property with respective name.

Now you need to ensure that this logic should work only on author instance and in edit mode, so you can add the necessary condition checks in sling model to for WCMMode.Edit and Runmode author.

 

Once you have the logic in place, when you open any page with edit mode and have the requried query param in the URL, the values will be automatically set in the page properties and once you publish the page, the same content will be replicated to publish instance. For validation you can open the page property and check the custom tab, you should be able to see the query param values.

 

Thanks!

FDmAmG
FDmAmGAuthor
Level 2
April 22, 2021
Hey @asutosh_jena_ thank you for your reply! That approach sounds plausible, we'll work on it in an author+test+publish run mode scenario...Yes, you got the requirement, that is the intended purpose.