Skip to content

Commit 341f576

Browse files
mobeicanyuezkqiang
authored andcommitted
🐛 Google Analytics 配置判断
1 parent 781fd8e commit 341f576

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

layout/_partials/plugins/analytics.ejs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</script>
1616
<% } %>
1717
18-
<% if (theme.web_analytics.google){ %>
18+
<% if (theme.web_analytics.google && theme.web_analytics.google.measurement_id){ %>
1919
<!-- Google tag (gtag.js) -->
2020
<script async>
2121
if (!Fluid.ctx.dnt) {
@@ -25,7 +25,7 @@
2525
dataLayer.push(arguments);
2626
}
2727
gtag('js', new Date());
28-
gtag('config', '<%- theme.web_analytics.google.measurement_id %>');
28+
gtag('config', '<%= theme.web_analytics.google.measurement_id %>');
2929
});
3030
}
3131
</script>

0 commit comments

Comments
 (0)