Expand my Community achievements bar.

SOLVED

WebApp URL is getting Encoded

Avatar

Level 3

Hi,

We are trying to preload a webapp using a custom schema.

If we copy the URL along with query params and hit it directly in browser, it loads the data properly.

But when we trigger the same via campaign (Email/SMS), the URL params are getting encoded.

Note: It has something to do with URL tracking

When we excluded the URL from tracking in email, it loaded the URL properly.

 

Is there a way to load URL decoded without excluding it from tracking?

 

Coded url path in delivery - /webApp/samplewebapp?id=<%= cryptString(targetData.lid) %>

 

Expected url path - webApp/samplewebapp?id=@XKNvG9IU25DlmroyzVivrg==

 

Actual url path - webApp/samplewebapp?id=%40XKNvG9IU25DlmroyzVivrg%3D%3D

 

 

 

Please help me with this.

 

Thanks,

Krishna

1 Accepted Solution

Avatar

Correct answer by
Level 3

We ended up setting up a redirect webapp, passing the webapp name and crypt string as params.

Eg:

 

https://youwebappdomain/redirect?page=webappname&id=cryptString(id)

 

The above will hit the redirect URL,

In redirect, we are using

location.href or window.location.href = https://youwebappdomain/webappname?id=id

this will redirect to proper webapp without encoding the characters.

 

Note: You might have to use "unescape(id)" in redirect webapp just in case.

https://youwebappdomain/webappname?id=unescape(id)

 

Thanks,

Krishna

View solution in original post

11 Replies

Avatar

Community Advisor

Hi @krishnakanth_patnaik_cc,

As such, keeping tracking enabled and not having a tracked URL behind a link is not possible.

 

But the example you provided above looks like only the id parameter in the URL is changed, and it is being (Url)escaped, not encoded. Check your email/sms link in the delivery template, there might be the escapeUrl being called, you can remove that and use the plain id parameter.

 

Let me know if that helped.

 

Thanks,

Ishan

Avatar

Level 3

Hi @isahore ,

Thank you for quick reply. We are not using escapeUrl(). The sysntax looks like this.

 

/webApp/samplewebapp?id=<%= cryptString(targetData.lid) %>

 

Will update the question with this details as well.

 

Thanks,

Krishna

Avatar

Community Advisor

Hi @krishnakanth_patnaik_cc,

But is the encoded URL giving any error on the webapp loading? This is the default behavior of Adobe Campaign. The cryptString method will result in the value being url encoded if used in a url.

Avatar

Level 3

Hi @isahore ,

No it is not giving any error, it loads the page without any issue. But when I fill the form it creates a new record even when I'm preloading it and using cryptString to encrypt the id.

 

I even tried to use Encrypted Identifier field in Recipient table. But same result.

 

I tried JavaScript unescape() method to make the characters load properly but no change. 

 

All this is working find if I'm disabling the tracking for this URL.

Avatar

Community Advisor

Hi @krishnakanth_patnaik_cc,

Then you need to handle that in the web app. If you are passing a field other than the recipient Id, then the OOTB preloading in the web app would not work.

Avatar

Community Advisor

Hi @krishnakanth_patnaik_cc 

 

If you want to load additional data, then you need to check the below checkbox and pull those data to let them flow in the WebApps.

AkshayAnand_1-1685014383238.png

 

 

Regards

A

Avatar

Community Advisor

Hi @krishnakanth_patnaik_cc 

 

You can compare the link that is being generated by default through adobe campaign after clicking on the link in email and generate it through custom javascript. 

Script to generate similar URL of the WebApp

AkshayAnand_0-1685084315068.png

the above code uses the same functions and sequence to generate the URL that is done through WebApp.

AkshayAnand_1-1685084433907.png

 

Hope this helps to find the difference between both the URLs.

 

Regards

A

Avatar

Community Advisor

Hi @krishnakanth_patnaik_cc,

By default, the preloading in webapp takes recipient Id, that can also be seen on the webapp dashboard

isahore_3-1685085460663.png

 

If you want to use preloading with another schema (other than nms:recipient), then you can do so by changing the document type of the webapp under Properties > General > Storage, shown here:

isahore_2-1685085406045.png

Let me know if that works.

 

Thanks,

Ishan

Avatar

Administrator

Hi @krishnakanth_patnaik_cc,

Were you able to resolve this query with the help of the given solutions or do you still need more help here? Do let us know. In case the given solutions were helpful, then kindly choose the one that helped you the most as the 'Correct Reply'.
Thanks!



Sukrity Wadhwa

Avatar

Correct answer by
Level 3

We ended up setting up a redirect webapp, passing the webapp name and crypt string as params.

Eg:

 

https://youwebappdomain/redirect?page=webappname&id=cryptString(id)

 

The above will hit the redirect URL,

In redirect, we are using

location.href or window.location.href = https://youwebappdomain/webappname?id=id

this will redirect to proper webapp without encoding the characters.

 

Note: You might have to use "unescape(id)" in redirect webapp just in case.

https://youwebappdomain/webappname?id=unescape(id)

 

Thanks,

Krishna

Avatar

Administrator

Great! Thanks for sharing with the Community.



Sukrity Wadhwa