0

I am trying to capture the sharepoint page user was on when the click on a Qualtrics Survey. However, using 'document.referrer', i am only able get the part of the URL (.sharepoint.com) instead of getting (.sharepoint.com/pagefolder/pageid.aspx)

I can add custom JS on the Qualtrics survey to pull the url, what is the Sharepoint equivalent of 'document.referrer' for Chromium based browsers (Chrome, Edge etc.)

'document.referrer' did use to work for IE but we no longer use that browser.

Thank you for your help!

1 Answer 1

0

According to my research and testing, browsers that support the use of document.referrer :Chrome, IE, Edge, Firefox ,Safari ,Opera. enter image description here

More information you can refer to this document: HTML DOM Document referrer

By the way, you also can use Window.location.href method to get SharePoint URL, for example:

function alertCurrentURL() {
    alert(`Current URL: ${window.location.href}`);
  }

Hope it can help you. Thanks for your understanding.

Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.

===================================

If the answer is helpful, please click "√" on the left panel of the answer and kindly upvote it.

1
  • Do you have any further questions about this thread? If you have any questions or progress, you can contact me in time.
    – Zella_msft
    Aug 1, 2022 at 9:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.