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.

Nuxt.jsでGoogle広告からランディングした際にオーガニックで計測されてしまう

Posted at

初めての投稿になりますので、読みにくい部分もあるかと思いますがご容赦ください。
Nuxt.jsにてサービス運用しており、Google広告からのコンバージョンが正しく計測できない問題があり、解決に時間を要したので情報共有のために投稿します。

前提

  • Nuxt.js v2.14.0
  • Nuxt.js 用の Google タグ マネージャー モジュール
    @nuxtjs/gtm v2.4.0
    https://github.com/nuxt-community/gtm-module
  • GTMにて「Google アナリティクス ユニバーサル アナリティクス」を設置

どういう事象が起こっていたか?

  1. Google広告から会員登録LPページにランディング
    GAのリアルタイムレポートで確認して、この時点ではgoogle/cpcで計測されている
  2. 項目を入力
  3. 登録ボタンを押下して、完了ページへ移動
    この時点でgoogle/cpcのセッションが失われて、新たにgoogle/organicのセッションが発生。
    CVはgoogle/organicで発生したと計測される。

解決方法

参考ページをもとに解決済みです。

1. GTMにてカスタムHTMLタグを用いて、以下のJSを設置

<script type="text/javascript">
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
  originalLocation: document.location.protocol + '//' +
                    document.location.hostname +
                    document.location.pathname +
                    document.location.search
});
</script>

2. ユーザ定義変数にて、1.で設定したoriginalLocationをGTMで使用できるように、変数を設定

スクリーンショット 2022-12-29 17.32.34.png

3. カスタム JavaScript 変数を作成する

function() {
  return {{Data Layer Variable - originalLocation}} || window.location.protocol + '//' + window.location.hostname + window.location.pathname + window.location.search;
}

{{Data Layer Variable - originalLocation}}は2.で作成した変数です。

スクリーンショット 2022-12-29 17.34.11.png

4. GAユニバーサルに3.で作成した変数をアタッチする

スクリーンショット 2022-12-29 17.36.23.png

5. 上記を公開し、CVがorganicで計測されないことを確認できました!

参考ページ

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?