Google Analytics for OMP 3+?

The analytics plugin repository asserts that it’s shipped with OMP 1.2+. However, with OMP 3.1.0-0, that doesn’t seem to be the case. Before I install it manually, I wanted to double-check that I wasn’t overlooking something—any insights?

Hi @crism,

Ah, good spotting – I forgot to add that as a submodule to the OMP github repository. I’ve done that. The plugin is available at GitHub - pkp/googleAnalytics: Google Analytics plugin for OMP 1.2+ / OJS 3.0+ – put the contents of that repository into plugins/generic/googleAnalytics, and run php tools/upgrade.php upgrade to register the plugin with the system. Make sure to back up your installation before running the upgrade script.

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks, @asmecher. The upgrade script dies:

[pre-install]
[load: upgrade.xml][pre-install]
[load: upgrade.xml]
[version: 3.1.0.0]
[schema: lib/pkp/xml/schema/common.xml]
ERROR: Upgrade failed: DB: ERROR:  type "serial" does not exist

… this is with a git checkout at the omp-3_1_0-0 tag… interesting that it’s trying to mess with the OJS serial table.

Anyway, uploading a .tar.gz through the admin panel seems to have worked. Thanks.

Hi @crism,

That’s the serial pseudotype; this is a known issue with PostgreSQL that I’d consider an ADODB bug. There are a few other forum threads, including a link to a patch to resolve it. However, uploading it through the admin panel is just as good and circumvents this issue.

Regards,
Alec Smecher
Public Knowledge Project Team

Right, @asmecher—I’ve run into that before, sorry. Didn’t patch my staging OMP, apparently.

Hi @asmecher,
If I could follow up on this post. I’m attempting to get Google Analytics running on OMP version 3.1.0.0. As directed, I copied code from GitHub - pkp/googleAnalytics: Google Analytics plugin for OMP 1.2+ / OJS 3.0+ and placed in plugins/generic/googleAnalytics directory. Ran tools/upgrade.php upgrade and it completes successfully:

[pre-install]
[load: upgrade.xml]
[version: 3.1.0.0]
[schema: lib/pkp/xml/schema/common.xml]
[schema: lib/pkp/xml/schema/scheduledTasks.xml]
[schema: lib/pkp/xml/schema/temporaryFiles.xml]
[schema: lib/pkp/xml/schema/log.xml]
[schema: lib/pkp/xml/schema/notes.xml]
[schema: lib/pkp/xml/schema/controlledVocab.xml]
[schema: lib/pkp/xml/schema/metadata.xml]
[schema: lib/pkp/xml/schema/announcements.xml]
[schema: lib/pkp/xml/schema/reviews.xml]
[schema: lib/pkp/xml/schema/reviewForms.xml]
[schema: lib/pkp/xml/schema/submissions.xml]
[schema: lib/pkp/xml/schema/submissionFiles.xml]
[schema: lib/pkp/xml/schema/mutex.xml]
[schema: lib/pkp/xml/schema/tombstone.xml]
[schema: lib/pkp/xml/schema/genres.xml]
[schema: lib/pkp/xml/schema/rolesAndUserGroups.xml]
[schema: lib/pkp/xml/schema/views.xml]
[schema: lib/pkp/xml/schema/metrics.xml]
[schema: dbscripts/xml/omp_schema.xml]

[code: Installer Installer::addPluginVersions]
[post-install]
Successfully upgraded to version 3.1.0.0

The site never comes up HTTP ERROR 500. Once I remove the GA folder, it comes back up fine. This is the error I am receiving in the apache error log:

PHP Fatal error: Call to undefined method GoogleAnalyticsPlugin::_registerTemplateResource() in …/site/plugins/generic/googleAnalytics/GoogleAnalyticsPlugin.inc.php on line 28

Any advice would be appreciated.

Hi @jbutler,

The version you’ve installed isn’t compatible with your release of OJS. Make sure you get your plugin from the “Releases” area, where it’s packaged for distribution. Or better yet, install it from the Plugin Gallery inside OJS, where compatibility is checked.

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks for the quick reply @asmecher.
Just so you are aware, I am trying to get this to run with OMP not OJS. I’m not sure that makes a difference in your response. The GA plugin was not included with the OMP 3.1 download, so I am trying to manually install from the github link you provided. When I try to install the file from the GUI, I get this error: “The uploaded plugin archive does not contain a folder that corresponds to the plugin name.”
Thanks

Hi @jbutler,

Ah, I see, I was assuming OJS. This plugin will be released with OMP 3.1.1, which is due out in a couple of weeks. If you can wait until then, I’d suggest upgrading and you’ll get the plugin with that.

Regards,
Alec Smecher
Public Knowledge Project Team

That works, thanks Alec.

  • Jim