Forum Discussion
Sorry if you've already tied this, but you should be able to access the referrer directly from within the custom component.
Also, welcome to the community - another Nathan I see!
Hi Nathan,
Thanks for the reply and the welcome :smileyhappy:
Yes I have already tried just using ${http.request.referrer} in the custom component, which works fine if I'm just clicking a direct link to the page, but I probably didn't explain my problem fully.
I'm trying to capture referrals from a particular domain that we're using in an advertising campaign and redirect them to a custom page before signup using the Page Initialization feature. I've got that part working fine with the following:
<#if http.request.serverName?ends_with("domain.com") && page.name != "Forum-Access">
${http.response.setRedirectUrl("${community.urls.tapestryPrefix}/custom/page/page-id/Forum-Access")} <#else> </#if>
The problem is, I also need to capture the referring url as part of the project requirements and when using the redirect to the custom page, ${http.request.referrer} just returns "The widget could not be displayed".
So I've figured that I need to capture the referrer as part of the Page Initialization script and forward it on to the custom component... and that's where I'm stuck at the moment.
Any ideas would be greatly appreciated.
Cheers
Related Content
- 4 years agoInactive User
- 5 months ago