Skip to content

Commit

Permalink
google-anaylitics: Support google analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
doortts committed Jul 19, 2017
1 parent f205c4c commit 28645c6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/controllers/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class Application extends Controller {
public static String ALLOWED_SENDING_MAIL_DOMAINS = play.Configuration.root().getString("application.allowed.sending.mail.domains", "");
public static String PRIVATE_IS_DEFAULT = play.Configuration.root().getString("project.default.scope.when.create", "public");
public static boolean HIDE_PROJECT_LISTING = play.Configuration.root().getBoolean("application.hide.project.listing", false);
public static boolean SEND_YONA_USAGE =play.Configuration.root().getBoolean("application.send.yona.usage", true);

@AnonymousCheck
public static Result index() {
Expand Down
12 changes: 12 additions & 0 deletions app/views/layout.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,17 @@
var UsermenuUrl = "@routes.UserApp.usermenuTabContentList()";
</script>
<script type="text/javascript" src="@routes.Assets.at("javascripts/common/yona.Usermenu.js")"></script>

@if(Application.SEND_YONA_USAGE){
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-102735758-1', 'auto');
ga('send', 'pageview');
</script>
}
</body>
</html>
6 changes: 6 additions & 0 deletions conf/application.conf.default
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,12 @@ application.displayPrivateRepositories = false
# default: "public"
project.default.scope.when.create = "public"

# Google Analytics
# ~~~~~~~~~~~~~~~~~
# This data is used to better understand how users interact with the Web UI which gives us valuable information
# in improving Yona user experience. To disable this for any reason, set the following option to false.
application.send.yona.usage = true

# Github Migration
# ~~~~~~~~~~~~~~~~~
# User can migrate their own projects to github
Expand Down

0 comments on commit 28645c6

Please sign in to comment.