Skip to content

add trigger custom click event - #70

Merged
Garneauma merged 1 commit into
ServiceCanada:mainfrom
bblaisATcoveo:441000
Jul 8, 2026
Merged

add trigger custom click event#70
Garneauma merged 1 commit into
ServiceCanada:mainfrom
bblaisATcoveo:441000

Conversation

@bblaisATcoveo

Copy link
Copy Markdown
Contributor

TEST CASE 1 :

  • Perform a search that fires a trigger (like 'signin')
  • Make sure the trigger is displayed at the top of the results page
  • click on a link in the trigger and make sure a custom event is sent at that moment using Chrome debug/network tool
  • validate the event from the visit browser

@bblaisATcoveo
bblaisATcoveo requested a review from a team June 3, 2026 14:36
@GormFrank GormFrank added this to the 1.10.0 milestone Jun 11, 2026
@GormFrank
GormFrank requested a review from Garneauma June 18, 2026 19:15
@Garneauma

Garneauma commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

@bblaisATcoveo Est-ce que ce qui suit est le genre de payload qui devrait être dans l'évènement triggered?

{
    "language": "en",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36",
    "originContext": "Search",
    "originLevel1": "canada-gouv-public-websites",
    "originLevel2": "default",
    "originLevel3": "/en/sr/srb.html",
    "splitTestRunName": "Canada public websites - Gene...-mirror-1733855881",
    "splitTestRunVersion": "Canada public websites - Generic",
    "customData": {
        "context_searchPageUrl": "/en/sr/srb.html",
        "context_searchPageRelativeUrl": "/en/sr/srb.html",
        "coveoHeadlessVersion": "2.52.0",
        "triggerLinkUrl": "https://www.coveo.com/"
    },
    "facetState": [],
    "anonymous": false,
    "clientId": "4eba2bf7-d22b-4090-8e41-51b443695d36",
    "eventType": "queryPipelineNotificationTrigger",
    "eventValue": "click",
    "lastSearchQueryUid": "a5e2c7db-e762-4403-a28f-05cdc99ddf01"
}

C'est un peu difficile à évaluer puisqu'aucun nom de propriété match l'évènement qui est envoyé dans connector.js (type, meta, evt), mais c'est la différence que j'ai remarqué avec la version released. Merci!

Si c'est bien cela, c'est approuvé.

@bblaisATcoveo

Copy link
Copy Markdown
Contributor Author

@Garneauma oui c'est bien l'événement attendu, on regarde "eventType" et "eventValue" pour confirmer que c'est bien un click sur un trigger.

GormFrank
GormFrank previously approved these changes Jun 25, 2026
BeraJosh
BeraJosh previously approved these changes Jun 25, 2026

@BeraJosh BeraJosh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, thank you!

@GormFrank
GormFrank dismissed stale reviews from BeraJosh and themself via 9c88213 June 26, 2026 17:19
@GormFrank

GormFrank commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

I simply resolved the merge conflict.

@cfoss-coveo Please review and test. Once (and if) we receive positive feedback from you, this PR can be merged by @Garneauma. Thanks!

Comment thread src/connector.js
Comment thread src/connector.js

@cfoss-coveo cfoss-coveo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to approve to get this out the door, but in my testings, the logging wasn't 100% reliable.

I think what's happening is on page navigation (i.e., clicking a link), the browser cancels all pending requests. This includes the request logging the custom trigger event. The suggested changes just pauses page navigation briefly for the analytics event to be logged.

@cfoss-coveo

Copy link
Copy Markdown
Contributor

@GormFrank @Garneauma This is safe to deploy, but see my comment above.

@Garneauma

Copy link
Copy Markdown
Contributor

@cfoss-coveo We'll leave as-is for now as this needs to get out. We'll have to keep this in mind if we have issues with event logs.

@Garneauma

Copy link
Copy Markdown
Contributor

@ServiceCanada/sc-release-management For your review.

@BeraJosh BeraJosh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, thank you

@Garneauma
Garneauma merged commit 2d359cc into ServiceCanada:main Jul 8, 2026
1 check passed
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.

5 participants