Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
course-snapshot
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
13
Issues
13
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
WikiEducator
course-snapshot
Commits
7d810238
Commit
7d810238
authored
Nov 05, 2015
by
Jim Tittsler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WP: use oeru_analytics shortcode for tracking
parent
a32dfbce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
17 deletions
+11
-17
courseWP.js
courseWP.js
+11
-17
No files found.
courseWP.js
View file @
7d810238
...
...
@@ -84,6 +84,10 @@ if (opt['--options']) {
}
});
}
// move the old --siteid option into the new options map
if
(
opt
[
'
--siteid
'
])
{
options
.
siteid
=
opt
[
'
--siteid
'
];
}
console
.
log
(
JSON
.
stringify
(
options
,
null
,
2
));
if
(
opt
[
'
--wpurl
'
])
{
wp
=
wordpress
.
createClient
({
...
...
@@ -457,23 +461,13 @@ function processPage(pi) {
theme
.
process
(
$
,
opt
);
// if using Piwik, install it at the bottom of the page
if
(
opt
[
'
--siteid
'
])
{
$
(
'
body
'
).
append
(
`
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//stats.oeru.org/";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId',
${
opt
[
'
--siteid
'
]}
]);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<noscript><p><img src="//stats.oeru.org/piwik.php?idsite=
${
opt
[
'
--siteid
'
]}
" style="border:0;" alt="" /></p></noscript>
`
);
// if using analytics, install at the bottom of the page
if
(
options
.
siteid
)
{
options
.
tracker
=
options
.
tracker
||
"
//stats.oeru.org
"
;
$
(
'
#content
'
).
append
(
`[oeru_analytics type="piwik" url="
${
options
.
tracker
}
" id="
${
options
.
siteid
}
"]`
);
}
if
(
options
.
google_analytics
)
{
$
(
'
#content
'
).
append
(
`[oeru_analytics type="google" id="
${
options
.
google_analytics
}
"]`
);
}
// save the page: to Wordpress or to filesystem
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment