【问题标题】:Tag GTM in body在正文中标记 GTM
【发布时间】: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


    【解决方案1】:

    这似乎只包含没有 JavaScript 的用户的后备 GTM 代码。您应该有一个额外的 JavaScript 被剪断以放置在您的页面上,而这在上面的示例中完全没有?

    在此处查看他们的文档以供参考(您缺少第 1 节): https://developers.google.com/tag-manager/quickstart

    【讨论】:

      猜你喜欢
      • 2022-10-04
      • 2016-11-20
      • 2012-04-06
      • 1970-01-01
      • 2012-08-24
      • 2019-10-21
      • 2018-10-06
      • 2012-07-22
      相关资源
      最近更新 更多