Forum Moderators: DixonJones

Message Too Old, No Replies

How to setup a Goal for Dynamic pages

.. the logic

         

getxb

8:08 pm on Dec 10, 2007 (gmt 0)

10+ Year Member



I have a thank you page (in my weblog) where I display two types of content:

Content i. Thanks for downloading the ebook.
Content ii. Oops! You have entered a wrong pin. Please recheck your mail as we redirect you to the home page.

My goal is to track how many visitors are downloading the ebook only (or viewing Content i). The criteria one has to fulfill to download is to enter a correct pin (prior to the thank you page).

To track the downloads I am using this code in the thank you page:

{capture name=mycontent}{$content}{/capture}

{if $smarty.capture.mycontent == 'Thanks for downloading the ebook.'}

<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
<script type="text/javascript">
_uacct = "UA-000000-1";
urchinTracker("/downloaded.html");
</script>

{else}

<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
<script type="text/javascript">
_uacct = "UA-000000-1";
urchinTracker();
</script>

{/if}

I want Google Analytics to create a virtual pageview of downloaded.html so that just looking at the stats for this particular page I can safely know the number of downloads. (So in reality I haven't set up any goals. Of course I can create one with the goal url set to downloaded.html)

Can anyone kindly confirm if I am in the right track (OR I am terribly wrong). I am looking forward to the logic I am using rather than the wordpress/smarty code snippets.

Regards,
getxb

getxb

6:52 am on Dec 12, 2007 (gmt 0)

10+ Year Member



Any thoughts please? Thanks in advance.