Using jQuery Cookie to save referer URL and display a certain phone number
<p>So I'm trying to get and store a referrer URL using jquery cookie. What I would like to happen is if someone comes in from Google or Facebook or any other site (other than direct) then they would get a specific phone number (888-888-888). If someone types in the site directly then the referrer URL will not set or be seen as direct and display a different phone number (123-456-7890). Below is the code I'm using but it does not seem to work:</p>

<pre><code>&lt;script type='text/javascript' src="http://cdn.jsdelivr.net/jquery.cookie/1.4.1/jquery.cookie.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
jQuery(document).ready(function() {
    if (!jQuery.cookie("urlCookie")) {
        var url = document.referrer;
        var match = url.indexOf("acmeco.com");
        if (match != -1) {
            jQuery.cookie("urlCookie", url);
            jQuery("#phone-anchor").text('888-888-8888');
        }
    } else {
        jQuery("#phone-anchor").text('123-456-7890');
    }
});
&lt;/script&gt;
</code></pre>

<p>Any help would be appreciated.</p>