Exemplo n.º 1
0
 def get_context_data(self, **kwargs):
     context = super(TrackedViewMixin, self).get_context_data(**kwargs)
     self.page_name['name'] = get_page_name(self.page_name)
     context['js_data'] = context.get('js_data', {})
     context['js_data'].update({
         'tracking': {
             'segmentApplicationId': settings.SEGMENT_IO_KEY,  # None will translate to 'null'
             'page': self.page_name
         }
     })
     return context
Exemplo n.º 2
0
 def help_token(self):
     # Rather than duplicate the definition, simply return the page name.
     page_name = get_page_name(self.page_name)
     if not page_name:
         page_name = 'default'
     return page_name