def test_track(ready): url = 'http://local.test/' + faker.uri_path() track(url) data = analyze('Actions.getPageUrls', period='day', date=date.today(), expanded=1) t = find_tracking(url, data) assert t is not None, 'No tracking entry found for {}'.format(url)
def piwik_track_api(url, **params): '''Track an API request into Piwik.''' log.debug('Sending to piwik: {url}'.format(url=url)) if 'user_ip' in params: params['cip'] = params.pop('user_ip') if current_app.config.get('PIWIK_BULK', PIWIK_BULK_DEFAULT): PiwikTracking.objects.create(url=url, kwargs=params) else: track(url, is_api=True, **params)
def test_track(ready): ''' Use bulk_track w/ default params which should log to PIWIK_ID_FRONT ''' url = 'http://local.test/' + faker.uri_path() track(url) data = analyze('Actions.getPageUrls', period='day', date=date.today(), expanded=1) t = find_tracking(url, data) assert t is not None, 'No tracking entry found for {}'.format(url)
def download(obj, context_url=None, latest=False): context_url = context_url or obj.url url = obj.latest if latest else obj.url return track(context_url, download=url)
def visit(obj): return track(obj.external_url)
def piwik_track_new_follow(url, **params): '''Track a new follow into Piwik.''' log.debug('Sending to piwik: {url}'.format(url=url)) track(url, **params)
def piwik_track_reuse_published(url, **params): '''Track a reuse publication into Piwik.''' log.debug('Sending to piwik: {url}'.format(url=url)) track(url, **params)