Forum Replies Created

Viewing 15 replies - 106 through 120 (of 268 total)
  • Thread Starter Mark

    (@codeispoetry)

    Thanks, that clears it up! I’d rather have the ZotPress URLs looked a bit more like files indeed (including readable sensible filenames) so I’ll take that up with them. I had already modified the code to set a CSS class but I’m trying to avoid modding plugins because I don’t want to break updates. Hence my attempts to get to the bottom of it here. This is now resolved as far as I am concerned, and you’ve gone beyond your duties in supporting. If I could give six stars out of five I would update my review! Thanks again.

    Thread Starter Mark

    (@codeispoetry)

    You are right these URLs are now able to trigger goals of the type “Download” with the regex you gave (.*pdf.*). Excellent! So am I right in inferring that these links are detected as “Download” because they have the right download CSS class, which makes them available to trigger a goal?

    Only remaining question with regard to Download tracking is: what about ZotPress-like links that have no class="zpDownloadURL" or similar? Those are still not recognised as downloads (in the sense of appearing under Behaviour > Downloads) in my testing. Could that be because they don’t come with an extension? And would there be a way to get them recognized as such, even without a CSS class, and apart from goals?

    (To avoid you doing double work and for the benefit of future readers I can update the thread if you answer by mail 🙂 .)

    • This reply was modified 6 years, 1 month ago by Mark.
    • This reply was modified 6 years, 1 month ago by Mark.
    Mark

    (@codeispoetry)

    Make sure you have the abstracts in your Zotero library, and then use abstracts="yes" in the ZotPress shortcode, like so:

    [zotpress abstracts="yes"]

    Mark

    (@codeispoetry)

    Unclear what you mean by “attach to a wordpress webpage”. It could be that you’ve successfully included a ZotPress publication list on a draft page or post, but that the page/post isn’t published yet.

    Or perhaps a step before that, it could be that you’ve succeeded in connecting your Zotero account to ZotPress, so that you see your library on the ZotPress settings page (which has a URL that ends in wp-admin/admin.php?page=Zotpress); but that you haven’t actually included a publication list on an actual page or post.

    ZotPress has wonderful help pages. Just check out the “Help” tab in your WordPress ZotPress settings page. The available tabs are, in order, Browse, Accounts, Options, Help. Be sure to check out the latter, which itself has loads of subtabs.

    Thread Starter Mark

    (@codeispoetry)

    I decided to give it a day and see what works and what doesn’t, but this part still doesn’t work (and somehow tracking of downloads seems still to be erratic despite using the fixed piwik.min.js above).

    Regarding how to trigger goals, I’m thinking the reason the kind of pattern you exemplify doesn’t work is that ZotPress retrieves its files through a REST API and that the URLs don’t actually end in a file extension but look like this:

    ... /request.dl.php?api_user_id=2473932&dlkey=YV6WD77A&content_type=application/pdf

    I’ve tried in vain to construct various patterns and regexes to match this; it seems to me that the problem lies before that, in that Matomo simply doesn’t register this as a URL that points to a file.

    If Matomo were to recognize that kind of link as a file download, this solves another problem, namely that right now I need to set a downloadclass. Trouble is, while I can tell ZotPress to add that class, sometimes I want to link to those URLs manually (i.e. in non-ZotPress-generated content). Right now the only way to get those registered as downloads is to also add the download class manually. Whereas if Matomo would see those URLs as a file download, the download would be registered whether it has a class or not.

    Thread Starter Mark

    (@codeispoetry)

    Yes, same here

    Thread Starter Mark

    (@codeispoetry)

    Neat — this seems to work! I’ve done away with the delay code and am using the updated piwik.min.js, and clicks on Zotpress URLs are now marked as downloads as long as zp-DownloadURL is added to the download classes.

    The only thing I’m still having trouble with is getting these clicks to trigger a goal. Download-related goals seem to expect a filename (in whole or part), and none of the URL-related goals (‘Visit a given URL’, ‘Click on link to external website’) register as triggered when clicking these kinds of links.

    Thread Starter Mark

    (@codeispoetry)

    Oh one more: tracked URLs of downloads (of the ZotPress type in my other thread) appear to be html-encoded so that & becomes & et cetera. Following such a html-encoded link from within the Matomo analytics report then generates an error:

    No content type provided, or format incorrect.

    • This reply was modified 6 years, 1 month ago by Mark.
    Thread Starter Mark

    (@codeispoetry)

    Yes, all clear, I’ve updated the main js file and will give it a few hours to see what happens. Can do some testing again in a few hours (my afternoon).

    Thread Starter Mark

    (@codeispoetry)

    Thanks for the swift reply!

    Thread Starter Mark

    (@codeispoetry)

    Ah that is very well hidden indeed! For network activated installs that should indeed be clearer. So it’s not a bug but a feature 🙂 feel free to update the topic title.

    But at least two things are really unclear about this:
    (1) these instructions are too well-hidden
    (2) the fact that the manual tracking code (or indeed any setting) you fill out in the site-specific settings is used on all sites is far from obvious, and different from the UI and logic of most plugins

    I now understand that essentially, there are no site-specific settings when Marino is network-activated plugin. Perhaps it’s better to point the user to the network admin settings page for settings in that case?

    • This reply was modified 6 years, 1 month ago by Mark.
    Thread Starter Mark

    (@codeispoetry)

    Update: some questions remain.

    First, if I want to place this in a child theme, would this be the way to go? (I’m dubious because when I try this it doesn’t help tracking ZotPress links or downloads at all.) (1) Put the delay code from above in /js/matomo_delay.js, (2) add the script in functions.php through the wp_enqueue_scripts hook, like this:

    
    function matomo_delay() {
    wp_enqueue_script(
        'custom-script',
        get_stylesheet_directory_uri() . '/js/matomo_delay.js',
        array( 'jquery' ),
    	1.0.0,
    	TRUE
     );
    }
    add_action( 'wp_enqueue_scripts', 'matomo_delay' );
    

    (The TRUE refers to ‘in footer’ and makes the script appear in the footer, right after the Matomo tracking code.)

    Second, whether I use the above method or append it to the manual tracking code, download detection is still very erratic. I find it pretty hard to troubleshoot this and would be happy to let you have a look. I’ll create a user and send you an email at the indicated address.

    Thread Starter Mark

    (@codeispoetry)

    Thanks for the comprehensive reply. This is looking good — adding the timeout (and removing some of my earlier attempts) to the tracking code does indeed result in better tracking. FYI, your own visit, before these modifications, registered as a few reloads of the page but only a single download.

    I’m still not getting 100% success but about 4 out of 6 tries are now detected as downloads. I wonder what else can be done to ensure better coverage; 4 seconds seems pretty long, I don’t think ZotPress is still busy then. And all of the external links that go to doi.org are now also correctly tracked (and trigger the goal I set for them). So the timeout does indeed work.

    (I will also look on the ZotPress side if this cannot be improved further. For instance, since publication lists don’t change that often and can be treated as static content, I’ll look into whether I can get a good caching plugin to work so that ZotPress doesn’t need to mess with the DOM after it is ready. If that works I can probably get rid of the timeout again. Does that reasoning seem basically correct?)

    Mark

    (@codeispoetry)

    For the record, I’ve recently set up a clean multisite installation with ZotPress and didn’t encounter any problems.

    Thread Starter Mark

    (@codeispoetry)

    Update to make this request more concrete. Consider the case of a publication list derived from a group library that contains peer-reviewed work and preprints. Sometimes it is desirable to list the preprints separately.

    Listing a subset of items is easy if they’re tagged (or if there are few enough to select them with item keys). But excluding same subset from a larger list (for instance, to have a list of preprints and separately the peer-reviewed papers) is not currently possible. This is a key feature for many academic publication lists.

    Since we already have tags, I though tags_exclude would make most sense, hence my proposal. I’d be very happy with a quick fix that accomplished that.

    (The most general solution would also allow users to exclude items by item keys, item type, or collection: all eminently sensible options.)

Viewing 15 replies - 106 through 120 (of 268 total)