> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.poool.fr/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How to use return URLs?

Return URLs are very useful, especially when a subscriber connects while reading an article. After login or subscription, the reader is directly redirected to the page or article from she/he comes. This is very useful to maintain an optimal user experience!  
​

# How to set up return URL?

To set up a "return URL", you have to pass an URL parameter on each URL where there is a need to go back. There are two ways to do that:  
​

**Option 1:**  
Putting the following parameter **?returnUrl={return_url}** at the end of the URL in the widget creation or settings:

[![](https://storage.crisp.chat/users/helpdesk/website/-/5/7/4/4/57442af36ae84c00/ad31d05b-7997-4bbe-ba46-aa70b2_10e2jvm.png)](https://downloads.intercomcdn.com/i/o/998137064/ad9b8f58b0b068ffb49f3035/image.png?expires=1773333000&signature=5d70cc5167fd5b6aa7f25d50ce6343126c7cdb66e93ff6aa68aa5cc06e745411&req=fSkvF8p5nYdbFb4f3HP0gGvYrZ3%2BuPRZbeMdzmdmQDDdFU3%2BshRDVoEX7454%0AbEEMPdSUv3TRdtEvlg%3D%3D%0A)

**Note:** {return_url} is actually a Javascript shortcut function "window.location.href", which allows to recover the URL of the current page.  
​  
​  
​**Option 2:**  
Directly in your code, adding the parameter at the end of the URL affected

## 📌 Script Poool - previous version

```
poool("config", "subscription_url", "http://mysite.com/subscribe?return_url=" + window.location.href);
```

## 📌 Script Poool - new version

```
access.config('subscription_url', 'http://mysite.com/subscribe?return_url=
```

Both of these solutions involve that you have recovered by yourself the URL information and redirected it on the server or in Javascript in the right moment (post-login or post-registration). Without that, there will be no redirection 😊.

Here is an example you can use to redirect your users :

```
const urlParams = new URLSearchParams(window.location.search);

const returnUrl = urlParams.get('return_url');

if (returnUrl) {  
window.location.href = returnUrl;  
}
```

If you need more information about it, you can contact us on Intercom!

[Log in to Dashboard](https://dashboard.poool.fr/)