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

Getting QueryID for events #128

Closed
agustinlacuara opened this issue Feb 23, 2024 · 4 comments
Closed

Getting QueryID for events #128

agustinlacuara opened this issue Feb 23, 2024 · 4 comments

Comments

@agustinlacuara
Copy link

I'm having trouble getting the queryId from HitsSearch in my Flutter App (Im using Flutter Helper and Algolia Insights as docs recommend).

In my pubspec.yaml:

algolia_helper_flutter: ^1.0.0-pre
algolia_insights: ^1.0.0-pre

This is how I set my HitsSearcher

final _productsSearcher = HitsSearcher(
        applicationID: Environment.algoliaApplicationId,
        apiKey: Environment.algoliaSearchOnlyKey,
        indexName: Environment.algoliaProductsHitsIndex,
        insights: true, ← Here activating insights to get queryId in every query.
);

Also added this in the paginationController to see if it works:

_pagingController.addPageRequestListener(
        (pageKey) => _productsSearcher.applyState(
               (state) => state.copyWith(
                     clickAnalytics: true, ← Here activating click analytics
                     analytics: true, ← Here activating analytics
                     page: pageKey,
                     ruleContexts: [widget.algoliaContext],
               ),
        ),
);

Now, the problem is that, as defined in the SearchResponse model from the Flutter Helper package, it should have (if the setup is ok) a response.queryID.

This parameter is optional in the model, but can't get it to be returned.

Also, I found out that _productSearcher has a field called queryId (which is also optional) and again, cant get it to be else than null.

So, after tryng to find queryId I found out that there are more than one place where it can be reached from. But from any of those I always get a null as queryId.

This is a mandatory input for the click and conversion events after search. Which are really important for the personalization. So i beleive there ir something missing from my configs. But docs for this functionality is still in progress i assume.

Expected behavior 💭

  • Receive queryId after every search

Environment:

  • OS: Develping in windows - Testing in android.
  • Library Version 1.0.0-pre and 0.5.0
@SdxCoder
Copy link

SdxCoder commented Mar 4, 2024

Experiencing the same issue, as you can see below there is no queryID key in raw object.
Screenshot 2024-03-04 at 12 22 26 PM

cc @aallam

@agustinlacuara
Copy link
Author

Seems to be merged for next release!
algolia/api-clients-automation#2801

@aallam
Copy link
Member

aallam commented Mar 5, 2024

Version 1.5.1 is released with the fix :)

@agustinlacuara
Copy link
Author

To access this new parameter, there is no need to update algolia_flutter_helper package.
SearchResponse.queryId is now working correctly!

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

No branches or pull requests

3 participants