Commit Graph

147 Commits

Author SHA1 Message Date
Augusto Herrmann dc31c37683 remove instantiation of deprecated class that wasn't used anyway 2018-08-21 09:26:13 -03:00
Aleksandar Jovanov ebd2d214af Implement User-ID feature 2018-03-14 15:59:59 +01:00
kmbn 2074c14c35 Remove unused imports 2017-11-13 11:20:08 +01:00
kmbn 3feb7e7f7f Fix variable referenced before assignment error 2017-07-25 14:56:40 +02:00
Gleb e49e8bbac7 #22 / no interface needed, function _post_analytics modified 2017-03-27 15:43:39 +03:00
Sergey 4ace99329f Merge pull request #31 from gleb-rudenko/url-ga-parameter
#30 / Extension adds ?_ga=... parameters to all external links
2017-03-27 14:57:45 +03:00
Gleb 3a589bf40e feedback alt 2017-03-27 14:57:12 +03:00
Sergey 6dfadd61d0 Merge pull request #28 from gleb-rudenko/extension-does-not-respect-custom-uploader-implementations
Extension does not respect custom uploader implementations
2017-03-27 14:53:39 +03:00
Gleb 437c4a8646 #30 / Extension adds ?_ga=... parameters to all external links 2017-03-13 15:46:38 +02:00
Sergey f57820fcb2 Merge pull request #27 from insertjokehere/linked_domains_invalid_json
Fix a bug introduced in #25
2017-02-14 11:37:02 +02:00
Gleb b7238dc8c8 #16 / ga works with default uploader 2017-02-14 10:04:34 +02:00
Gleb 1165fdf22f #16 / reworking google analytics resource download tracking 2017-02-13 15:56:10 +02:00
William Hughes 812b6e6098 Fix a bug introduced in #25
Setting a googleanalytics_fields key to `True` as in #25 causes the
resulting Javascript to also include the literal `True`, which is not
valid. This works around that by setting the key to `'true'` which
when evaluated in an if statement is truthy, serving the same purpose
2017-02-09 16:23:31 +13:00
Sergey Motornyuk 90bc97a326 Use google service account instead of temporary tokens 2017-02-08 15:06:52 +02:00
William Hughes 798bf28b95 Add support for Google Analytics domain linking
This allows for cross-domain tracking. See Google documentation for more detail:
https://support.google.com/analytics/answer/1034342?hl=en
2017-02-03 14:32:49 +13:00
Sergey ece14b8e43 Merge pull request #21 from miguelbgouveia/20-remove-genshi-reference
Remove genshi reference
2017-01-29 00:30:43 +02:00
Martin Burchell 52df40e58b Store fields config value as python dict 2016-09-20 17:39:14 +01:00
Miguel Gouveia 9292140282 Delete the genshi references in orther to use in ckan >= 2.6 versions (delete comments). 2016-09-08 14:13:00 +00:00
Miguel Gouveia ae2f1a58d4 Delete the genshi references in orther to use in ckan >= 2.6 versions. 2016-09-08 14:11:50 +00:00
Martin Burchell a46cc5299c Allow fields to be specified when creating the tracker 2016-07-04 15:46:50 +01:00
Visar Zejnullahu a6b27e40d7 Remove calls to get_top_packages
get_top_packages is broken, and needs to be rewritten to work with
CKAN 2.*. This is because ckan.authz has been removed in CKAN 2.*

See commit ffa86c010d
2016-02-03 18:21:55 +01:00
amercader eda687c556 Fix legacy search endpoint, which wasn't calling the parent one 2015-11-20 13:25:39 +00:00
joetsoi 8dd54a1862 fix resource controller import 2015-11-16 00:39:56 +00:00
joetsoi 0652beb2d0 add resource downloads 2015-11-16 00:09:55 +00:00
nigelb 7c723aa3dc Merge remote-tracking branch 'maxious/api-analytics-event-tracking' into unstable
Conflicts:
	ckanext/googleanalytics/__init__.py
2015-02-17 11:07:06 +05:30
nigelb 13cc8c28d5 Re-land the new tracking from @maxious
This reverts commit f4fce47601.
2015-02-17 11:05:19 +05:30
Alex Sadleir d2d5a5fc48 Move API analytics thread pool initialisation to plugin configuration
One pool should then be available to all controllers avoiding errors with
mod_wsgi under Apache as the number of threads grows infinitely.
2015-02-16 17:52:27 +11:00
nigelb f4fce47601 Revert "Merge pull request #6 from datagovau/api-analytics-event-tracking"
This reverts commit 0febe11dc5, reversing
changes made to e45d73d7a3.

This has been reverted for caushing Apache to max out threads when running
under mod_wsgi.
2015-02-13 14:22:53 +05:30
David Read 0febe11dc5 Merge pull request #6 from datagovau/api-analytics-event-tracking
Google Analytics Event Tracking for CKAN API
2014-11-05 11:38:26 +00:00
Alex Sadleir 803b3f7f81 Use pool of threads and queue for Google Analytics Event Tracking requests 2014-11-05 13:39:53 +11:00
Alex Sadleir 5809f205f5 Use urllib2 timeout for Google Analytics Event Tracking requests 2014-11-05 12:51:51 +11:00
Alex Sadleir d9f811cea7 PEP8 fixes for Google Analytics Event Tracking for CKAN API 2014-11-05 12:43:24 +11:00
root f83664c98e fix typo 2014-07-24 22:58:40 +00:00
Justas Azna 51c212c57c Declare namespace in ckanext/googleanalytics/__init__.py 2014-07-09 18:24:05 +02:00
CKAN data.gov.au 482d8e2ada Use universal analytics 2014-05-22 07:06:47 +00:00
Augusto Herrmann 8964f48879 fix #5 (global name 'Authorizer' is not defined) 2014-04-02 16:47:59 -03:00
Alex Sadleir 56fbb853a4 Adds Google Analytics Event Tracking to some API calls so that usage
of the CKAN API can be reported on via Google Analytics.
2013-11-26 20:26:09 +11:00
Sean Hammond 6d7aa555c3 Fix resource download event tracking js 2013-04-15 19:55:31 +02:00
Sean Hammond b9879ad28d Use g not config in templates
config is no longer available to templates (changed in CKAN core), use g
instead.

This means I have to rename googleanalytics.resource_prefix to
googleanalytics_resource_prefix, because it's now an attribute and can't
have a . in it.

Should probably be using g rather than config to access the setting in
the Python code as well..
2012-12-20 21:39:24 +00:00
Sean Hammond f2c0763fed Merge branch 'master' of github.com:okfn/ckanext-googleanalytics 2012-12-20 21:33:40 +00:00
Sean Hammond ffa86c010d Remove ckan.authz
It has been removed in CKAN 2.0, trying to import it makes CKAN crash on
startup.

This means that get_top_packages() is broken, and needs to be rewritten
to work with CKAN 2.0. At least by removing the import the plugin can
be loaded and its other functions used but if you try to use
get_top_packages() it will crash.
2012-12-20 21:32:53 +00:00
Ross Jones 13a57cd455 Fixed issue where add_resource was used regardless of ckan version 2012-10-23 17:42:04 +01:00
John Martin f254d1afd7 Tweaks to google analytics CKAN 2.0 JS module
1. Specified `resource_prefix` and `resource_url` context more tightly (could be global context)
2. Changed `this.href` to `jQuery(this).prop('href')` as it will never throw a syntax error when upon the condition of a `a.resource-url-analytics` not having a `href` attribute
3. Also added check so that if no `href` is present it doesn't send a blank link to google analytics
2012-10-23 10:21:41 +01:00
Sean Hammond 70dc8c78d4 Add CKAN 2.0 resource download event tracking 2012-10-19 16:10:58 +02:00
Sean Hammond 58693e9d26 Remove a broken reference to googleanalytics_footer()
googleanalytics_footer() was removed by a previous commit
2012-10-18 19:52:24 +02:00
Sean Hammond e02ccc7438 Merge branch 'master' of github.com:okfn/ckanext-googleanalytics 2012-10-18 19:46:53 +02:00
Sean Hammond a1672cb0ad Remove googleanalytics_footer
It didn't do anything yet and I don't think it will be needed for Google
Analytics Event Tracking with CKAN 2.0 anyway.
2012-10-18 19:46:03 +02:00
Ross Jones c4a720840b Merge pull request #3 from okfn/v3support
V3support
2012-10-18 07:22:12 -07:00
Ross Jones 5ad904400b Minor tidy up 2012-10-18 15:15:43 +01:00
Ross Jones 459ff608a6 Fixes to make sure that data collected for reports is working
Make sure we handle the changes to the API to ensure we collect the
dataset and resource information
2012-10-18 15:11:01 +01:00
Ross Jones 2283571562 Attempts to provide support for v3 of the Google Analytics API.
Since version 2 of the Google Analytics API was shelved the download
of previous data was broken.  This commit should, once the oauth dance
has been complete, allow it to work again by changing all of the calls.
See the README for instructions on setting up OAUTH.  Other bug fixes
are:

- Resources views are now clearly identified
- Package Ids are set for /dataset/edit requests
- Updated README
2012-10-18 13:47:30 +01:00
Sean Hammond 32e3556d26 Remove event tracking support from CKAN 2.0
I'm not going to finish implementing Google Analytics Event Tracking
support for CKAN 2.0 at this point, it can be implemented later if
needed (event tracking with CKAN 1.x should still work).
2012-10-17 17:39:43 +02:00
Sean Hammond 53a778161f Add CKAN 2.0 templates for Google Analytics tracking
Everything should still work as it did with CKAN 1.x templates _if_
ckan.legacy_templates is set in your ini file.

The event tracking javascript (ckanext-googleanalytics.js) still needs
to be updated for CKAN 2.0.

Also there is some code in plugin.py:filter() that adds something to the
package and group pages that I haven't implemented for CKAN 2.0 yet.

Tests need to be updated.

README needs to be updated.
2012-10-17 13:06:31 +02:00
Sean Hammond 8f5d60821f Add some docstrings
Make things slightly easier to follow.
2012-10-16 16:03:41 +02:00
Sean Hammond dcce83bb31 Fix up imports in plugin.py
Follow CKAN coding standards: don't use from foo import bar, but
standard library imports before all other imports and ckan imports after
all other imports.
2012-10-16 15:55:15 +02:00
Sean Hammond bdef9ea233 Move templates and public to legacy_templates and legacy_public
Making way for new CKAN 2.0 templates and scripts to be added.

This shouldn't break existing CKAN 1.x functionality.
2012-10-16 15:39:27 +02:00
John Glover df3f575119 Add remaining track events. 2012-07-23 11:48:59 +01:00
John Glover ffd28f4619 Add first batch of Google Analytics track events. 2012-07-11 16:40:17 +01:00
John Glover 03b4023676 Add 'track_events' config option, tidy up config
reading.
2012-07-11 14:34:18 +01:00
John Glover 1fa09bae92 Tidy up imports a bit in plugin.py 2012-07-11 10:38:47 +01:00
amercader 1f534141ed [ui][xs] Show downloads instead of headers on table headers 2012-05-10 16:47:20 +01:00
amercader 02644f1d2d Merge branch 'master' into enhancement-2251-tracking 2012-05-10 15:56:40 +01:00
amercader a8747809d2 [ui] Update summary page design and links 2012-05-10 13:44:29 +01:00
Toby 143dafab45 summary_tracking renames and fixes 2012-04-20 14:46:00 +01:00
Toby db13b0b9cd changes for new internal tracking 2012-04-05 18:12:25 +01:00
John Glover deb99ebdc3 Change 'package' to 'dataset' in report 2011-12-21 11:45:45 +00:00
John Glover 16d5d11b86 Bug fix: download count style should only be added
once, at the end of the head section.
2011-12-20 13:16:28 +00:00
John Glover 8176247f10 [1451] Track downloads on resource view page.
Don't display download count on that page for now.
2011-12-20 10:56:05 +00:00
John Glover e104e7eb9e update genshi code for latest dataset view changes 2011-12-19 09:51:25 +00:00
John Glover 165a3fd055 remove unused import 2011-12-19 09:50:56 +00:00
John Glover c9e8a6b5d9 change summary page to use /dataset, not /package 2011-11-29 17:56:47 +00:00
John Glover 8906260eb1 update plugin filter method and tests for latest
ckan (with dataset view changes)
2011-11-29 17:39:49 +00:00
Seb Bacon 5cb20d1d45 cache table reflection (it was *very* slow) 2011-04-10 09:44:44 +01:00
Seb Bacon 11d3777a66 accept non-ascii IRIs 2011-04-10 09:20:49 +01:00
Seb Bacon ee15b29de8 use sqlalchemy expression language where practical 2011-04-08 11:00:28 +01:00
Seb Bacon b852e048c6 escape percents in query condition 2011-04-07 16:30:32 +01:00
Seb Bacon 14f733bd9f factor out database init as separate install step 2011-04-07 10:24:22 +01:00
Seb Bacon 8dfa04434f move local styling to plugin, so we don't override other layout.html files 2011-04-07 09:18:35 +01:00
Seb Bacon 04ea42339a change 'downloads' wording to be less ambiguous 2011-04-06 12:56:52 +01:00
Seb Bacon 137567b0bf set show_downloads to True by default 2011-04-06 12:53:59 +01:00
Seb Bacon 93c7a86cfe make trackPageView come last in list 2011-04-06 12:08:51 +01:00
Seb Bacon 0397483a8c add 'domain' config option for tracking code 2011-04-06 12:01:21 +01:00
Seb Bacon bf749dbf5c don't require profile_name option 2011-04-06 10:34:52 +01:00
Seb Bacon 5a1150f4c7 add show_downloads config option 2011-04-05 15:28:27 +01:00
Seb Bacon fefac7548d add tests, and associated fixage/harness support to main software 2011-04-05 15:08:24 +01:00
Seb Bacon c91ab410c0 more refactoring 2011-04-05 10:38:25 +01:00
Seb Bacon b69d89bf18 big refactor 2011-04-04 17:44:39 +01:00
Seb Bacon 1f0f25a26f move plugin to own module 2011-04-04 11:50:18 +01:00
Seb Bacon 2774932d57 tentative support for tracking downloads, too 2011-03-08 10:42:38 +00:00
Seb Bacon 38a1ca95fe typo 2011-03-03 13:48:12 +00:00
Seb Bacon 66e665dbcc make sure authz query has a user to work with 2011-03-03 13:45:09 +00:00
Seb Bacon ed1835a21e don't return several dimensions; it makes parsing the data more complicated 2011-02-28 18:10:11 +00:00
Seb Bacon 4ad028c44c [hack] bump controller string to clear cache 2011-02-18 17:17:58 +00:00
Seb Bacon 4634fe5150 rename controller for cache 2011-02-18 11:27:57 +00:00
Seb Bacon e7093b3f67 return nothing if no GA credentials supplied 2011-02-11 11:24:15 +00:00
Seb Bacon 4d18d1c13d proof of concept for accessing analytics data from CKAN 2011-02-11 11:21:19 +00:00
Seb Bacon 3f060228d3 initial commit 2011-02-10 13:32:19 +00:00