<?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>Hayden Kibble &#187; Internet Marketing</title>
	<atom:link href="http://www.haydenkibble.com/category/internet-marketing/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.haydenkibble.com</link>
	<description>PHP-SEO-IM-DESIGN</description>
	<lastBuildDate>Fri, 17 Dec 2010 23:06:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Make Your Phone &#8216;Kerching&#8217; When You Make A Sale</title>
		<link>http://www.haydenkibble.com/2009/07/make-your-phone-kerching-when-you-make-a-sale/</link>
		<comments>http://www.haydenkibble.com/2009/07/make-your-phone-kerching-when-you-make-a-sale/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 19:23:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Internet Marketing]]></category>
		<category><![CDATA[PHP/MySQL/AJAX]]></category>
		<category><![CDATA[affiliate]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[kerching]]></category>
		<category><![CDATA[notification]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[sale]]></category>

		<guid isPermaLink="false">http://www.haydenkibble.com/?p=15</guid>
		<description><![CDATA[Being the egotistical git I am, I wanted my phone to make a &#8216;kerching&#8217; sound each time I made an affiliate sale. Nothing beats dozing off on a lazy Sunday evening and hearing your cash register ring out. Here&#8217;s how I made it happen&#8230;
First, you need to receive an email each time you make a [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.haydenkibble.com/wp-content/uploads/cash-register-150x150.jpg" alt="cash-register" title="cash-register" width="150" height="150" class="alignright size-thumbnail wp-image-33" />Being the egotistical git I am, I wanted my phone to make a &#8216;kerching&#8217; sound each time I made an affiliate sale. Nothing beats dozing off on a lazy Sunday evening and hearing your cash register ring out. Here&#8217;s how I made it happen&#8230;</p>
<p>First, you need to receive an email each time you make a sale. If your affiliate network will do this, then the first bit is already done. If not, copy the script below into a php file called something like  &#8216;xml-to-email.php&#8217; and upload it to your web server. Full instructions are in comments at the top of the file. You will most likely have to change the regex variable to work with your affiliate network&#8217;s own feed format.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/* #########################################################
&nbsp;
Email When You Make a Sale
Developed by Hayden Kibble July 2009
Hayden@HaydenKibble.com
www.HaydenKibble.com
&nbsp;
Install instructions:
1. Put your affiliate network login and your email details into the variables below
2. You will probably have to edit '$regex_saletime' to match the sale time/date for your paticular aff networks xml feed
2. Upload this file to your web server.
3. Create a file called 'sales.txt' in the same directory as this script and make sure it has read/write permissions
4. Visit the page and it should show a blank page. An email will probably be sent as it picks up all your recent sales
5. Set a cron job up on your web server to run this script every 10 mins or so
6. If you have problems with any of the above, Google is your friend!
&nbsp;
######################################################### */</span>
&nbsp;
<span style="color: #000088;">$base_url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;https://www.affilliate-network.com/myfeed.xml&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$feed_user</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;USERNAME-HERE&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$feed_pass</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;PASSWORD-HERE&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$regex_saletime</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;/&lt;date&gt;(.*)&lt;\/date&gt;/U&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$email_from</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;from@address.com&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$email_to</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;to@address.com&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$email_subject</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;You Made a Sale!&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// ##### Do Not Edit Below This Line! #####</span>
&nbsp;
<span style="color: #000088;">$ch</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_URL<span style="color: #339933;">,</span> <span style="color: #000088;">$base_url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Set your login and password for authentication</span>
<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_USERPWD<span style="color: #339933;">,</span> <span style="color: #000088;">$feed_user</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">':'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$feed_pass</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_HTTPAUTH<span style="color: #339933;">,</span> CURLAUTH_ANY<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_SSL_VERIFYPEER<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_RETURNTRANSFER<span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// get the data and close the session</span>
<span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_exec</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Error Getting Feed.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">curl_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$dates</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">preg_match_all</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$regex_saletime</span><span style="color: #339933;">,</span><span style="color: #000088;">$data</span><span style="color: #339933;">,</span><span style="color: #000088;">$dates</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Read previous sales times from database</span>
<span style="color: #000088;">$fileData</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$myFile</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;sales.txt&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$fh</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fopen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$myFile</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'r'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$fileData</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fread</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fh</span><span style="color: #339933;">,</span> <span style="color: #990000;">filesize</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$myFile</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">fclose</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fh</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Split the file into lines</span>
<span style="color: #000088;">$fileLines</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$fileData</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$newsale</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$fh</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fopen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$myFile</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'a'</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;can't open file&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// See if this sale has already been logged. If not, log it and set 'new sale' variable</span>
<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dates</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$date</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">in_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$date</span><span style="color: #339933;">,</span><span style="color: #000088;">$fileLines</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$newsale</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$sale_time</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$date</span><span style="color: #339933;">;</span>
<span style="color: #990000;">fwrite</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fh</span><span style="color: #339933;">,</span> <span style="color: #000088;">$date</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #990000;">fclose</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fh</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$newsale</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #990000;">mail</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$email_to</span><span style="color: #339933;">,</span><span style="color: #000088;">$email_subject</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;You have made a sale.<span style="color: #000099; font-weight: bold;">\n</span>Sale Time: &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$sale_time</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;From: &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$email_from</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>To test, empty the  sales.txt file you created and run (access) the script. It will see your recent sales have not been logged and fire off the email. Make sure the email does not go to your junk folder.</p>
<p>If you want your computer to play a &#8216;kerching&#8217; upon making a sale, you can simply set up a rule in Microsoft Outlook to play the sound upon receiving an email with &#8216;Payment Received&#8217; in the subject. You get the idea.</p>
<p>For those of you who want the full-on portable cash register, continue on to create a gmail account with a difficult to guess name <em>just for these emails</em>. If you share this address <em>anywhere</em> it will get spammed. We do not want this as you will start hearing an awful lot of incorrect kerching&#8217;s!</p>
<p>You now need to set your phone up to use your gmail account. Make it check for new emails every 10 mins or so (depending on how often you set your cron job to run the script) and set <a href="http://www.haydenkibble.com/downloads/kerching.wav">this kerching wav</a> as your notification sound.</p>
<p>You are now set! When the php script runs intermittently on the cron job, it parses the feed for new sales. When it finds a new sale it sends an email to your phone, which plays a &#8216;kerching&#8217; sound on receipt!</p>
<p><a href="http://www.haydenkibble.com/?ibsa=share&amp;id=15" id="share-link-">Share</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.haydenkibble.com/2009/07/make-your-phone-kerching-when-you-make-a-sale/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
<enclosure url="http://www.haydenkibble.com/downloads/kerching.wav" length="12384" type="audio/x-wav" />
<enclosure url="http://www.haydenkibble.com/downloads/kerching.wav" length="12384" type="audio/x-wav" />
		</item>
		<item>
		<title>Never Trust Adwords Conversion Tracking</title>
		<link>http://www.haydenkibble.com/2009/07/never-trust-adwords-conversion-tracking/</link>
		<comments>http://www.haydenkibble.com/2009/07/never-trust-adwords-conversion-tracking/#comments</comments>
		<pubDate>Sat, 04 Jul 2009 14:08:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Internet Marketing]]></category>
		<category><![CDATA[adwords]]></category>
		<category><![CDATA[affiliate marketing]]></category>
		<category><![CDATA[tracking]]></category>

		<guid isPermaLink="false">http://www.haydenkibble.com/?p=7</guid>
		<description><![CDATA[As any affiliate marketer knows, it&#8217;s a numbers game. You need to track, tweak and split-test your way to success.
99% of affiliate marketers don&#8217;t track which of their adwords ads are profitable and which are losing them money. That&#8217;s why 99% of affiliate marketers fail.
In theory, Adwords conversion tracking is the perfect solution. It allows [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.haydenkibble.com/wp-content/uploads/conversion-tracking-150x150.jpg" alt="conversion-tracking" title="conversion-tracking" width="150" height="150" class="alignright size-thumbnail wp-image-35" />As any affiliate marketer knows, it&#8217;s a numbers game. You need to track, tweak and split-test your way to success.</p>
<p>99% of affiliate marketers don&#8217;t track which of their adwords ads are profitable and which are losing them money. That&#8217;s why 99% of affiliate marketers fail.</p>
<p>In theory, Adwords conversion tracking is the perfect solution. It allows you to track not just what adgroups or ads are converting, but even the keywords leading to sales. I fell in love with Adwords conversion tracking as I knew it would lead to my success. The reality, however, is that it does not manage to register every conversion every time. In fact, in my experience, it only manages to register 50%. This is due to a number of reasons, which include:</p>
<ul>
<li>Adwords uses Javascript to track conversions.</li>
<li> Not everyone has javascript enabled or even installed.</li>
<li>Adwords uses a 30 day cookie. If your affiliate network uses a 45 or 60 day cookie, it will not track conversions after the 30 days. Similarly, if your affiliate network uses a short cookie like, Adwords will track extra conversions</li>
<li>The visitor may close the &#8216;purchase complete&#8217; page with the tracking code installed before it has fully loaded. Adwords won&#8217;t catch the sale.</li>
<li>A customer could bookmark the page with the tracking code installed, causing it to be fired when they return</li>
</ul>
<p>Suddenly, it seems that beautiful dream of knowing the exact ROI of each ad group, ad and keyword may be just another busting bubble in the over-hyper affiliate marketing world. Well, I&#8217;m ecstatic to announce that you can still track this stuff. It just takes a little bit more work. And for near-perfect tracking, it is worth every second.</p>
<p>The trick is to append a variable to all of your ad URLs. Then you have your landing page attach the variable to your affiliate link. The affiliate network should then display the variable in your conversion report. After a couple of months or so you can check how much an ad has made you in sales, then subtract the cost of clicks for that ad over the same period. If you&#8217;ve paid a lot more on clicks than that ad made you in sales, bin it. If it cost a little more, drop your CPC and bring it into profitability.</p>
<p>Most affiliate networks have different rules regarding the variables they show on your stats. For instance, some may require that you give your variable a certain name. Look through their help pages for more info on what you should call the variable, or whether they allow you to create different &#8216;hop links&#8217; or aliases for different ads etc.</p>
<p>Let&#8217;s say I want to track which ads for blue widgets are profitable. I could create an ad with the following URL:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.widgets.com/landingpage.php&lt;strong&gt;?ad=myad1</span></pre></td></tr></table></div>

<p>Then in the source code of the landingpage.php file, I would add this at the top:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> 
&nbsp;
<span style="color: #000088;">$affurl</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://widget.myaffnetwork.com/?ad=&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ad'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Now the &#8216;ad&#8217; variable would be passed all the way from my advert to my affiliate network. So they would see:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//widget.myaffnetwork.com/?ad=myad1</span></pre></td></tr></table></div>

<p>You&#8217;d now see <em>ad=myad1</em> in your sales report next to any sales when happened as a result of someone clicking on that ad.</p>
<p><a href="http://www.haydenkibble.com/?ibsa=share&amp;id=7" id="share-link-">Share</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.haydenkibble.com/2009/07/never-trust-adwords-conversion-tracking/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

