<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Joshua + Schaible + Blog &#187; jQuery</title>
	<atom:link href="http://www.joshuaschaible.com/blog/tag/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.joshuaschaible.com/blog</link>
	<description>My World.</description>
	<lastBuildDate>Fri, 14 May 2010 18:19:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How To Redirect Users Using Javascript or PHP!</title>
		<link>http://www.joshuaschaible.com/blog/how-to-redirect-users-using-javascript-or-php/</link>
		<comments>http://www.joshuaschaible.com/blog/how-to-redirect-users-using-javascript-or-php/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 19:14:29 +0000</pubDate>
		<dc:creator>Joshua Schaible</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.joshuaschaible.com/blog/?p=1949</guid>
		<description><![CDATA[
Say your switching domains and you want to automatically forward users that go to your old domain, to get forwarded them to your new one. This can be accomplished with either Javascript or PHP.

Using Javascript
Insert this Javascript code into the head of your page (Most likely your index file):

&#60;script type=&#34;text/javascript&#34;&#62;
function delayer(){
&#160; &#160; window.location = &#34;http://joshuaschaible.com&#34;
}
&#60;/script&#62;

Replace [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.joshuaschaible.com/blog/wp-content/uploads/2009/10/code.jpg" alt="code" title="code" width="500" height="150" class="aligncenter size-full wp-image-1963" style="border: 2px solid #333" /></p>
<p>Say your switching domains and you want to automatically forward users that go to your old domain, to get forwarded them to your new one. This can be accomplished with either Javascript or PHP.</p>
<p><span id="more-1949"></span></p>
<h3>Using Javascript</h3>
<p>Insert this Javascript code into the head of your page (Most likely your index file):</p>
<div class="codesnip-container" >
<div class="html4strict codesnip" style="font-family:monospace;"><span class="sc2">&lt;<a href="http://december.com/html/4/element/script.html"><span class="kw2">script</span></a> <span class="kw3">type</span><span class="sy0">=</span><span class="st0">&quot;text/javascript&quot;</span>&gt;</span><br />
function delayer(){<br />
&nbsp; &nbsp; window.location = &quot;http://joshuaschaible.com&quot;<br />
}<br />
<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/script.html"><span class="kw2">script</span></a>&gt;</span></div>
</div>
<p>Replace &#8220;http://joshuaschaible.com/&#8221; with that URL you want to forward your users too. Then you must insert an &#8220;onload&#8221; function in your body tag. It should look like this: </p>
<div class="codesnip-container" >
<div class="html4strict codesnip" style="font-family:monospace;"><span class="sc2">&lt;<a href="http://december.com/html/4/element/body.html"><span class="kw2">body</span></a> <span class="kw3">onLoad</span><span class="sy0">=</span><span class="st0">&quot;setTimeout(&#8216;delayer()&#8217;, 5000)&quot;</span>&gt;</span></div>
</div>
<p>This tells the browser to forward to the site you specificed in 5 seconds. 5 Seconds = 5000. 4 Seconds = 4000 and so on.</p>
<h3>Using PHP</h3>
<p>If you want to automatically forward your users with out a delay, here is a simple step. First your index file must have an extention of .php. (ex. index.php) If it doesn&#8217;t you can do this in your control panel or FTP. Next, insert this code at the top of your web page.</p>
<div class="codesnip-container" >
<div class="php codesnip" style="font-family:monospace;"><span class="kw2">&lt;?php</span><br />
&nbsp; <a href="http://www.php.net/header"><span class="kw3">header</span></a> <span class="br0">&#40;</span><span class="st0">&quot;Location: http://joshuaschaible.com&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="sy1">?&gt;</span></div>
</div>
<p>Again, make sure to change the URL so that your site doesn&#8217;t forward to mine.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joshuaschaible.com/blog/how-to-redirect-users-using-javascript-or-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Track Outgoing Links With jQuery And G-Analytics!</title>
		<link>http://www.joshuaschaible.com/blog/track-outgoing-links-with-some-jquery-and-google-analytics-easy/</link>
		<comments>http://www.joshuaschaible.com/blog/track-outgoing-links-with-some-jquery-and-google-analytics-easy/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 21:35:48 +0000</pubDate>
		<dc:creator>Joshua Schaible</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Google Analytics]]></category>

		<guid isPermaLink="false">http://www.joshuaschaible.com/blog/?p=1676</guid>
		<description><![CDATA[
This is an explanation of how you can track single outgoing links with some jQuery and Google Analytics. Why would you do this? Say your selling an iPhone app, and you have a few ads/links on your own site linking to that iPhone app in iTunes, and you want to know how many people are [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="aligncenter size-full wp-image-1700" style="border: 2px solid #666666;" title="analytics" src="http://www.joshuaschaible.com/blog/wp-content/uploads/2009/09/analytics1.jpg" alt="analytics" width="500" height="150" /></p>
<p style="text-align: left;">This is an explanation of how you can track single outgoing links with some<a href="http://jquery.com/" target="_blank"> jQuery</a> and <a href="http://google.com/analytics">Google Analytics</a>. Why would you do this? Say your selling an iPhone app, and you have a few ads/links on your own site linking to that iPhone app in iTunes, and you want to know how many people are clicking on that ad vs. the people buying the app. Sound like something you need? Lets get started.</p>
<p><span id="more-1676"></span></p>
<p style="text-align: left;">If you don&#8217;t have a Google Analytics account, go make one and come back once you have installed the tracking code in the footer of your website. Don&#8217;t worry, this post will wait for you.</p>
<h3 style="text-align: left;">Step #1</h3>
<p>Enter this into the &lt;head&gt; of your website if your not already using the jQuery library.</p>
<div class="codesnip-container" >
<div class="html4strict codesnip" style="font-family:monospace;"><span class="sc2">&lt;<a href="http://december.com/html/4/element/script.html"><span class="kw2">script</span></a> <span class="kw3">src</span><span class="sy0">=</span><span class="st0">&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js&quot;</span> <span class="kw3">type</span><span class="sy0">=</span><span class="st0">&quot;text/javascript&quot;</span>&gt;&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/script.html"><span class="kw2">script</span></a>&gt;</span></div>
</div>
<h3 style="text-align: left;">Step #2</h3>
<p>Now go to the specific link that you want to track the clicks on. Your basic html link will probably look like this:</p>
<div class="codesnip-container" >
<div class="javascript codesnip" style="font-family:monospace;"><span class="sy0">&lt;</span>a href<span class="sy0">=</span><span class="st0">&quot;http://joshuaschaible.com/myiphoneapp&quot;</span> target<span class="sy0">=</span><span class="st0">&quot;_blank&quot;</span><span class="sy0">&gt;</span>Buy My App<span class="sy0">!&lt;/</span>a<span class="sy0">&gt;</span></div>
</div>
<p>All we have to do is add one  javascript variable:</p>
<div class="codesnip-container" >
<div class="javascript codesnip" style="font-family:monospace;">onClick<span class="sy0">=</span><span class="st0">&#8216;javascript: pageTracker._trackPageview(&quot;/outgoing/NAME-HERE&quot;);&#8217;</span></div>
</div>
<p><span>Add the onClick function and your link will look like this: </span></p>
<div class="codesnip-container" >
<div class="javascript codesnip" style="font-family:monospace;"><span class="sy0">&lt;</span>a onClick<span class="sy0">=</span><span class="st0">&#8216;javascript: pageTracker._trackPageview(&quot;/outgoing/NAME-HERE&quot;);&#8217;</span> href<span class="sy0">=</span><span class="st0">&quot;http://joshuaschaible.com/myiphoneapp&quot;</span> target<span class="sy0">=</span><span class="st0">&quot;_blank&quot;</span><span class="sy0">&gt;</span>Buy My App<span class="sy0">!&lt;/</span>a<span class="sy0">&gt;</span></div>
</div>
<p>Where it says &#8220;NAME-HERE&#8221; you should put a name or identifier of what your tracking. For example:</p>
<div class="codesnip-container" >
<div class="javascript codesnip" style="font-family:monospace;"><span class="sy0">&lt;</span>a onClick<span class="sy0">=</span><span class="st0">&#8216;javascript: pageTracker._trackPageview(&quot;/outgoing/myiphoneapp&quot;);&#8217;</span> href<span class="sy0">=</span><span class="st0">&quot;http://joshuaschaible.com/myiphoneapp&quot;</span> target<span class="sy0">=</span><span class="st0">&quot;_blank&quot;</span><span class="sy0">&gt;</span>Buy My App<span class="sy0">!&lt;/</span>a<span class="sy0">&gt;</span></div>
</div>
<h3>Step #3</h3>
<p><span>Log into Google Analytics. In the left hand side go to &#8220;Content&#8221; and then to &#8220;Top Content.&#8221;<br />
</span></p>
<p><a href="http://www.joshuaschaible.com/blog/wp-content/uploads/2009/09/Picture-2.png" rel="lightbox[1676]"><span><img class="alignnone size-full wp-image-1734" title="Picture 2" src="http://www.joshuaschaible.com/blog/wp-content/uploads/2009/09/Picture-2.png" alt="Picture 2" width="258" height="372" /></span></a></p>
<p><span>At the bottom there will be a search box which says &#8220;Filter Page.&#8221; Type in &#8220;outgoing&#8221;. It should then show you all records of /outgoing/ clicks. According to our example it should say &#8220;/outgoing/myiphoneapp/ and show you the amount of clicks and the amount of unique page views.</span></p>
<div id="attachment_1745" class="wp-caption alignnone" style="width: 310px"><a href="http://www.joshuaschaible.com/blog/wp-content/uploads/2009/09/Picture-31.png" rel="lightbox[1676]"><img class="size-medium wp-image-1745" title="Picture 3" src="http://www.joshuaschaible.com/blog/wp-content/uploads/2009/09/Picture-31-300x47.png" alt="Picture 3" width="300" height="47" /></a><p class="wp-caption-text">Click to enlarge!</p></div>
<h3 style="text-align: left;">Remember&#8230;</h3>
<p><span>Google Analytics doesn&#8217;t work in real time yet, so you may have to wait up to 24 hours to start seeing the click numbers go up!</span><span> Hope you enjoyed! Please comment with any questions!</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.joshuaschaible.com/blog/track-outgoing-links-with-some-jquery-and-google-analytics-easy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
