Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Genesys Backend
Commits
fd0e54a1
Commit
fd0e54a1
authored
Nov 20, 2013
by
Matija Obreza
Browse files
GA ga.js to analytics.js
parent
dcca4ccc
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/webapp/WEB-INF/decorator/ga.jsp
View file @
fd0e54a1
<%@include
file=
"/WEB-INF/jsp/init.jsp"
%>
<c:if
test=
"
${
googleAnalyticsAccount
ne
null
}
"
>
<script
type=
"text/javascript"
>
var
_gaq
=
_gaq
||
[];
_gaq
.
push
([
'
_setAccount
'
,
'
${googleAnalyticsAccount}
'
]);
try
{
_gaq
=
_gaq
.
concat
(
_pageGaq
);
}
catch
(
e
)
{
}
_gaq
.
push
([
'
_trackPageview
'
]);
<script
type=
"text/javascript"
>
(
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
'
,
'
${googleAnalyticsAccount}
'
,
'
auto
'
);
var
p
=
{};
try
{
if
(
_pageDim
.
institute
!=
null
)
{
p
.
dimension1
=
_pageDim
.
institute
;
}
if
(
_pageDim
.
genus
!=
null
)
{
p
.
dimension2
=
_pageDim
.
genus
;
}
console
.
log
(
p
);
ga
(
'
send
'
,
'
pageview
'
,
p
);
}
catch
(
e
)
{
console
.
log
(
e
);
ga
(
'
send
'
,
'
pageview
'
);
}
(
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>
// Other trackers?
try
{
if
(
_pageTrackers
.
length
>
0
)
{
for
(
var
i
=
_pageTrackers
.
length
-
1
;
i
>=
0
;
i
--
)
{
var
trackerName
=
'
gat
'
+
i
;
ga
(
'
create
'
,
_pageTrackers
[
i
],
'
auto
'
,
{
'
name
'
:
trackerName
});
ga
(
trackerName
+
'
.send
'
,
'
pageview
'
);
}
}
}
catch
(
e
)
{
console
.
log
(
e
);
}
</script>
</c:if>
\ No newline at end of file
src/main/webapp/WEB-INF/jsp/accession/details.jsp
View file @
fd0e54a1
...
...
@@ -249,11 +249,7 @@
});
</c:if>
_pageGaq
=
[];
_pageGaq
.
push
([
'
_setCustomVar
'
,
1
,
'
Institute
'
,
'
${accession.instituteCode}
'
]);
_pageGaq
.
push
([
'
_setCustomVar
'
,
2
,
'
Genus
'
,
'
${accession.genus}
'
]);
<c:forEach
items=
"
${
crops
}
"
var=
"crop"
>
_pageGaq
.
push
([
'
_setCustomVar
'
,
3
,
'
Crop
'
,
'
${crop.shortName}
'
]);
</c:forEach>
_pageDim
=
{
institute
:
'
${accession.instituteCode}
'
,
genus
:
'
${accession.taxonomy.genus}
'
};
</script>
</body>
</html>
\ No newline at end of file
src/main/webapp/WEB-INF/jsp/wiews/details.jsp
View file @
fd0e54a1
...
...
@@ -135,8 +135,7 @@
});
});
_pageGaq
=
[];
_pageGaq
.
push
([
'
_setCustomVar
'
,
1
,
'
Institute
'
,
'
${faoInstitute.code}
'
]);
_pageDim
=
{
institute
:
'
${faoInstitute.code}
'
};
</script>
</c:if>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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