3
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.

StripeのPayment Linksで、UTMコードを設定してGoogle Analyticsでキャンペーンデータを収集をする

Last updated at Posted at 2022-05-20

広告やSNSでのキャンペーンでは、Google Analyticsを利用した効果測定を行うことがあります。

この記事では、StripeのPayment Linksを利用した決済で、URLにキャンペーンパラメータを追加してトラッキングする方法を紹介します。

トラッキングをするために必要な、Payment Linksの設定

Payment Linksで支払いリンクを作成する場合、Google Analyticsでのトラッキングは「注文完了後のページ」で実施します。

そのため、支払いリンクを作成する際には、[Stripeが用意する確認ページ]を表示しない設定にする必要があります。

スクリーンショット 2022-05-16 15.15.26.png

キャンペーンデータの文字列は、「アクセスがあったURLにデータが含まれていれば、それを自動的に追加」します。

そのため、設定画面ではutm_xxxを事前に登録する必要はありません。

トラッキングの流れ

決済や申し込みが完了すると、リダイレクト先として指定したURLに、キャンペーンデータのクエリ文字列が追加された状態でリダイレクトされます。

// 支払いリンクのURL
https://buy.stripe.com/test_xxxx?utm_medium=earned-email&utm_source=marketo&utm_campaign=campaign-a&utm_content=content-b&utm_term=click-link-c

// 決済完了後に移動するURL
https://example.com?utm_medium=earned-email&utm_source=marketo&utm_campaign=campaign-a&utm_content=content-b&utm_term=click-link-c

Google Analyticsでは、「リダイレクト先に指定したページへのアクセス」でトラッキングや分析を行いましょう。

(2022/5時点)コンビニ決済では、トラッキングができません

Google Analyticsでのトラッキングには、決済完了後にリダイレクトさせる必要があります。

そのため、「コンビニ決済での支払い方法ページ」にリダイレクトされてしまう「コンビニ決済」では、このトラッキング方法が利用できません。

サポートしているパラメータ

2022/5時点でサポートしているには、以下の項目です。

  • utm_source
  • utm_content
  • utm_medium
  • utm_term
  • utm_campaign

それぞれの値については、Google Analyticsのヘルプ記事をご確認ください。

[PR] Stripe開発者向け情報をQiitaにて配信中!

  • [Stripe Updates]:開発者向けStripeアップデート紹介・解説
  • ユースケース別のStripe製品や実装サンプルの紹介
  • Stripeと外部サービス・OSSとの連携方法やTipsの紹介
  • 初心者向けのチュートリアル(予定)

など、Stripeを利用してオンラインビジネスを始める方法について週に2〜3本ペースで更新中です。

-> Stripe Organizationsをフォローして最新情報をQiitaで受け取る

3
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
3
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?