4
3

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 3 years have passed since last update.

Shopify初心者あれこれ(購入完了ページにスクリプトを埋め込む)

Posted at

前書き

最近、業務でShopifyを触ることが多いです。
WordPress含め、CMSはまったく触ったことがなかったので、慣れるのに時間がかかりました。
初歩的なことばかりですが、メモ&共有のために残しておきます。

本題

管理画面→設定→チェックアウト→注文処理→追加スクリプト に下記のように記載。

{% if first_time_accessed %}
  <script type="text/javascript">
    // ここに処理を書く
  </script>
{% endif %}

後書き

チェックアウト関係のページのファイル(checkout.liquid)は、Shpoify Plusプランでないといじることができないようです。代わりに上の項目が用意されているんですね。
使いそうなLiquidオブジェクトについては、参考ページをご覧ください。

参考

・Shopifyでのトラッキング設定の基本
https://threedotfive.jp/117

・注文状況ページをカスタマイズする(スクリプトを追加する)
https://help.shopify.com/ja/manual/orders/status-tracking/customize-order-status

・初回訪問時にのみスクリプトを実行する
https://help.shopify.com/ja/manual/orders/status-tracking/customize-order-status/first-time-accessed

・開発ストアでの注文のテスト
https://help.shopify.com/ja/partners/dashboard/managing-stores/test-orders-in-dev-stores

・The checkout object
https://shopify.dev/docs/themes/liquid/reference/objects/checkout

・The order object
https://shopify.dev/docs/themes/liquid/reference/objects/order

・The shop object
https://shopify.dev/docs/themes/liquid/reference/objects/shop

・注文状況ページにコンバージョントラッキングを追加する
(Google Analytics・Facebookピクセルなど)
https://help.shopify.com/ja/manual/orders/status-tracking/customize-order-status/add-conversion-tracking

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?