Expand my Community achievements bar.

Never miss an update of the Adobe Journey Optimizer Community Lens! Subscribe now to get the latest updates, insights, and highlights delivered straight to your inbox every time a new edition drops.

Data from Email template to landing page

Avatar

Level 1

I have a use case where I need to pass a dynamic ID (such as a reward ID) from an email template to an AJO landing page. My goal is for the landing page to use JavaScript to fetch this ID from the URL and personalize the experience accordingly.
I understand how to retrieve URL parameters on the landing page using JavaScript. However, I’m having trouble configuring my email template’s anchor tag to include the dynamic reward ID as a parameter in the URL when a recipient clicks the link. I tried using this HTML code but it didn't work:

<script>
function insertIdIntoURL(newId) {
    const url = new URL(window.location);
    url.searchParams.set('id', newId);
    window.history.replaceState({}, '', url);
}

 
document.addEventListener('DOMContentLoaded', function () {
    const button = document.getElementById('sendIdBtn');
    if (button) {
        button.addEventListener('click', function () {
            const idToSend = 'YOUR_ID_VALUE';
            insertIdIntoURL(idToSend);
        });
    }
});
</script>
Topics

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

1 Reply

Avatar

Community Advisor and Adobe Champion

Hi @Sanjana_01 

for security reasons, emails do not really support scripting.

However, you should be able to define parameters in the email channel configuration. Assuming that you have your dynamic ID in the profile data, you should be able to put an according placeholder in the value field, see also

https://experienceleague.adobe.com/en/docs/journey-optimizer/using/channels/email/configure-email/ur...

Cheers from Switzerland!