Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #875 from helix84/DS-2478-update-GA
DS-2478 update Google Analytics tracking JS snippet
- Loading branch information
Showing
8 changed files
with
173 additions
and
185 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
dspace-jspui/src/main/webapp/layout/google-analytics-snippet.jsp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<%-- | ||
The contents of this file are subject to the license and copyright | ||
detailed in the LICENSE and NOTICE files at the root of the source | ||
tree and available online at | ||
http://www.dspace.org/license/ | ||
--%> | ||
<%@ page import="org.dspace.core.ConfigurationManager" %> | ||
<% | ||
String analyticsKey = ConfigurationManager.getProperty("jspui.google.analytics.key"); | ||
%> | ||
<%--Gooogle Analytics recording.--%> | ||
<% | ||
if (analyticsKey != null && analyticsKey.length() > 0) | ||
{ | ||
%> | ||
<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','//www.google-analytics.com/analytics.js','ga'); | ||
ga('create', '<%= analyticsKey %>', 'auto'); | ||
ga('send', 'pageview'); | ||
</script> | ||
<% | ||
} | ||
%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.