aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Report/New.pm
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2014-04-16 14:36:54 +0100
committerStruan Donald <struan@exo.org.uk>2014-04-16 16:00:47 +0100
commit0625dbe113dc88fe707ca1fb036bf0a580781e15 (patch)
tree756e83df645c5d5db3f1e9e09f570721e6fad325 /perllib/FixMyStreet/App/Controller/Report/New.pm
parent4734b4c74e203928c599828d9a4fff6dbd57c38c (diff)
alter pave url sent to analytics on report completion
In order to allow us to do funnel analysis in google analytics we need to send a differnt page url when a user completes a report. To do this we add a report_created=1 to the query string on either the report page or the report confirmation page for logged in and confirm by email users respectively. There's a bit of complication as we don't want to set a session cookie everywhere as that will break caching so we set a stash variable, although if the user is logged in this is controlled by a variable in the flash as there is already a session cookie at this point. also, removes the code that sends an event upon report completion as this was no use for funnel analysis.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report/New.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index 761215344..4a5e11573 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -1155,7 +1155,9 @@ sub redirect_or_confirm_creation : Private {
$report_uri = $c->cobrand->base_url_for_report( $report ) . $report->url;
}
$c->log->info($report->user->id . ' was logged in, redirecting to /report/' . $report->id);
- $c->flash->{created_report} = 'loggedin';
+ if ( $c->sessionid ) {
+ $c->flash->{created_report} = 'loggedin';
+ }
$c->res->redirect($report_uri);
$c->detach;
}