Expand my Community achievements bar.

Time Difference between two events in CJA

Avatar

Level 1

Hi,

I would like to determine the duration between a user viewing the product section and subsequently clicking on the product card, assuming that both the product section viewed event and the product card click event are being captured. The objective is to calculate the time difference between these two events. Could someone kindly advise on how this can be accomplished within CJA?

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

7 Replies

Avatar

Community Advisor

Hi @RajalakshmiMathiazhagan ,

since it's two different events you are talking about, I don't think you can do this with a derived field.
This sounds more like a tag management task to start a timer when the product section is viewed and stop the timer and send the difference together with the product card click event.

Cheers from Switzerland!


Avatar

Level 1

Thanks for the suggestion, @bjoern__koth! Will try it out.

Avatar

Level 3

Hi @RajalakshmiMathiazhagan,

 

Have you checked this out? I admit I am not an expert about it, but it might be helpful. 

https://experienceleague.adobe.com/en/docs/analytics/implementation/vars/plugins/gettimebetweenevent...

 

Best regards

Filipe

 

Avatar

Level 1

This approach works for Adobe Analytics but not for CJA. Thanks for pitching in though!

Avatar

Community Advisor

Hi @RajalakshmiMathiazhagan ,

 

You can calculate time difference between events using Time Between Events metric builder in CJA. 

  1. Make Sure the Events Are Properly Captured

You must ensure:

  • product section viewed and product card clicked are distinct events (e.g., custom events or specific event names).
  • Both are part of the same person ID / session / visit — depending on your connection granularity.
  1. Create a 'Time Between Events' Metric
  • Open your CJA Analysis Workspace project.
  • In the left rail, go to Components > Metrics.
  • Click the “+” icon > Create Metric from Function.
  • Choose: "Time Between Events".
  • Now configure:

Example Settings:

  • First Event: product section viewed
  • Second Event: product card clicked
  • Granularity: Choose seconds, minutes, or hours as needed.
  • Time Range: Same day/session or as per your dataset.
  1. Name it something like Time to Click Product.
  2. Click Save.
  1. Use the Metric in Your Table or Visualization

Now you can:

  • Drag this custom metric into a freeform table.
  • Break down by Product Name, User ID, or any other dimension.
  • Optionally segment users who performed both events (to exclude drop-offs).
  1. Optional: Filter for Users Who Did Both Events

Create a segment like this:

  • Include users where:
    • Event = product section viewed
    • Followed by
    • Event = product card clicked

Apply this to your table or metric so you only get valid flows.

 

Avatar

Level 3

HI @pradnya_balvir ,

 

is this Time Between Events available to all CJA customers? I am really interest about it, but unfortunately I did not find the "Create Metric from Function" in my CJA workspace, and I am wondering why.

 

Best Regards,

Filipe Freitas

Avatar

Level 1

I agree with @FilipeFreitas. Neither of us on our team has this option available in CJA.