Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable metrics for CJA #302

Merged
merged 6 commits into from
Oct 8, 2024
Merged

Enable metrics for CJA #302

merged 6 commits into from
Oct 8, 2024

Conversation

slitviachenko
Copy link
Collaborator

@slitviachenko slitviachenko commented Oct 1, 2024

Description

Enable metrics for CJA

Related Issue

https://jira.corp.adobe.com/browse/SITES-25865

Motivation and Context

How Has This Been Tested?

Open: https://experience-qa.adobe.com/?devMode=true&shell_source=workspace&workspace=enablemetricsforcja&shell_ims=prod#/@sitesinternal/aem/generate-variations/
Examine /ingest network calls:

Screenshot 2024-10-04 at 4 16 49 PM

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@slitviachenko slitviachenko self-assigned this Oct 1, 2024
@yashrajendra
Copy link
Collaborator

Hi @slitviachenko

Here is my detailed comment on this PR:

  1. Please use the method metrics.trackEvent, rather than using metrics.track

  2. I am assuming the event you are trying to add is on the click of Generate Variations Button Click in your application, For that here is a payload which explains the use of each and every attribute

metrics.trackEvent({
    "element": "The element within the feature/widget/component that they user interacted with",
    "type": "This type of element that the user interacted with",
    "action": "The type of interaction the user engaged in, such as a click, submit, or error",
    "widget": {
        "name": "The parent grouping name of elements being interacted with",
        "type": "The parent grouping type of elements being interacted with"
    },
    "feature": "The feature that the widget & element or page being interacted with belongs to",
    }
)
  1. followed by this here is another payload which i have drafted for your usecase and you can send it as part of your tracking call on click of Generate Variations.
metrics.trackEvent({
    "element": "Generate Variations",
    "type": "button",
    "action": "click",
    "widget": {
        "name": "Prompt Templates",
        "type": "NA"
    },
    "feature": "GenAI in Generate Variations",
    }
)

@slitviachenko
Copy link
Collaborator Author

@yashrajendra,
I followed the instructions you left in your comment above and adjusted the PR accordingly. However, the page.solution is still empty, and I noticed that it wasn’t specified in your example.
Could you please check the PR? It seems some additional configuration might still be needed.
Screenshot 2024-10-03 at 10 53 53 PM

The PR was deployed on https://experience-qa.adobe.com/?devMode=true&shell_source=workspace&workspace=enablemetricsforcja&shell_ims=prod#/@sitesinternal/aem/generate-variations/
You can use it to examine the calls to /ingest

@yashrajendra
Copy link
Collaborator

Hi @slitviachenko

I tested your PR and like you, even i got page and user objects empty,

But this was on QA environment, But when i tested my PR it was on Production Environment.

Can you please try testing it on Production once, It could be some information might not be available on production.
Please let me know once you do it, I will quickly check your data on production.

@slitviachenko slitviachenko merged commit 75bda7d into main Oct 8, 2024
3 checks passed
@slitviachenko slitviachenko deleted the Enable-metrics-for-CJA branch October 8, 2024 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants