Legacy Knowledge Base
公開されました Jun. 30, 2025

LiferayでAnalytics Cloudのカスタムイベントを作成/利用できるのはどこですか?

Written By

Rita Schaff

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

問題

  • Liferay DXPインスタンスからAnalytics Cloudにカスタムイベントを送信したい。
  • どうすればいいのでしょうか。

Environment

  • Liferay DXP
  • Analytics Cloud

解決策

それ以外のものについては、LiferayのJavascriptをサポートする以下のような機能を使って、Custom Eventsを使用することができます。

  • Pages' Javascript field
    Site Builder → Public Pages → Configuration ⛩ icon → Advanced tab → Javascript field
    ここに入力したスクリプトは、ページを表示するたびにすべての Public ページで実行されます。
    ページ__JavaScript_field.png
  • ウェブコンテンツ ソース内にスクリプトを含む記事
    1. HTMLフィールドを持つ構造を持つWebコンテンツ記事を作成する
    2. ソース のビューに変更します。
    3. スクリプトを入力する
    4. ウェブコンテンツの記事を公開する
    5. ページ内に表示する
    6. 記事が表示されるたびに、スクリプトが呼び出されます。
    Web_Content_Source_Field.png
  • フラグメントのJavaScriptフィールド
    デザイン → フラグメント → 新規フラグメントの作成 → JavaScriptフィールド
    Webコンテンツの記事と同様に、フラグメントをページに表示させてスクリプトを呼び出す必要があります。
    フラグメント_JavaScript_Field.png

ページのJavaScriptフィールドにスクリプトを記述するのが一般的な方法です。 しかし、必要なものによっては、フラグメントやウェブコンテンツの記事を使用する方が効果的です。

追加情報

Did this article resolve your issue ?

Legacy Knowledge Base