Expand my Community achievements bar.

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?

Avatar

Level 2

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?lan...]

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!

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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!

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

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!

Avatar

Level 2
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.