[GRADLE-178] Add Google Analytics snippet to the javadocs. Created: 09/Aug/08 Updated: 25/Mar/15 Resolved: 25/Mar/15 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Improvement | ||
Reporter: | Hans Dockter | Assignee: | Luke Daley |
Resolution: | Fixed | Votes: | 0 |
Comments |
Comment by Jon Cox [ 22/Jan/09 ] |
Can you explain this a bit more? |
Comment by Hans Dockter [ 25/Jan/09 ] |
This is a specific issue for the build of the Gradle project itself. When we generated the Javadoc for Gradle we could add a Google analytics script to every html page. That way we would get statistics how people use our javadocs. But it might be also an interesting generic feature. |
Comment by Adam Murdoch [ 01/May/13 ] |
Can we close this? |
Comment by Peter Abeles [ 19/May/14 ] |
I'm running into this issue now. Basically for google adsense or analytics you need to insert java script code into the JavaDoc. White spaces are important and you need to include newline characters. Here is an example of code which I need to inject: ------ BEGIN ------ var _gaq = _gaq || []; (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> The Gradle build script looks something like this. I'm reading in the javascript from a file to avoid formatting issues: ------ BEGIN ------ } The commented out line will remove all new line characters so that javadoc doesn't fail. However, when it does that it will break the javascript and it won't work. |
Comment by Luke Daley [ 25/Mar/15 ] |
Done a long time ago. |