【问题标题】:Using Google Tag Manager to insert AdSense tags in website使用 Google Tag Manager 在网站中插入 AdSense 代码
【发布时间】:2014-03-25 02:29:37
【问题描述】:

您好,我想在我的网站上插入一个示例 AdSense 代码。我已经使用跟踪代码管理器进行了分析,并想插入另一个代码。我尝试使用自定义 HTML 标记,但它出现在具有属性 display:none visibility:hidden 的 div 上。可以使用跟踪代码管理器实现 Adsense 吗?

<script type="text/javascript">
google_ad_client = "pub-";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_color_border = "FFFFFF";
google_color_bg = "0000FF";
google_color_link = "FFFFFF";
google_color_text = "000000";
google_color_url = "008000";
</script><script type="text/javascript"     src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>

【问题讨论】:

    标签: adsense google-tag-manager


    【解决方案1】:

    我看不出为什么不这样做,我会将标签包装在一个 div 中并将 id 设置为一个已知值,然后使用 jQuery(或您自己的偏好)来获取该 div 并将其插入到您需要的位置。

    将此作为自定义 HTML 标记的起点:

    <div id="my-google-adsense">
    <script>
    <!-- insert adsense code here -->
    </script>
    </div>
    <script>
    <!-- insert jQuery code here -->
    </script>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-06-13
      • 2019-03-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多