2
1

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.

GAのイベントトラッキングで"このページをApp Storeで開きますか?"というモーダルが出る

Last updated at Posted at 2016-12-12

この記事はGoogle Analytics 4ではなく、Universal Analyticsを対象としています。

appstpre.png

GAのhitCallbackを併用すると出る模様。

ga('send', 'event', 'category', 'action', {
	hitCallback: function() {
		location.href = APPSTORE_URL
	}
});

とりあえずhitcallbackを使わず、setTimeoutで通常のイベント処理後に遅延(300ms)遷移することで回避。

ga('send', 'event', 'category', 'action')
setTimeout(function(){
	location.href = APPSTORE_URL
},300)

リダイレクトを挟んで、イベント数とリダイレクトのカウント数を比較したところ2割程度の欠落が確認できた。(iOS)
以前hitcallback利用での欠落を調査した際も2割程度の欠落率だったので、300msでの遅延遷移でも問題はなさそう。

2
1
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
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?