Forum Discussion
- SuzieHKhoros Alumni (Retired)
Hi ebonifacio. I reached out to our Khoros Services team on this one.
Cookies are accessible through Freemarker or JavaScript, but that assumes that the relevant cookies are even available to Community. So depends entirely on how they’ve set things up on their side.I think reaching out to your Khoros contact (Customer Success Manager or Technical Account Manager) or Khoros Support might be a way to get started.
I'm hoping that some of our Developer community members have more insight and experience to share. allensmith81 Claudius jeffshurtliff StanGromer?
These FreeMarker objects have methods for working with cookies. Hi ebonifacio,
I'll keep looking into the cookie/referer method but, in the meantime, since you own the source website as well, one option you have is leveraging UTM query parameters.
For example, whenever I am promoting community content on Twitter or other channels, I will include these or similar parameters in the URL:
?utm_source=twitter&utm_medium=tweet
Or, as another example, if I am linking to the community from our corporate website I might add something like this:
?utm_source=corporate_website&utm_medium=banner
Then you'd be able to capture that data in FreeMarker if it is defined and do with it what you will. For example:
<#-- Retrieve the utm_source and utm_medium values if defined --> <#assign utmSource = http.request.parameters.name.get('utm_source', '') /> <#assign utmMedium = http.request.parameters.name.get('utm_medium', '') />
Hope this helps!
I also just found the FreeMarker you need to capture the referer value, which is the source URL where the user came from.
<#-- Get the referer URL --> <#assign referer = http.request.getHeader('referer')!'' />
Simple enough. Then you can play with the URL however you need to determine where it came from. For example:
<#if referer?contains('google.com')> <p>You came here via Google!</p> <#else> <p>You did not come here via Google!</p> </#if>
Hope this helps!
- ebonifacioMentor
Thanks jeffshurtliff
I'm going to try this, it looks a better and easy solution.
Related Content
- 2 years ago
- 2 months ago