diff options
author | matt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2008-12-26 16:50:57 +0300 |
---|---|---|
committer | matt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2008-12-26 16:50:57 +0300 |
commit | 446fd843abd0640403c30a763493a8fb1d821160 (patch) | |
tree | 65ebec570ef05ae3f3d84e14a3e4cd7ab6b128ea /plugins/Goals/templates | |
parent | 35d668736cc7596e9f48ac050ce685a45296cbb6 (diff) |
- cacheFile is now creating the directory if not already created
- adding log_conversion table, and goal table in 0.2.27
- adding case sensitive/case insensitive matching
- when goal plugin is disabled, conversions are not being recorded
- adding release notes in the Goal tab to let users know that this is alpha release
Diffstat (limited to 'plugins/Goals/templates')
-rw-r--r-- | plugins/Goals/templates/GoalForm.js | 41 | ||||
-rw-r--r-- | plugins/Goals/templates/add_edit_goal.tpl | 131 | ||||
-rw-r--r-- | plugins/Goals/templates/add_new_goal.tpl | 8 | ||||
-rw-r--r-- | plugins/Goals/templates/form_add_goal.tpl | 67 | ||||
-rw-r--r-- | plugins/Goals/templates/list_goal_edit.tpl | 22 | ||||
-rw-r--r-- | plugins/Goals/templates/overview.tpl | 7 | ||||
-rw-r--r-- | plugins/Goals/templates/release_notes.tpl | 20 | ||||
-rw-r--r-- | plugins/Goals/templates/single_goal.tpl | 4 | ||||
-rw-r--r-- | plugins/Goals/templates/title_and_evolution_graph.tpl | 1 |
9 files changed, 180 insertions, 121 deletions
diff --git a/plugins/Goals/templates/GoalForm.js b/plugins/Goals/templates/GoalForm.js index 27e250c5ca..4345bc8958 100644 --- a/plugins/Goals/templates/GoalForm.js +++ b/plugins/Goals/templates/GoalForm.js @@ -3,7 +3,7 @@ function showAddNewGoal() { $("#GoalForm").show(); $("#EditGoals").hide(); - lazyScrollTo("#bottom", 100); + $.scrollTo("#AddEditGoals", 400); return false; } @@ -11,12 +11,12 @@ function showEditGoals() { $("#EditGoals").show(); $("#GoalForm").hide(); - lazyScrollTo("#bottom", 100); + $.scrollTo("#AddEditGoals", 400); return false; } // init the goal form with existing goal value, if any -function initGoalForm(goalMethodAPI, submitText, goalName, matchAttribute, pattern, patternType, revenue, goalId) +function initGoalForm(goalMethodAPI, submitText, goalName, matchAttribute, pattern, patternType, caseSensitive, revenue, goalId) { $('#goal_name').val(goalName); $('input[@name=match_attribute][value='+matchAttribute+']').attr('checked', true); @@ -24,6 +24,7 @@ function initGoalForm(goalMethodAPI, submitText, goalName, matchAttribute, patte $('#examples_pattern').html(mappingMatchTypeExamples[matchAttribute]); $('option[value='+patternType+']').attr('selected', true); $('input[name=pattern]').val(pattern); + $('#case_sensitive').attr('checked', caseSensitive); $('input[name=revenue]').val(revenue); $('input[name=methodGoalAPI]').val(goalMethodAPI); $('#goal_submit').val(submitText); @@ -32,6 +33,11 @@ function initGoalForm(goalMethodAPI, submitText, goalName, matchAttribute, patte } } +function initAndShowAddGoalForm() +{ + initGoalForm('Goals.addGoal', 'Add Goal', '', 'url', '', 'contains', false, '0'); + return showAddNewGoal(); +} function bindGoalForm() { $('input[@name=match_attribute]').click( function() { @@ -46,8 +52,36 @@ function bindGoalForm() $.ajax( ajaxRequestAddGoal ); return false; }); + + $('a[name=linkAddNewGoal]').click( function(){ + initAndShowAddGoalForm(); + } ); } +function bindListGoalEdit() +{ + $('a[name=linkEditGoal]').click( function() { + var goalId = $(this).attr('id'); + var goal = piwik.goals[goalId]; + initGoalForm("Goals.updateGoal", "Update Goal", goal.name, goal.match_attribute, goal.pattern, goal.pattern_type, (goal.case_sensitive=='0' ? false : true), goal.revenue, goalId); + showAddNewGoal(); + return false; + }); + + $('a[name=linkDeleteGoal]').click( function() { + var goalId = $(this).attr('id'); + var goalName = 'test goal';//piwik.goals[goalId][name] + if(confirm(sprintf('Are you sure you want to delete the Goal %s?','"'+goalName+'"'))) + { + $.ajax( getAjaxDeleteGoal( goalId ) ); + return false; + } + }); + + $('a[name=linkEditGoals]').click( function(){ + return showEditGoals(); + } ); +} function getAjaxDeleteGoal(idGoal) { var ajaxRequest = getStandardAjaxConf(); @@ -76,6 +110,7 @@ function getAjaxAddGoal() parameters.matchAttribute = $('input[name=match_attribute][checked]').val(); parameters.patternType = $('[name=pattern_type]').val(); parameters.pattern = encodeURIComponent( $('input[name=pattern]').val() ); + parameters.caseSensitive = $('#case_sensitive').attr('checked') == true ? 1: 0; parameters.revenue = $('input[name=revenue]').val(); parameters.idGoal = $('input[name=goalIdUpdate]').val(); diff --git a/plugins/Goals/templates/add_edit_goal.tpl b/plugins/Goals/templates/add_edit_goal.tpl index 1f0220bcf6..2ca55ca102 100644 --- a/plugins/Goals/templates/add_edit_goal.tpl +++ b/plugins/Goals/templates/add_edit_goal.tpl @@ -1,103 +1,29 @@ <div id="AddEditGoals"> +{if isset($onlyShowAddNewGoal)} + <h2>Add a new Goal</h2> +{else} + <h2><a onclick='' name="linkAddNewGoal">+ Add a new Goal</a> + or <a onclick='' name="linkEditGoals">Edit</a> existing Goals</h2> +{/if} - <h2><a href='#' name="linkAddNewGoal">+ Add a new Goal</a> - or <a href='#' name="linkEditGoals">Edit</a> existing Goals</h2> - - <script> - piwik.goals = {$goalsJSON}; - </script> - <div> <div id="ajaxError" style="display:none"></div> <div id="ajaxLoading" style="display:none"><div id="loadingPiwik"><img src="themes/default/images/loading-blue.gif" alt="" /> {'General_LoadingData'|translate}</div></div> </div> - <span id='EditGoals' style="display:none;"> - <table class="tableForm"> - <thead style="font-weight:bold"> - <td>Id</td> - <td>Goal Name</td> - <td>Goal is Triggered when</td> - <td>Revenue</td> - <td>Edit</td> - <td>Delete</td> - </thead> - {foreach from=$goals item=goal} - <tr> - <td>{$goal.idgoal}</td> - <td>{$goal.name}</td> - <td>{$goal.match_attribute} <br>Pattern {$goal.pattern_type}: {$goal.pattern}</b></td> - <td>{if $goal.revenue==0}-{else}{$currency}{$goal.revenue}{/if}</td> - <td><a href='#' name="linkEditGoal" id="{$goal.idgoal}"><img src='plugins/UsersManager/images/edit.png' border=0> Edit</a></td> - <td><a href='#' name="linkDeleteGoal" id="{$goal.idgoal}"><img src='plugins/UsersManager/images/remove.png' border=0> Delete</a></td> - </tr> - {/foreach} - </table> - </span> - - <span id='GoalForm' style="display:none;"> - <form> - <table class="tableForm"> - <tr> - <td>Goal Name </td> - <td><input type="text" name="name" value="" id="goal_name" /></td> - </tr> - <tr> - <td>Goal is triggered when visitors:</td> - <td> - <input type="radio" onclick="" checked="true" id="match_attribute_url" value="url" name="match_attribute"/> - <label for="match_attribute_url">Visit a given URL (page or group of pages)</label> - <br> - <input type="radio" onclick="" id="match_attribute_file" value="file" name="match_attribute"/> - <label for="match_attribute_file">Download a file</label> - <br> - <input type="radio" onclick="" id="match_attribute_external_website" value="external_website" name="match_attribute"/> - <label for="match_attribute_external_website">Click on a Link to an external website </label> - </td> - </tr> - <tr> - <td>where the <span id="match_attribute_name"></span></td> - <td> - <select name="pattern_type"> - <option value="contains">contains</option> - <option value="exact">is exactly</option> - <option value="regex">matches the expression</option> - </select> - - <input type="text" name="pattern" value=""/> - <br> - <div id="examples_pattern"></div> - </td> - </tr> - <tr> - <td>(optional) Goal default value is </td> - <td>{$currency} <input type="text" name="revenue" size="1" value="0"/></td> - </tr> - <tr> - <td colspan="2" style="border:0"> - <div class="submit"> - <input type="hidden" name="methodGoalAPI" value=""> - <input type="hidden" name="goalIdUpdate" value=""> - <input type="submit" value="Add Goal" name="submit" id="goal_submit" class="submit" /> - </div> - </td> - </tr> - </table> - </form> - </span> +{if !isset($onlyShowAddNewGoal)} + {include file="Goals/templates/list_goal_edit.tpl"} +{/if} + {include file="Goals/templates/form_add_goal.tpl"} <a id='bottom'></a> </div> {literal} -<style> -#examples_pattern { - color:#9B9B9B; -} -</style> <script type="text/javascript" src="plugins/Goals/templates/GoalForm.js"></script> <script language="javascript"> + var mappingMatchTypeName = { "url": "URL", "file": "filename", @@ -109,34 +35,15 @@ var mappingMatchTypeExamples = { "external_website": "eg. contains 'amazon.com'<br>eg. is exactly 'http://mypartner.com/landing.html'<br>eg. matches the expression 'http://www.amazon.com\\\/[.*]\\\/yourAffiliateId'" }; -$('a[name=linkEditGoal]').click( function() { - var goalId = $(this).attr('id'); - var goal = piwik.goals[goalId]; - initGoalForm("Goals.updateGoal", "Update Goal", goal.name, goal.match_attribute, goal.pattern, goal.pattern_type, goal.revenue, goalId); - showAddNewGoal(); - return false; -}); - -$('a[name=linkDeleteGoal]').click( function() { - var goalId = $(this).attr('id'); - var goalName = 'test goal';//piwik.goals[goalId][name] - if(confirm(sprintf('Are you sure you want to delete the Goal %s?','"'+goalName+'"'))) - { - $.ajax( getAjaxDeleteGoal( goalId ) ); - return false; - } -}); - bindGoalForm(); -$('a[name=linkAddNewGoal]').click( function(){ - initGoalForm('Goals.addGoal', 'Add Goal', '', 'url', '', 'contains', '0'); - return showAddNewGoal(); -} ); -$('a[name=linkEditGoals]').click( function(){ - return showEditGoals(); -} ); +{/literal} -</script> +{if !isset($onlyShowAddNewGoal)} +piwik.goals = {$goalsJSON}; +bindListGoalEdit(); +{else} +initAndShowAddGoalForm(); +{/if} -{/literal} +</script> diff --git a/plugins/Goals/templates/add_new_goal.tpl b/plugins/Goals/templates/add_new_goal.tpl new file mode 100644 index 0000000000..05a7f66e8d --- /dev/null +++ b/plugins/Goals/templates/add_new_goal.tpl @@ -0,0 +1,8 @@ + +{if $userCanEditGoals} + {include file=Goals/templates/add_edit_goal.tpl} +{else} +Only an Administrator or the Super User can add Goals for a given website. +Please ask your Piwik administrator to set up a Goal for your website. +<br>Tracking Goals are a great tool to help you maximize your website performance! +{/if} diff --git a/plugins/Goals/templates/form_add_goal.tpl b/plugins/Goals/templates/form_add_goal.tpl new file mode 100644 index 0000000000..95c4f6d3d9 --- /dev/null +++ b/plugins/Goals/templates/form_add_goal.tpl @@ -0,0 +1,67 @@ +{literal} +<style> +.goalInlineHelp{ +color:#9B9B9B; +} +</style> +{/literal} +<span id='GoalForm' style="display:none;"> +<form> + <table class="tableForm"> + <tr> + <td>Goal Name </td> + <td><input type="text" name="name" value="" id="goal_name" /></td> + </tr> + <tr> + <td>Goal is triggered when visitors:</td> + <td> + <input type="radio" id="match_attribute_url" value="url" name="match_attribute"/> + <label for="match_attribute_url">Visit a given URL (page or group of pages)</label> + <br> + <input type="radio" id="match_attribute_file" value="file" name="match_attribute"/> + <label for="match_attribute_file">Download a file</label> + <br> + <input type="radio" id="match_attribute_external_website" value="external_website" name="match_attribute"/> + <label for="match_attribute_external_website">Click on a Link to an external website </label> + </td> + </tr> + <tr> + <td>where the <span id="match_attribute_name"></span></td> + <td> + <select name="pattern_type"> + <option value="contains">contains</option> + <option value="exact">is exactly</option> + <option value="regex">matches the expression</option> + </select> + + <input type="text" name="pattern" value=""/> + <br> + <div id="examples_pattern" class="goalInlineHelp"></div> + <br> + <span style="float:right"> + (optional) <input type="checkbox" id="case_sensitive"/> + <label for="case_sensitive">Case sensitive match</label> + </span> + </td> + </tr> + <tr> + <td>(optional) Goal default value is </td> + <td>{$currency} <input type="text" name="revenue" size="1" value="0"/> + <div class="goalInlineHelp"> + For example, a Contact Form submitted by a visitor <br> + may be worth $10 on average. Piwik will help you understand <br> + how well your visitors segments are performing.</div> + </td> + </tr> + <tr> + <td colspan="2" style="border:0"> + <div class="submit"> + <input type="hidden" name="methodGoalAPI" value=""> + <input type="hidden" name="goalIdUpdate" value=""> + <input type="submit" value="Add Goal" name="submit" id="goal_submit" class="submit" /> + </div> + </td> + </tr> + </table> +</form> +</span>
\ No newline at end of file diff --git a/plugins/Goals/templates/list_goal_edit.tpl b/plugins/Goals/templates/list_goal_edit.tpl new file mode 100644 index 0000000000..081497cade --- /dev/null +++ b/plugins/Goals/templates/list_goal_edit.tpl @@ -0,0 +1,22 @@ +<span id='EditGoals' style="display:none;"> + <table class="tableForm"> + <thead style="font-weight:bold"> + <td>Id</td> + <td>Goal Name</td> + <td>Goal is Triggered when</td> + <td>Revenue</td> + <td>Edit</td> + <td>Delete</td> + </thead> + {foreach from=$goals item=goal} + <tr> + <td>{$goal.idgoal}</td> + <td>{$goal.name}</td> + <td>{$goal.match_attribute} <br>Pattern {$goal.pattern_type}: {$goal.pattern}</b></td> + <td>{if $goal.revenue==0}-{else}{$currency}{$goal.revenue}{/if}</td> + <td><a href='#' name="linkEditGoal" id="{$goal.idgoal}"><img src='plugins/UsersManager/images/edit.png' border=0> Edit</a></td> + <td><a href='#' name="linkDeleteGoal" id="{$goal.idgoal}"><img src='plugins/UsersManager/images/remove.png' border=0> Delete</a></td> + </tr> + {/foreach} + </table> +</span>
\ No newline at end of file diff --git a/plugins/Goals/templates/overview.tpl b/plugins/Goals/templates/overview.tpl index a17611066d..04bf1af90d 100644 --- a/plugins/Goals/templates/overview.tpl +++ b/plugins/Goals/templates/overview.tpl @@ -1,12 +1,10 @@ {include file="Goals/templates/title_and_evolution_graph.tpl"} - - {foreach from=$goalMetrics item=goal} {assign var=nb_conversions value=$goal.nb_conversions} {assign var=conversion_rate value=$goal.conversion_rate} -<h3 style="text-decoration:underline;padding-top:20px">{$goal.name} (goal)</h3> +<h2 style="padding-top: 30px;">{$goal.name} (goal)</h3> <table width=700px> <tr><td> <p>{sparkline src=$goal.urlSparklineConversions}<span> @@ -22,5 +20,8 @@ {/foreach} {if $userCanEditGoals} + <hr style="margin:30px 0px"> {include file=Goals/templates/add_edit_goal.tpl} {/if} + +{include file="Goals/templates/release_notes.tpl}
\ No newline at end of file diff --git a/plugins/Goals/templates/release_notes.tpl b/plugins/Goals/templates/release_notes.tpl new file mode 100644 index 0000000000..dce9ec63b2 --- /dev/null +++ b/plugins/Goals/templates/release_notes.tpl @@ -0,0 +1,20 @@ +<hr> +<b>About the Goal Tracking Plugin</b><br> +<pre> +The Goal Tracking Plugin is in alpha release. There is more coming soon! +- The Goal Report page will display conversion table by search engines, country, keyword, campaign, etc. +- The Goal Overview page will link to a Goal Report page with a "(more)" link that will ajax reload the page +- Goals could be triggered using javascript event, with custom revenue +- internationalization of all strings +- provide documentation, screenshots, blog post + add screenshot and inline help in "Add a New Goal" +- provide widgets for the dashboard, general goal overview, and one widget for each goal. With: graph evolution, sparklines. Widget with top segments for each goal. + +Known bugs +- The Goal total nb conversions should be sum of all goal conversions (wrong number when deleting a Goal) +- After adding goal, the window should refresh to the goal report page, and not to the dashboard +- Outlink trailing slash is automatically deleted from the URL, there would be a problem when trying to exact match a URL with trailing slash +- All graph labelling are not correct (always printing nb_uniq_visitors even when showing conversion or conversion_rate) see <a href='http://dev.piwik.org/trac/ticket/322'>#322</a> + +Give us Feedback! +If you find any other bug, or if you have suggestions, please send us a message using the "Give us feedback" link at the top of the Piwik pages. +</pre>
\ No newline at end of file diff --git a/plugins/Goals/templates/single_goal.tpl b/plugins/Goals/templates/single_goal.tpl index bb04e6f01b..b605c17490 100644 --- a/plugins/Goals/templates/single_goal.tpl +++ b/plugins/Goals/templates/single_goal.tpl @@ -4,8 +4,8 @@ <h2>Conversions Overview</h2> <ul class="ulGoalTopElements"> <li>Your best converting countries are: {include file='Goals/templates/list_top_segment.tpl' topSegment=$topSegments.country}</li> - <li>Your top converting keywords are: {include file='Goals/templates/list_top_segment.tpl' topSegment=$topSegments.keyword}</li> - <li>Your best converting websites referers are: {include file='Goals/templates/list_top_segment.tpl' topSegment=$topSegments.website}</li> + {if count($topSegments.keyword)>0}<li>Your top converting keywords are: {include file='Goals/templates/list_top_segment.tpl' topSegment=$topSegments.keyword}</li>{/if} + {if count($topSegments.website)>0}<li>Your best converting websites referers are: {include file='Goals/templates/list_top_segment.tpl' topSegment=$topSegments.website}</li>{/if} <li>Returning visitors conversion rate is <b>{$conversion_rate_returning}%</b>, New Visitors conversion rate is <b>{$conversion_rate_new}%</b></li> </ul> {/if} diff --git a/plugins/Goals/templates/title_and_evolution_graph.tpl b/plugins/Goals/templates/title_and_evolution_graph.tpl index f5359132d9..0b1b8d2c7b 100644 --- a/plugins/Goals/templates/title_and_evolution_graph.tpl +++ b/plugins/Goals/templates/title_and_evolution_graph.tpl @@ -18,4 +18,3 @@ </td></tr> </table> -<div style="clear:both">
\ No newline at end of file |