SOLVED

Re: How to prevent direct traffic to and sharing of thank you pages and PDF downloads?

Go to solution
Anonymous
Not applicable

How to prevent direct traffic to and sharing of thank you pages and PDF downloads?

I searched the community and found this article, but the answer doesn't seem clear to me. Possibly bc I'm a noob!

I've read that I can add some javascript code to redirect back to the landing page, but I'll have manually change it everytime.

Is there a better way? And if not, what's the code? 🙂

 
Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Re: How to prevent direct traffic to and sharing of thank you pages and PDF downloads?

You could redirect if it is the incorrect referrer page. In other words, they would have to come from a certain page, or it would redirect to page where they would to fill out a form to get content. I created this example for you. Just add it before closing </body> tag on the page. 

<script>
window.onload = function() {
  if (document.referrer !== "CHANGE THIS TO THE PAGE THAT LINKS TO PDF") {
    document.location.href = "CHANGE THIS TO THE PAGE THAT LINKS TO PDF";
  };
 };
</script>

So it should look like this:

<script>
window.onload = function() {
  if (document.referrer !== "http://example.com/landingpage") {
    document.location.href = "http://example.com/landingpage";
  };
 };
</script>

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Re: How to prevent direct traffic to and sharing of thank you pages and PDF downloads?

You could redirect if it is the incorrect referrer page. In other words, they would have to come from a certain page, or it would redirect to page where they would to fill out a form to get content. I created this example for you. Just add it before closing </body> tag on the page. 

<script>
window.onload = function() {
  if (document.referrer !== "CHANGE THIS TO THE PAGE THAT LINKS TO PDF") {
    document.location.href = "CHANGE THIS TO THE PAGE THAT LINKS TO PDF";
  };
 };
</script>

So it should look like this:

<script>
window.onload = function() {
  if (document.referrer !== "http://example.com/landingpage") {
    document.location.href = "http://example.com/landingpage";
  };
 };
</script>
Matt_Stone2
Level 9

Re: How to prevent direct traffic to and sharing of thank you pages and PDF downloads?

An alternative is to do away with thank you pages/download pages and deliver everything via email. There's a lot of discussion on this, but it does ensure that you're getting a clean email (if they really want the asset).

Either way, you're going to fight a losing battle because if people want the PDF that badly, someone else could always just save it and deliver it to them that way.
Anonymous
Not applicable

Re: How to prevent direct traffic to and sharing of thank you pages and PDF downloads?

Murtza, I'll give that a try. Matt - I guess you're right. I can just show the TY page and say the email will have a link to the PDF.

I'll have to think about that.

Thanks both!
Anonymous
Not applicable

Re: How to prevent direct traffic to and sharing of thank you pages and PDF downloads?

Hey all I tried this but now the ty page redirects to the dl page even after I filled out the form. I want the code so that it doesn't do it for ppl who fill out form, but it redirects to those who somehow bypassed the form.