<?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>David Simpson &#187; webtrends</title>
	<atom:link href="http://davidsimpson.me/tag/webtrends/feed/" rel="self" type="application/rss+xml" />
	<link>http://davidsimpson.me</link>
	<description>Developing the web, one page at a time.</description>
	<lastBuildDate>Thu, 02 Feb 2012 13:02:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>A simple Webtrends event tracking tip</title>
		<link>http://davidsimpson.me/2011/11/04/a-simple-webtrends-event-tracking-tip/</link>
		<comments>http://davidsimpson.me/2011/11/04/a-simple-webtrends-event-tracking-tip/#comments</comments>
		<pubDate>Fri, 04 Nov 2011 14:50:31 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[analytics]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[webtrends]]></category>

		<guid isPermaLink="false">http://davidsimpson.me/?p=1220</guid>
		<description><![CDATA[In Webtrends, events that happens after the page loads can be tracked using dcsMultiTrack. This takes the following form: dcsMultiTrack( key1, value1, key2, value2, key3, value3, ... ); But what if you don&#8217;t know how many key/value pairs you&#8217;ll be sending into dcsMultiTrack? How do you call it then? Take advantage of the JavaScript apply [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton1220" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fdavidsimpson.me%2F2011%2F11%2F04%2Fa-simple-webtrends-event-tracking-tip%2F&amp;via=dvdsmpsn&amp;text=A%20simple%20Webtrends%20event%20tracking%20tip&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fdavidsimpson.me%2F2011%2F11%2F04%2Fa-simple-webtrends-event-tracking-tip%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://davidsimpson.me/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;"></a></div><p>In Webtrends,  events that happens after the page loads can be tracked using <b><a href="https://tagbuilder.webtrends.com/Help/EventTracking/DcsMultiTrack.aspx">dcsMultiTrack</a></b>.</p>
<p>This takes the following form:</p>
<pre class="brush: plain; title: ;">dcsMultiTrack( key1, value1, key2, value2, key3, value3, ... );</pre>
<p>But what if you don&#8217;t know how many key/value pairs you&#8217;ll be sending into <b>dcsMultiTrack</b>? How do you call it then? </p>
<p>Take advantage of the JavaScript <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/function/apply">apply</a> function.  Create an array of key/value pairs and then apply that array to the <b>dcsMultiTrack</b> function:</p>
<pre class="brush: plain; title: ;">
var webtrendsArgs = [
	'DCSext.w_event_type', 'Video Started',
	'DCSext.w_video_id', 'xxxx-yyyy-zzzz-1234',
	'DCSext.w_video_name', 'Kitten Video'
	];

dcsMultiTrack.apply(this, webtrendsArgs);
</pre>
<p>This is equivalent to:</p>
<pre class="brush: plain; title: ;">
dcsMultiTrack(
	'DCSext.w_event_type', 'Video Started',
	'DCSext.w_video_id', 'xxxx-yyyy-zzzz-1234',
	'DCSext.w_video_name', 'Kitten Video'
);
</pre>
<p>If needed, you can add the key/value pairs to <b>webtrendsArgs</b> array incrementally and when complete, apply this to <b>dcsMultiTrack</b> at the end.</p>
<p><cite>Source: <a href="http://stackoverflow.com/questions/6078103/webtrends-analytics-implementation-using-variables-in-an-async-tracking-call-p">StackOverflow</a></cite></p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://davidsimpson.me/2011/11/04/a-simple-webtrends-event-tracking-tip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Track Events in Flash Movies using WebTrends</title>
		<link>http://davidsimpson.me/2009/03/09/how-to-track-events-in-flash-movies-using-webtrends/</link>
		<comments>http://davidsimpson.me/2009/03/09/how-to-track-events-in-flash-movies-using-webtrends/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 17:07:26 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[analytics]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[google analytics]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[webtrends]]></category>

		<guid isPermaLink="false">http://davidsimpson.me/?p=106</guid>
		<description><![CDATA[If your website contains Flash movies that link offsite or to microsites, you may wish to register the offsite link using WebTrends. This article provides an introduction. It assumes a little knowledge of ActionScript, Javascript as well as WebTrends. This example uses a intermediary javascript function that sits between the Flash movies and the WebTrends [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton106" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fdavidsimpson.me%2F2009%2F03%2F09%2Fhow-to-track-events-in-flash-movies-using-webtrends%2F&amp;text=How%20To%20Track%20Events%20in%20Flash%20Movies%20using%20WebTrends&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fdavidsimpson.me%2F2009%2F03%2F09%2Fhow-to-track-events-in-flash-movies-using-webtrends%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://davidsimpson.me/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;"></a></div><p><!-- How To Track Events in Flash Movies using WebTrends --></p>
<p>If your website contains Flash movies that link offsite or to microsites, you may wish to register the offsite link using WebTrends.  This article provides an introduction.  It assumes a little knowledge of ActionScript, Javascript as well as WebTrends.</p>
<p>This example uses a intermediary javascript function that sits between the Flash movies and the WebTrends code.</p>
<h3>Benefits</h3>
<ul>
<li>It&#8217;s much easier to debug if the WebTrends javascript is not called within the compiled Flash movie</li>
<li>The WebTrends tracking can be changed later without recompiling the Flash movie or even speaking to your Flash developer</li>
</ul>
<p><span id="more-106"></span></p>
<h3>Drawbacks</h3>
<ul>
<li>Javascript must be enabled to trigger the link to the target web page</li>
<li>Both Flash <i>and</i> Javascript will be required to navigate your website</li>
</ul>
<p><b>This is bad from an accessibility point of view</b>, but I won&#8217;t discuss that here.</p>
<h2>ActionScript for Flash buttons</h2>
<p>Edit your Flash movies so that the button that links to your external website or microsite has an ActionScript event handler which will trigger a call to Javascript.</p>
<h3>Older ActionScript versions</h3>
<pre class="brush: plain; title: ;">on (release)
{
	getURL(&quot;javascript:myFlashEvent('Open Days','http://www.nottingham.ac.uk/opendays');&quot;);
}</pre>
<h3>ActionScript 3+</h3>
<p>The <code>getURL</code> function was removed in ActionScript 3, so a slightly more complex example is required</p>
<pre class="brush: plain; title: ;">if (ExternalInterface.available)
{
	try
	{
		ExternalInterface.call(
			'myFlashEvent',                        // function name
			'Open Days',                           // function parameter 1
			'http://www.nottingham.ac.uk/opendays' // function parameter 2
		);
	}
	catch (error:Error)
	{
		// Error handling here
	}
	catch (error:SecurityError)
	{
		// Error handling here
	}
}</pre>
<p>The ActionScript calls the Javascript intermediary function <code>myFlashEvent</code>, which in turn registers the event with WebTrends and then loads the new web page.</p>
<h2>Javascript</h2>
<pre class="brush: jscript; title: ;">function myFlashEvent(eventDescription, eventValue){

	// Register Event with WebTrends
	dcsMultiTrack(
		'DCS.dcsuri', eventValue,                  // name/value pair for URL
		'WT.ti', 'FlashEvent:' + eventDescription  // name/value pair for page title
	);

	// Go to URL
	document.location.href = eventValue;
}</pre>
<p>This function will track the event as a visit to a URI using the <code>DCS.dcsuri</code> parameter.  The page title for the URI will be set to e.g. &#8216;FlashEvent:My Page Title&#8217; using the <code>WT.ti</code> parameter.</p>
<h2>Results</h2>
<p>The click event is showing up nicely in WebTrends as <code>FlashEvent:Open Days</code>, see the screenshot below</p>
<p><img class="hang-1-column" src="http://www.nottingham.ac.uk/~cczdas/images/webtrends-flash-event.png" alt="Screenshot of WebTrends Console" /></p>
<h2>Example code</h2>
<p>A working example of this code can be found <a href="http://www.nottingham.ac.uk/analytics-events/analytics-events/">here</a>.  </p>
<p>Sorry, I don&#8217;t have access to the .fla file, so that is not included.</p>
<h2>Adapting the Javascript for Google Analytics</h2>
<p>The <code>myFlashEvent</code> function can easily be adapted to work with Google Analytics instead:</p>
<pre class="brush: jscript; title: ;">function myFlashEvent(eventDescription, eventValue){

	// Register event
	pageTracker._trackEvent(
		'Flash', 'Link',
		eventDescription, eventValue
	);

	// Go to URL
	document.location.href = eventValue;
}</pre>
<h2>Reference</h2>
<ul>
<li><a href="http://www.arena.no/dokumentasjon/wt85/dcsMultiTrack.pdf">Tracking Complex Web Page Interactions Using dcsMultiTrack (WebTrends)</a></li>
<li><a href="http://blog.webtrends.com/2009/03/09/tracking-visitors-in-a-rich-media-world-part-i-tracking/">Tracking Visitors in a Rich Media World, Part I: Tracking</a></li>
<li><a href="http://code.google.com/apis/analytics/docs/eventTrackerGuide.html">Event Tracking Guide (Google Analytics)</a></li>
<li><strong>Update:</strong> Here&#8217;s a really elegant solution to adding <a href="http://www.embeddedstream.com/2009/02/27/webtrends-tracking-from-flash/">Webtrends tracking to Flash</a> movies</li>
<li><strong>Update:</strong> <a href="http://www.insideria.com/2009/02/using-google-analytics-within.html">Google Analytics within Flex/Flash Applications</a</li>
</ul>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://davidsimpson.me/2009/03/09/how-to-track-events-in-flash-movies-using-webtrends/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

