0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

BASEにGoogleタグマネージャーを設置する方法

Posted at

『HTML編集』Appに移動

まずは、HTML編集のAppに移動。

1つ目のスクリプトを入れる(入れる場所に注意!)

以下のスクリプトを、<head>タグ内に貼り付ける。

<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXX');</script>
<!-- End Google Tag Manager -->

※"GTM-XXXX" をご自身のコンテナ ID に置き換えるのを忘れずに。

2つ目のスクリプトを入れる(入れる場所に注意!)

以下のスクリプトを、<body> 開始タグの直後に貼り付ける。

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->

※同じく、"GTM-XXXX" をご自身のコンテナ ID に置き換えるのを忘れずに。

参考に

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?