<?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>TheLSDJ&#039;s Weblog</title>
	<atom:link href="http://blog.thelsdj.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.thelsdj.org</link>
	<description>The color of television tuned to a dead channel</description>
	<lastBuildDate>Thu, 17 May 2012 06:55:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Daily Digest for May 16th</title>
		<link>http://blog.thelsdj.org/2012/05/16/daily-digest-for-may-16th-2/</link>
		<comments>http://blog.thelsdj.org/2012/05/16/daily-digest-for-may-16th-2/#comments</comments>
		<pubDate>Thu, 17 May 2012 06:25:29 +0000</pubDate>
		<dc:creator>thelsdj</dc:creator>
				<category><![CDATA[Meta]]></category>

		<guid isPermaLink="false">http://blog.thelsdj.org/2012/05/16/daily-digest-for-may-16th-2/</guid>
		<description><![CDATA[Posted a comment.]]></description>
			<content:encoded><![CDATA[<table class="lifestream">
<tr class="lifestream_feedid_16 lifestream_feed_reddit">
<td class="lifestream_icon">
			   <a href="http://www.reddit.com/r/programming/comments/tq3kb/lolcommits_takes_a_snapshot_with_your_webcam/c4otx50"><img src="http://blog.thelsdj.org/wp-content/plugins/lifestream/extensions/reddit/icon.png" alt="reddit (feed #16)" /></a>
		   </td>
<td class="lifestream_text">
<div class="lifestream_label">Posted a comment.</div>
</td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://blog.thelsdj.org/2012/05/16/daily-digest-for-may-16th-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Daily Digest for May 15th</title>
		<link>http://blog.thelsdj.org/2012/05/15/daily-digest-for-may-15th-3/</link>
		<comments>http://blog.thelsdj.org/2012/05/15/daily-digest-for-may-15th-3/#comments</comments>
		<pubDate>Wed, 16 May 2012 06:25:00 +0000</pubDate>
		<dc:creator>thelsdj</dc:creator>
				<category><![CDATA[Meta]]></category>

		<guid isPermaLink="false">http://blog.thelsdj.org/2012/05/15/daily-digest-for-may-15th-3/</guid>
		<description><![CDATA[Liked Life Is Beautiful &#8211; Deadly Premonition (Nivi cover).]]></description>
			<content:encoded><![CDATA[<table class="lifestream">
<tr class="lifestream_feedid_11 lifestream_feed_youtube">
<td class="lifestream_icon">
			   <a href="http://www.youtube.com/watch?v=bDFqNqTOOPc&amp;feature=youtube_gdata"><img src="http://blog.thelsdj.org/wp-content/plugins/lifestream/extensions/youtube/icon.png" alt="youtube (feed #11)" /></a>
		   </td>
<td class="lifestream_text">
<div class="lifestream_label">Liked <a href="http://www.youtube.com/watch?v=bDFqNqTOOPc&amp;feature=youtube_gdata">Life Is Beautiful &#8211; Deadly Premonition (Nivi cover)</a>.</div>
<div class="lifestream_events">
			<a class="photo" title="Life Is Beautiful - Deadly Premonition (Nivi cover)" rel="ibox" href="http://www.youtube.com/watch?v=bDFqNqTOOPc&amp;feature=youtube_gdata"><img src="http://i.ytimg.com/vi/bDFqNqTOOPc/default.jpg" alt="" width="50" /></a>	</div>
</td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://blog.thelsdj.org/2012/05/15/daily-digest-for-may-15th-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Daily Digest for May 14th</title>
		<link>http://blog.thelsdj.org/2012/05/14/daily-digest-for-may-14th-3/</link>
		<comments>http://blog.thelsdj.org/2012/05/14/daily-digest-for-may-14th-3/#comments</comments>
		<pubDate>Tue, 15 May 2012 06:25:37 +0000</pubDate>
		<dc:creator>thelsdj</dc:creator>
				<category><![CDATA[Meta]]></category>

		<guid isPermaLink="false">http://blog.thelsdj.org/2012/05/14/daily-digest-for-may-14th-3/</guid>
		<description><![CDATA[Liked New JJ Abrams show looks awesome: Revolution. Liked 2 videos.]]></description>
			<content:encoded><![CDATA[<table class="lifestream">
<tr class="lifestream_feedid_16 lifestream_feed_reddit">
<td class="lifestream_icon">
			   <a href="http://www.reddit.com/r/videos/comments/tlkv1/new_jj_abrams_show_looks_awesome_revolution/"><img src="http://blog.thelsdj.org/wp-content/plugins/lifestream/extensions/reddit/icon.png" alt="reddit (feed #16)" /></a>
		   </td>
<td class="lifestream_text">
<div class="lifestream_label">Liked <a href="http://www.reddit.com/r/videos/comments/tlkv1/new_jj_abrams_show_looks_awesome_revolution/">New JJ Abrams show looks awesome: Revolution</a>.</div>
</td>
</tr>
<tr class="lifestream_feedid_11 lifestream_feed_youtube">
<td class="lifestream_icon">
			   <a href="http://www.youtube.com/user/thelsdj"><img src="http://blog.thelsdj.org/wp-content/plugins/lifestream/extensions/youtube/icon.png" alt="youtube (feed #11)" /></a>
		   </td>
<td class="lifestream_text">
<div class="lifestream_label">Liked <a href="void(0);">2</a> videos.</div>
<div class="lifestream_events">
			<a class="photo" title="WTF Came In The Mail? Errata Edition" rel="ibox" href="http://www.youtube.com/watch?v=AyNj-cIBRWs&amp;feature=youtube_gdata"><img src="http://i.ytimg.com/vi/AyNj-cIBRWs/default.jpg" alt="" width="50" /></a>			<a class="photo" title="WTF Came In The Mail? SERENITY?!?!" rel="ibox" href="http://www.youtube.com/watch?v=sxqbT5JuUEc&amp;feature=youtube_gdata"><img src="http://i.ytimg.com/vi/sxqbT5JuUEc/default.jpg" alt="" width="50" /></a>	</div>
</td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://blog.thelsdj.org/2012/05/14/daily-digest-for-may-14th-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Daily Digest for May 13th</title>
		<link>http://blog.thelsdj.org/2012/05/13/daily-digest-for-may-13th/</link>
		<comments>http://blog.thelsdj.org/2012/05/13/daily-digest-for-may-13th/#comments</comments>
		<pubDate>Mon, 14 May 2012 06:34:29 +0000</pubDate>
		<dc:creator>thelsdj</dc:creator>
				<category><![CDATA[Meta]]></category>

		<guid isPermaLink="false">http://blog.thelsdj.org/2012/05/13/daily-digest-for-may-13th/</guid>
		<description><![CDATA[Liked WTF Came In The Mail? Why do you keep watching these?.]]></description>
			<content:encoded><![CDATA[<table class="lifestream">
<tr class="lifestream_feedid_11 lifestream_feed_youtube">
<td class="lifestream_icon">
			   <a href="http://www.youtube.com/watch?v=EV9ZIghUvAU&amp;feature=youtube_gdata"><img src="http://blog.thelsdj.org/wp-content/plugins/lifestream/extensions/youtube/icon.png" alt="youtube (feed #11)" /></a>
		   </td>
<td class="lifestream_text">
<div class="lifestream_label">Liked <a href="http://www.youtube.com/watch?v=EV9ZIghUvAU&amp;feature=youtube_gdata">WTF Came In The Mail? Why do you keep watching these?</a>.</div>
<div class="lifestream_events">
			<a class="photo" title="WTF Came In The Mail? Why do you keep watching these?" rel="ibox" href="http://www.youtube.com/watch?v=EV9ZIghUvAU&amp;feature=youtube_gdata"><img src="http://i.ytimg.com/vi/EV9ZIghUvAU/default.jpg" alt="" width="50" /></a>	</div>
</td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://blog.thelsdj.org/2012/05/13/daily-digest-for-may-13th/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Daily Digest for May 12th</title>
		<link>http://blog.thelsdj.org/2012/05/12/daily-digest-for-may-12th-2/</link>
		<comments>http://blog.thelsdj.org/2012/05/12/daily-digest-for-may-12th-2/#comments</comments>
		<pubDate>Sun, 13 May 2012 06:26:42 +0000</pubDate>
		<dc:creator>thelsdj</dc:creator>
				<category><![CDATA[Meta]]></category>

		<guid isPermaLink="false">http://blog.thelsdj.org/2012/05/12/daily-digest-for-may-12th-2/</guid>
		<description><![CDATA[Posted a comment.]]></description>
			<content:encoded><![CDATA[<table class="lifestream">
<tr class="lifestream_feedid_16 lifestream_feed_reddit">
<td class="lifestream_icon">
			   <a href="http://www.reddit.com/r/Assistance/comments/thqly/please_help_me_share_my_video_im_buying_a_home/c4n09ii"><img src="http://blog.thelsdj.org/wp-content/plugins/lifestream/extensions/reddit/icon.png" alt="reddit (feed #16)" /></a>
		   </td>
<td class="lifestream_text">
<div class="lifestream_label">Posted a comment.</div>
</td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://blog.thelsdj.org/2012/05/12/daily-digest-for-may-12th-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Daily Digest for May 11th</title>
		<link>http://blog.thelsdj.org/2012/05/11/daily-digest-for-may-11th-2/</link>
		<comments>http://blog.thelsdj.org/2012/05/11/daily-digest-for-may-11th-2/#comments</comments>
		<pubDate>Sat, 12 May 2012 06:24:48 +0000</pubDate>
		<dc:creator>thelsdj</dc:creator>
				<category><![CDATA[Meta]]></category>

		<guid isPermaLink="false">http://blog.thelsdj.org/2012/05/11/daily-digest-for-may-11th-2/</guid>
		<description><![CDATA[Liked WTF Came In The Mail? I&#8217;m still not sure how many artichokes came in the box. Liked Will and Norm Visit the Reed Research Reactor. Posted a comment. Liked WTF Came In The Mail? Mailbag Edition.]]></description>
			<content:encoded><![CDATA[<table class="lifestream">
<tr class="lifestream_feedid_11 lifestream_feed_youtube">
<td class="lifestream_icon">
			   <a href="http://www.youtube.com/watch?v=4AReRJKVOpo&amp;feature=youtube_gdata"><img src="http://blog.thelsdj.org/wp-content/plugins/lifestream/extensions/youtube/icon.png" alt="youtube (feed #11)" /></a>
		   </td>
<td class="lifestream_text">
<div class="lifestream_label">Liked <a href="http://www.youtube.com/watch?v=4AReRJKVOpo&amp;feature=youtube_gdata">WTF Came In The Mail? I&#8217;m still not sure how many artichokes came in the box</a>.</div>
<div class="lifestream_events">
			<a class="photo" title="WTF Came In The Mail? I'm still not sure how many artichokes came in the box" rel="ibox" href="http://www.youtube.com/watch?v=4AReRJKVOpo&amp;feature=youtube_gdata"><img src="http://i.ytimg.com/vi/4AReRJKVOpo/default.jpg" alt="" width="50" /></a>	</div>
</td>
</tr>
<tr class="lifestream_feedid_11 lifestream_feed_youtube">
<td class="lifestream_icon">
			   <a href="http://www.youtube.com/watch?v=dVdxN7793-I&amp;feature=youtube_gdata"><img src="http://blog.thelsdj.org/wp-content/plugins/lifestream/extensions/youtube/icon.png" alt="youtube (feed #11)" /></a>
		   </td>
<td class="lifestream_text">
<div class="lifestream_label">Liked <a href="http://www.youtube.com/watch?v=dVdxN7793-I&amp;feature=youtube_gdata">Will and Norm Visit the Reed Research Reactor</a>.</div>
<div class="lifestream_events">
			<a class="photo" title="Will and Norm Visit the Reed Research Reactor" rel="ibox" href="http://www.youtube.com/watch?v=dVdxN7793-I&amp;feature=youtube_gdata"><img src="http://i.ytimg.com/vi/dVdxN7793-I/default.jpg" alt="" width="50" /></a>	</div>
</td>
</tr>
<tr class="lifestream_feedid_16 lifestream_feed_reddit">
<td class="lifestream_icon">
			   <a href="http://www.reddit.com/r/Games/comments/thfo2/so_i_got_minecraft_for_the_xbox/c4mr0y6"><img src="http://blog.thelsdj.org/wp-content/plugins/lifestream/extensions/reddit/icon.png" alt="reddit (feed #16)" /></a>
		   </td>
<td class="lifestream_text">
<div class="lifestream_label">Posted a comment.</div>
</td>
</tr>
<tr class="lifestream_feedid_11 lifestream_feed_youtube">
<td class="lifestream_icon">
			   <a href="http://www.youtube.com/watch?v=Vic-CkWVO5U&amp;feature=youtube_gdata"><img src="http://blog.thelsdj.org/wp-content/plugins/lifestream/extensions/youtube/icon.png" alt="youtube (feed #11)" /></a>
		   </td>
<td class="lifestream_text">
<div class="lifestream_label">Liked <a href="http://www.youtube.com/watch?v=Vic-CkWVO5U&amp;feature=youtube_gdata">WTF Came In The Mail? Mailbag Edition</a>.</div>
<div class="lifestream_events">
			<a class="photo" title="WTF Came In The Mail? Mailbag Edition" rel="ibox" href="http://www.youtube.com/watch?v=Vic-CkWVO5U&amp;feature=youtube_gdata"><img src="http://i.ytimg.com/vi/Vic-CkWVO5U/default.jpg" alt="" width="50" /></a>	</div>
</td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://blog.thelsdj.org/2012/05/11/daily-digest-for-may-11th-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Daily Digest for May 10th</title>
		<link>http://blog.thelsdj.org/2012/05/10/daily-digest-for-may-10th-2/</link>
		<comments>http://blog.thelsdj.org/2012/05/10/daily-digest-for-may-10th-2/#comments</comments>
		<pubDate>Fri, 11 May 2012 06:24:46 +0000</pubDate>
		<dc:creator>thelsdj</dc:creator>
				<category><![CDATA[Meta]]></category>

		<guid isPermaLink="false">http://blog.thelsdj.org/2012/05/10/daily-digest-for-may-10th-2/</guid>
		<description><![CDATA[Liked WTF Came In The Mail? Now look at your mail. Now back to me!. Posted a comment. Posted a comment. Posted a comment.]]></description>
			<content:encoded><![CDATA[<table class="lifestream">
<tr class="lifestream_feedid_11 lifestream_feed_youtube">
<td class="lifestream_icon">
			   <a href="http://www.youtube.com/watch?v=ZgtEMRl_xY4&amp;feature=youtube_gdata"><img src="http://blog.thelsdj.org/wp-content/plugins/lifestream/extensions/youtube/icon.png" alt="youtube (feed #11)" /></a>
		   </td>
<td class="lifestream_text">
<div class="lifestream_label">Liked <a href="http://www.youtube.com/watch?v=ZgtEMRl_xY4&amp;feature=youtube_gdata">WTF Came In The Mail? Now look at your mail. Now back to me!</a>.</div>
<div class="lifestream_events">
			<a class="photo" title="WTF Came In The Mail? Now look at your mail. Now back to me!" rel="ibox" href="http://www.youtube.com/watch?v=ZgtEMRl_xY4&amp;feature=youtube_gdata"><img src="http://i.ytimg.com/vi/ZgtEMRl_xY4/default.jpg" alt="" width="50" /></a>	</div>
</td>
</tr>
<tr class="lifestream_feedid_16 lifestream_feed_reddit">
<td class="lifestream_icon">
			   <a href="http://www.reddit.com/r/programming/comments/tfhzq/beyond_hello_world_upgrading_the_canonical/c4mbpcn"><img src="http://blog.thelsdj.org/wp-content/plugins/lifestream/extensions/reddit/icon.png" alt="reddit (feed #16)" /></a>
		   </td>
<td class="lifestream_text">
<div class="lifestream_label">Posted a comment.</div>
</td>
</tr>
<tr class="lifestream_feedid_16 lifestream_feed_reddit">
<td class="lifestream_icon">
			   <a href="http://www.reddit.com/r/SFstories/comments/tfqas/please_help_me_understand_ted_chiangs_division_by/c4mc83p"><img src="http://blog.thelsdj.org/wp-content/plugins/lifestream/extensions/reddit/icon.png" alt="reddit (feed #16)" /></a>
		   </td>
<td class="lifestream_text">
<div class="lifestream_label">Posted a comment.</div>
</td>
</tr>
<tr class="lifestream_feedid_16 lifestream_feed_reddit">
<td class="lifestream_icon">
			   <a href="http://www.reddit.com/r/SFstories/comments/tfqas/please_help_me_understand_ted_chiangs_division_by/c4mca14"><img src="http://blog.thelsdj.org/wp-content/plugins/lifestream/extensions/reddit/icon.png" alt="reddit (feed #16)" /></a>
		   </td>
<td class="lifestream_text">
<div class="lifestream_label">Posted a comment.</div>
</td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://blog.thelsdj.org/2012/05/10/daily-digest-for-may-10th-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Daily Digest for May 8th</title>
		<link>http://blog.thelsdj.org/2012/05/08/daily-digest-for-may-8th-2/</link>
		<comments>http://blog.thelsdj.org/2012/05/08/daily-digest-for-may-8th-2/#comments</comments>
		<pubDate>Wed, 09 May 2012 06:24:53 +0000</pubDate>
		<dc:creator>thelsdj</dc:creator>
				<category><![CDATA[Meta]]></category>

		<guid isPermaLink="false">http://blog.thelsdj.org/2012/05/08/daily-digest-for-may-8th-2/</guid>
		<description><![CDATA[Liked WTF Came In The Mail? I&#8217;ve got a job, thanks..]]></description>
			<content:encoded><![CDATA[<table class="lifestream">
<tr class="lifestream_feedid_11 lifestream_feed_youtube">
<td class="lifestream_icon">
			   <a href="http://www.youtube.com/watch?v=RuILfFLo5p8&amp;feature=youtube_gdata"><img src="http://blog.thelsdj.org/wp-content/plugins/lifestream/extensions/youtube/icon.png" alt="youtube (feed #11)" /></a>
		   </td>
<td class="lifestream_text">
<div class="lifestream_label">Liked <a href="http://www.youtube.com/watch?v=RuILfFLo5p8&amp;feature=youtube_gdata">WTF Came In The Mail? I&#8217;ve got a job, thanks.</a>.</div>
<div class="lifestream_events">
			<a class="photo" title="WTF Came In The Mail? I've got a job, thanks." rel="ibox" href="http://www.youtube.com/watch?v=RuILfFLo5p8&amp;feature=youtube_gdata"><img src="http://i.ytimg.com/vi/RuILfFLo5p8/default.jpg" alt="" width="50" /></a>	</div>
</td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://blog.thelsdj.org/2012/05/08/daily-digest-for-may-8th-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fix KISSmetrics Revenue Statistics</title>
		<link>http://blog.thelsdj.org/2012/05/07/fix-kissmetrics-revenue-statistics/</link>
		<comments>http://blog.thelsdj.org/2012/05/07/fix-kissmetrics-revenue-statistics/#comments</comments>
		<pubDate>Mon, 07 May 2012 23:33:58 +0000</pubDate>
		<dc:creator>thelsdj</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.thelsdj.org/?p=8078</guid>
		<description><![CDATA[So your KISSmetrics revenue data is messed up. How did you get here? For me, I didn&#8217;t realize that it is tracked on an property basis, so I had multiple events using the same property, one of which was my revenue event, while the other was not a revenue event, but shared the same revenue [...]]]></description>
			<content:encoded><![CDATA[<p>So your KISSmetrics revenue data is messed up. How did you get here? For me, I didn&#8217;t realize that it is tracked on an property basis, so I had multiple events using the same property, one of which was my revenue event, while the other was <em>not</em> a revenue event, but shared the same revenue property name</p>
<p>(The following examples show the JSON representation of KISSmetrics events)<br />
<code>{"_n": "revenue event", "amount": "10", "_p": "user@example.org", "_t":1333266186}<br />
{"_n": "NOT a revenue event", "amount": "10", "_p": "user@example.org", "_t":1333266186}</code></p>
<p>The thing to note is that even though only the first line should be considered a revenue event, KISSmetrics only takes the &#8220;amount&#8221; property into consideration and assumes the second line is also a revenue related event. This is kinda stupid and non-intuitive, and I don&#8217;t think it was clear in the documentation.</p>
<p>This caused KISSmetrics to report revenue at more than double the actual amount. We didn&#8217;t realize the data was so wrong for over a month, so rather than just deleting all the data and start over, I investigated (wrote KISSmetrics support) how to fix this without losing all our historic data.</p>
<p>The trick for how to fix this is to realize that to get rid of all the bad data we can change the names of the events and properties and tell KISSmetrics to start considering the new event/property names for tracking revenue.</p>
<p>The first step is to modify our code that generates our real revenue event to use different event and property names. So now our revenue event looks like this:</p>
<p><code>{"_n": "revenue event new", "amount new": "10", "_p": "user@example.org", "_t":1333266186}</code></p>
<p>We can just leave the non revenue event alone.</p>
<p>Once you are submitting data to KISSmetrics using <em>only</em> these new names for your real revenue event, you can go into KISSmetrics settings to change the revenue tracking event and property. Here are the steps for doing this:</p>
<ol>
<li>Click &#8216;Metrics&#8217;</li>
<li>Click on one of the &#8216;Revenue&#8217; related metric.</li>
<li>Click &#8216;Edit metric details&#8217;</li>
<li>Change the &#8216;Property&#8217; drop down to &#8216;amount new&#8217; (for the example above, or whatever the new revenue property is.)</li>
<li>Click &#8216;Save metric&#8217;.</li>
</ol>
<p>Repeat the above for any other metrics that track revenue related events.</p>
<p>We also need to change the revenue event:</p>
<ol>
<li>Click the Settings &#8220;gear&#8221; in the top menu.</li>
<li>Under &#8216;Event Library&#8217; click &#8216;set mappings&#8217;.</li>
<li>Click on the &#8216;Purchased&#8217; mapping.</li>
<li>Change the drop down to &#8216;Revenue event new&#8217; (for the above example, or whatever the name of your new revenue event is.)</li>
<li>Click &#8216;Save changes&#8217;.</li>
<li>This will prompt you to update the funnels that use this event, check all the boxes and click &#8216;Save changes&#8217; again.</li>
</ol>
<p>Repeated the above for the &#8216;Revenue&#8217; mapping. Changing it to the &#8216;amount new&#8217; event.</p>
<p>So now we have KISSmetrics using the new data, but we&#8217;ve lost all our historic data. To get that back we need to:</p>
<ol>
<li>Export the old data.</li>
<li>Filter out just the old revenue event.</li>
<li>Rewrite it to use the new revenue event name and property.</li>
<li>Import the altered data to give us our historic revenue data back.</li>
</ol>
<p>To export your data from KISSmetrics you need an Amazon Web Services account. I will assume you have one and know how to use it to create S3 buckets and download data from them.</p>
<p>To configure KISSmetrics to use your AWS account, follow <a href="http://support.kissmetrics.com/apis/data/data-export-setup">these</a> instructions.</p>
<p>Then you wait for KISSmetrics to finish exporting your data. I had less than 2 months of data and it took maybe an hour for it to all show up in my AWS bucket. I then used <a href="http://s3tools.org/s3cmd">s3cmd</a> to download the contents of the bucket to my development machine.</p>
<p>At this point you have a ton of options for how you want to process the data. I&#8217;m currently taking an online course (<a href="http://nathansuniversity.com/">PL101: Create Your Own Programming Language</a>) that uses Javascript/Node.js so I am going to do this with Node.js.</p>
<p>I used the following script to find my revenue events and convert them to use the new event and property names:</p>
<pre>
var fs = require('fs');

var eventNameOld = "revenue event";
var eventNameNew = "revenue event new";
var propertyNameOld = "amount";
var propertyNameNew = "amount new";

var processEvent = function(event) {
    if (event._n === eventNameOld) {
        event._n = eventNameNew;
        // _d = 1 is specified to make KISSmetrics use the existing _t timestamp
        // instead of using the time the server received this event
        event._d = 1;
        event[propertyNameNew] = event[propertyNameOld];
        delete event[propertyNameOld];

        console.log(JSON.stringify(event));
    }
}

var processLine = function(line, index, array) {
    // JSON doesn't like trying to parse an empty line, understandable
    if (line.length === 0) { return; }
    // KISSmetrics has some data that fails to parse, especially in referral strings
    // For my purposes I'm assuming these failed lines are not revenue events
    // but you should examine the output of STDERR to see if you need any of these lines
    try {
        processEvent(JSON.parse(line));
    } catch(error) {
        console.warn("Got error parsing: " + line + " Error: " + error);
    }
}

process.argv.slice(2).forEach(function (val, index, array) {
    var fileContents = fs.readFileSync(val, 'utf-8');
    var lines = fileContents.split('\n');
    lines.forEach(processLine);
});
</pre>
<p>And I run it like so: <code>node convert-revenue.js 2012/*/*.json > revenue-events.json</code></p>
<p>Now I want to take the contents of revenue-events.json and import it back into KISSmetrics. I used the following script:</p>
<pre>
var fs = require('fs');
var https = require('https');

var kissMetricsAPIKey = "YOUR API KEY GOES HERE";

var createRequest = function(str) {
    return options = {
        host: "trk.kissmetrics.com",
        path: "/e?" + str + "&#038;_k=" + kissMetricsAPIKey
    };
}

var serialize = function(obj) {
    var properties = [];
    for (var p in obj) {
        properties.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
    }
    return properties.join("&#038;");
}

var processEvent = function(event) {
    return createRequest(serialize(event));
}

var processLine = function(line) {
    // JSON doesn't like trying to parse an empty line, understandable
    if (line.length === 0) { return; }
    // KISSmetrics has some data that fails to parse, especially in referral strings
    // For my purposes I'm assuming these failed lines are not revenue events
    // but you should examine the output of STDERR to see if you need any of these lines
    try {
        return processEvent(JSON.parse(line));
    } catch(error) {
        console.warn("Got error parsing: " + line + " Error: " + error);
    }
}

process.argv.slice(2).forEach(function (val, index, array) {
    var fileContents = fs.readFileSync(val, 'utf-8');
    var lines = fileContents.split('\n');
    var requests = [];
    for (var i = 0; i < lines.length; i++) {
       if (lines[i] != "") {
           requests.push(processLine(lines[i]));
       }
    }

    var go = function() {
        if (requests.length > 0) {
            var request = requests.pop();
            https.get(request, function(res) {
                if (res.statusCode != 200) {
                    console.error("Got status: " + res.statusCode + " retrying.");
                    requests.push(request);
                }
                res.on('end', function() {
                    console.log("Finished request: " + request.path);
                    go();
                });
            }).on('error', function(e) {
                console.error("Got error " + e + " for request: " + request.path + " retrying.");
                requests.push(request);
                go();
            });
        } else {
            console.log("All done.");
        }
    };
    go();
});
</pre>
<p>Run it with <code>node import-kissmetrics.js revenue-events.json</code></p>
<p>It took me a while to come up with the <code>go</code> method which allowed me to serialize the http requests so I wasn&#8217;t overloading KISSmetric. Also, I&#8217;m assuming the retry logic works, but I haven&#8217;t had any errors submitting data yet so this is untested.</p>
<p>So far it looks like the issue is fixed. It took me a few days to work out all the places where the old property and event were used. Once I had all of them using the new names, the data fell in line.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.thelsdj.org/2012/05/07/fix-kissmetrics-revenue-statistics/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Daily Digest for May 2nd</title>
		<link>http://blog.thelsdj.org/2012/05/02/daily-digest-for-may-2nd-2/</link>
		<comments>http://blog.thelsdj.org/2012/05/02/daily-digest-for-may-2nd-2/#comments</comments>
		<pubDate>Thu, 03 May 2012 06:32:20 +0000</pubDate>
		<dc:creator>thelsdj</dc:creator>
				<category><![CDATA[Meta]]></category>

		<guid isPermaLink="false">http://blog.thelsdj.org/2012/05/02/daily-digest-for-may-2nd-2/</guid>
		<description><![CDATA[Posted a comment. Posted a comment. Posted a comment. Posted a comment.]]></description>
			<content:encoded><![CDATA[<table class="lifestream">
<tr class="lifestream_feedid_16 lifestream_feed_reddit">
<td class="lifestream_icon">
			   <a href="http://www.reddit.com/r/Games/comments/t1qxu/were_a_romanian_team_and_we_have_developed_the/c4j3j3e"><img src="http://blog.thelsdj.org/wp-content/plugins/lifestream/extensions/reddit/icon.png" alt="reddit (feed #16)" /></a>
		   </td>
<td class="lifestream_text">
<div class="lifestream_label">Posted a comment.</div>
</td>
</tr>
<tr class="lifestream_feedid_16 lifestream_feed_reddit">
<td class="lifestream_icon">
			   <a href="http://www.reddit.com/r/printSF/comments/t2mj8/im_an_sf_fan_i_love_space_opera_as_well_as_hard/c4j4ron"><img src="http://blog.thelsdj.org/wp-content/plugins/lifestream/extensions/reddit/icon.png" alt="reddit (feed #16)" /></a>
		   </td>
<td class="lifestream_text">
<div class="lifestream_label">Posted a comment.</div>
</td>
</tr>
<tr class="lifestream_feedid_16 lifestream_feed_reddit">
<td class="lifestream_icon">
			   <a href="http://www.reddit.com/r/printSF/comments/t2mj8/im_an_sf_fan_i_love_space_opera_as_well_as_hard/c4j9wch"><img src="http://blog.thelsdj.org/wp-content/plugins/lifestream/extensions/reddit/icon.png" alt="reddit (feed #16)" /></a>
		   </td>
<td class="lifestream_text">
<div class="lifestream_label">Posted a comment.</div>
</td>
</tr>
<tr class="lifestream_feedid_16 lifestream_feed_reddit">
<td class="lifestream_icon">
			   <a href="http://www.reddit.com/r/printSF/comments/t2mj8/im_an_sf_fan_i_love_space_opera_as_well_as_hard/c4jb1z2"><img src="http://blog.thelsdj.org/wp-content/plugins/lifestream/extensions/reddit/icon.png" alt="reddit (feed #16)" /></a>
		   </td>
<td class="lifestream_text">
<div class="lifestream_label">Posted a comment.</div>
</td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://blog.thelsdj.org/2012/05/02/daily-digest-for-may-2nd-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.421 seconds -->
<!-- Cached page served by WP-Cache -->

