Add Javascript tracking code to TW5

97 views
Skip to first unread message

Horia F Pop

unread,
Jan 15, 2017, 5:02:49 AM1/15/17
to TiddlyWiki
Hello,

I am trying to add Javascript tracking code to my TiddlyWiki 5 page. The tracking system is irrelevant. It is not Google Analytics.

I was not able to find any explanatory information about this. Without any other help, I just created a new tiddler, with the JS code as the text, and the type set to JavaScript code. But this does not work. Something I may be missing.

Can anyone point me in the right direction?

Thank you,
Horia

sini-Kit

unread,
Jan 15, 2017, 9:44:04 AM1/15/17
to TiddlyWiki
 you can add your code to $:/boot/bootprefix.js 
 or you can make your own $:/boot/bootprefix1.js   and put some code here $:/core/templates/tiddlywiki5.html

something like

<div id="bootKernelPrefix1" style="display:none;">
{{ $:/boot/bootprefix1.js ||$:/core/templates/javascript-tiddler}}
</div>






воскресенье, 15 января 2017 г., 13:02:49 UTC+3 пользователь Horia F Pop написал:

BJ

unread,
Jan 15, 2017, 10:46:20 AM1/15/17
to TiddlyWiki
Hi Horia,
there are many javascript libraries that have be used successfully  with tiddlywiki. There is a google analytics plugin here:

https://github.com/Jermolene/TiddlyWiki5/blob/master/plugins/tiddlywiki/googleanalytics/googleanalytics.js

Javascript libraries often give an example or instructions of how to include them into a web page, from that description we maybe able to say how to include the lib in tiddlywiki. In short you need to say which lib you are trying to include.

All the best

BJ

Jed Carty

unread,
Jan 16, 2017, 7:18:25 AM1/16/17
to TiddlyWiki
The easiest way for testing is probably to put the javascript code in the text of a tiddler and then tag that tiddler with $:/tags/RawMarkup this puts the text of the tiddler into the html head element so you have to save the wiki and reload it to see the effects of any changes you make to the code.
Reply all
Reply to author
Forward
0 new messages