Skip to content

Commit

Permalink
Merge pull request #34 from mauricerenck/develop
Browse files Browse the repository at this point in the history
added: matomo - track rss page views
  • Loading branch information
mauricerenck authored Aug 16, 2019
2 parents 3b1c464 + f3404e8 commit 5e9bf7a
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 56 deletions.
11 changes: 11 additions & 0 deletions blueprints/pages/podcasterfeed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,17 @@ tabs:
width: 1/4
when:
podcasterMatomoFeedEnabled: yes
podcasterMatomoFeedPage:
label: Track Page
help: Will create a page view when feed is viewed
type: toggle
default: no
text:
- disabled
- enabled
width: 1/4
when:
podcasterMatomoFeedEnabled: yes
podcasterMatomoFeedGoalId:
label: Goal Id
type: text
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mauricerenck/podcaster",
"version": "1.2.2",
"description": "A podcast plugin for Kirby 3",
"version": "1.2.3",
"description": "A Kirby Podcast Plugin",
"type": "kirby-plugin",
"license": "MIT",
"authors": [
Expand Down
102 changes: 51 additions & 51 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@
$matomo->setUrl($feed->url());
$matomo->setIp($_SERVER['REMOTE_ADDR']);

if ($feed->podcasterMatomoFeedPage()->isNotEmpty() && $feed->podcasterMatomoFeedPage()->isTrue()) {
$matomo->doTrackPageView($feed->podcasterTitle());
}

if ($feed->podcasterMatomoFeedGoalId()->isNotEmpty()) {
$matomo->doTrackGoal($feed->podcasterMatomoFeedGoalId(), 1);
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "podcaster",
"version": "1.2.2",
"description": "Theme",
"version": "1.2.3",
"description": "A Kirby Podcast Plugin",
"main": "index.js",
"author": "Maurice Renck",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion utils/PodcasterWizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function getPageSlug($link, $title)
if (is_null($link)) {
return Str::slug($title);
}

// TODO use Url::path($target); ?
return array_slice(explode('/', rtrim($link, '/')), -1)[0];
}

Expand Down

0 comments on commit 5e9bf7a

Please sign in to comment.