class AnalyticsDownloadPlugin(AnalyticsBaseTrackingPlugin): """ A tracking plugin to track file downloads. """ __call__ = ViewPageTemplateFile('download.pt') file_extensions = json.dumps(FILE_EXTENSION_CHOICES)
class AnalyticsUserTypePlugin(AnalyticsBaseTrackingPlugin): """ A tracking plugin to track user type as a custom variable. """ __call__ = ViewPageTemplateFile('usertype.pt') def user_type(self): """ Returns Member if the user is logged or Visitor otherwise. """ membership = getToolByName(self.context, 'portal_membership') if membership.isAnonymousUser(): return 'Visitor' return 'Member'
class AnalyticsUserPPI(AnalyticsBaseTrackingPlugin): """ A tracking plugin to user personally identifiable information (PII). The PII is the base64 encoded Id. """ def user_ppi(self): """ Returns Member if the user is logged or Visitor otherwise. """ membership = getToolByName(self.context, 'portal_membership') if membership.isAnonymousUser(): return None else: user = membership.getAuthenticatedMember() return user.id.encode("base64").strip() __call__ = ViewPageTemplateFile('userppi.pt')
class PFGAnalyticsPlugin(AnalyticsBaseTrackingPlugin): """ A tracking plugin to track form views, submissions and errors. """ __call__ = ViewPageTemplateFile('ploneformgen.pt') def form_status(self): """ Returns the status of the form, which can be None (not a form), 'form' (viewing the form), 'thank-you' (form succesfully submitted), or 'error' (form has validation errors). """ if IPloneFormGenForm.providedBy(self.context): if 'form_submit' in self.request.form.keys(): return 'error' return 'form' elif IPloneFormGenThanksPage.providedBy(self.context): return 'thank-you' return None
class AnalyticsPageLoadTimePlugin(AnalyticsBaseTrackingPlugin): """ A tracking plugin to track page load time. """ __call__ = ViewPageTemplateFile('pageloadtime.pt')
class AnalyticsCommentPlugin(AnalyticsBaseTrackingPlugin): """ A tracking plugin to track posting of comments. """ __call__ = ViewPageTemplateFile('comment.pt')
class AnalyticsEmailLinkPlugin(AnalyticsBaseTrackingPlugin): """ A tracking plugin to track e-mail links. """ __call__ = ViewPageTemplateFile('email.pt')