Skip to content

Commit

Permalink
#4228 add org name and id to some page views and event source to down…
Browse files Browse the repository at this point in the history
…loads
  • Loading branch information
alexandru-m-g committed Jun 20, 2016
1 parent 626667c commit afda062
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,9 @@ def edit(self, id, data=None, errors=None, error_summary=None):

self._setup_template_variables(context, data, group_type=group_type)
c.form = render(self._group_form(group_type), extra_vars=vars)
return render(self._edit_template(c.group.type))

# The extra_vars are needed here to send analytics information like org name and id
return render(self._edit_template(c.group.type), extra_vars={'data': data})

def check_access(self, action_name, data_dict=None):
if data_dict is None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ $(function setUpSearchTracking() {
ga('send', 'event', 'dataset', 'resource-download', dTitle);

mixpanel.track("resource download", {
"event source": "interface",
"resource name": rTitle,
"resource id": rId,
"dataset name": dTitle,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{% extends "organization/base_form_page.html" %}

{# The lines below are for analytics #}
{% block analytics_org_name %}{{ data.name }}{% endblock %}
{% block analytics_org_id %}{{ data.id }}{% endblock %}


{% block subtitle %}{{ _('Edit Organisation') }}{% endblock %}

{% block page_heading_class %}hide-heading{% endblock %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{% extends "organization/read_base.html" %}

{# The line below is for google analytics #}
{% block analytics_org_name %}{{ c.group_dict.name }}{% endblock %}
{% block analytics_org_id %}{{ c.group_dict.id }}{% endblock %}


{% set roles=h.hdx_member_roles_list() %}
{% set authorized = h.check_access('organization_update', {'id': c.group_dict.id}) %}

Expand Down

0 comments on commit afda062

Please sign in to comment.