我在 gatsby 应用程序中设置了 Google Analytics 代码。
<script>
var gaId = "UA-xxxxxxxx-1";
var JSLink = "https://www.googletagmanager.com/gtag/js?id=" + gaId;
var JSElement = document.createElement('script');
JSElement.src = JSLink;
document.getElementsByTagName('head')[0].appendChild(JSElement);
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments)}
gtag('js', new Date());
gtag('config', gaId);
</script>
Run Code Online (Sandbox Code Playgroud)
当我使用 Google Tag Assistant 检查该网站时,它说有多个跟踪代码安装。
如何摆脱 Global 站点标签的重复安装?在 React 应用程序中设置 Google Analytics 有什么建议?
我想使用 javascript 创建 1000 个单词的虚拟文本。我的想法是使用这样的数组
var words =["The sky", "above", "the port","was", "the color of television", "tuned", "to", "a dead channel", ".", "All", "this happened", "more or less","." ,"I", "had", "the story", "bit by bit", "from various people", "and", "as generally", "happens", "in such cases", "each time", "it", "was", "a different story","." ,"It", "was", "a pleasure", "to", "burn"];
Run Code Online (Sandbox Code Playgroud)
然后使用javascript随机输出1000个单词。我将如何使用 javascript 做到这一点?还有其他方法吗?