Page 1 of 1

[SOLVED] Open Web Analytics - Need PHP script on all pages

Posted: Sat Feb 17, 2018 3:15 am
by SlidingHorn
I'd like to install Open Web Analytics for the site I'm working on, and all I need to do (as far as I know) is include the following PHP script on all pages of the site:

Code: Select all

<?php
    require_once('owa_env.php');
    require_once(OWA_DIR.'owa_php.php');
    $owa = new owa_php();
    $owa->setSiteId('your_site_id');
    $owa->setPageTitle('My Web Page Title');
    $owa->setPageType('article');
    $owa->trackPageView();
?>
I have 2 questions:

1. What's the best way to accomplish this?

2. I assume I'd have to replace the "your_site_id", "My Web Page Title", and "article" with some sort of already-present s9y variables?

Re: Open Web Analytics - Need PHP script on all pages

Posted: Sat Feb 17, 2018 9:59 pm
by yellowled
SlidingHorn wrote:1. What's the best way to accomplish this?

2. I assume I'd have to replace the "your_site_id", "My Web Page Title", and "article" with some sort of already-present s9y variables?
I'm not sure about the "best way" part of your question, so I'm going to leave that for Garvin or onli to answer, but

A. I'm pretty sure you'll have to at least adapt the path to the files you're requiring (assuming you'll have to upload or install them to your webspace as well, I'm not familiar with Open Web Analytics).
B. Pretty sure your site id, title and page type will be something "OWA internal". The title is obviously some kind of name for your blog, the id is probably some kind of unique identifier, and I'm not sure about the article, but you should get all these from your OWA installation, not from Serendipity.

YL

Re: Open Web Analytics - Need PHP script on all pages

Posted: Sat Feb 17, 2018 10:15 pm
by MarioH
Hi,
you can use the serendipity_event_page_nugget Plugin to place the code on all sites of your blog.

Regards
Mario

Re: Open Web Analytics - Need PHP script on all pages

Posted: Sat Feb 17, 2018 10:47 pm
by SlidingHorn
MarioH wrote:Hi,
you can use the serendipity_event_page_nugget Plugin to place the code on all sites of your blog.

Regards
Mario
I'm not seeing this plugin in SPARTACUS...I do see "HTML-Code inside head (HTML-Head Nugget)" and "HTML Nugget on Page", but my understanding is that these are for HTML only

EDIT: Now that the "Plugins" page on here is back up I see that "HTML Nugget on Page" is the one you're talking about, but I still thought those were only for HTML...can you clarify?

Re: Open Web Analytics - Need PHP script on all pages

Posted: Sun Feb 18, 2018 10:06 am
by MarioH
You can use it for any kind of code. Just use the second "content" field.