redirect link from facebook to website – javascript?

I have articles posted on facebook from my website http://juniorgoldreport.com/

the website is made in wordpress, and I’ve also created a “Welome” landing page where I want most new users to be directed too.

Read More

I have no idea where I can find information on how to do this, even after countless efforts of googling.

To give an exact idea of what I’ trying to create…

Where someone clicks on an article on facebook, it’ll take them to the “welcome” sign up page, then have a link on it to the article that they clicked on. The link would change depending on what article they clicked on so they can be redirected properly.

I know I can just hard code it, and create multiple landing pages with different links in relation to the article posted, but this just seems inefficient.

Does anyone know how to go about doing this?

this is the landing page
http://juniorgoldreport.com/welcome/

Related posts

Leave a Reply

2 comments

  1. You can try using Javascript, as it would be much easier than creating several webpages. At the point in your page where you want a link to be placed, put something like

    <p id="mynewredirectlink"><a href="default.link">Hey!</a></p>
    

    And then at the bottom of your code, add some javascript to resemble this:

    <script type="text/javascript">
    if (document.referrer === "facebooklink.com")//Where did you come from?
        $("#mynewredirectlink").innerHTML = "<a href="theyclickedfromfacebook.link">Hey!</a>"   //Where are you going?
    

    Then include the other sites you need, and close it with

    </script>
    

    There may be some sites that have varying parts, like an id, so if you need to, you can use (document.referrer.includes(“facebook.com”)) instead.

  2. You can convert your landing page into a fullscreen modal popup. So every new visitor will see the popup when the visit the site or any article. They can fill the form / they can close it to see the article. There is already several plugin for modal popup / newsletter popup. You just need to do a little bit css to make it full screen.