【发布时间】:2020-05-06 20:02:58
【问题描述】:
我在正文中的标签 GTM 未正确安装,因为在正文部分之外。我是编码新手,所以很抱歉这个问题,但是如何在正文部分正确插入代码 noscript ?
非常感谢
这里是代码:
<body<?php body_class( mk_get_body_class( global_get_post_id() ) ); ?> <?php echo get_schema_markup( 'body' ); ?> data-adminbar="<?php echo is_admin_bar_showing(); ?>">
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-5DB5QN9"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
<?php
// Hook when you need to add content right after body opening tag. to be used in child themes or customisations.
do_action( 'theme_after_body_tag_start' );
?>
<!-- Target for scroll anchors to achieve native browser bahaviour + possible enhancements like smooth scrolling -->
<div id="top-of-page"></div>
<div id="mk-boxed-layout">
<div id="mk-theme-container" <?php echo is_header_transparent( 'class="trans-header"' ); ?>>
<?php
mk_get_header_view( 'styles', 'header-' . get_header_style() );
【问题讨论】:
标签: php html google-tag-manager