nozzlegear / ShopifySharp

ShopifySharp is a .NET library that helps developers easily authenticate with and manage Shopify stores.
https://nozzlegear.com/shopify-development-handbook
MIT License
743 stars 309 forks source link

Extending Orders for CustomerJourneySummary? #935

Closed patrickebates closed 11 months ago

patrickebates commented 11 months ago

Noticed that the Order object appears to be missing the CustomerJourneySummary, which among other things provides access to the UTMs associated with the order. Wanted to check if this was intentional for some reason before I try to add it myself and submit a pull request.

Additionally, is there currently a way to use your objects to add/update Tags associated with an Order? Not sure that I've seen a method that would do this.

Essentially that closes the loop on my plans. Read the UTMs and apply Tags to the Order based on some of them.

Thanks.

clement911 commented 11 months ago

Regarding your first question, what about CustomerJourneySummary.firstVisit|lastVisit.utmParameters?

patrickebates commented 11 months ago

Exactly what I'm trying to get to. Unless I'm overlooking them, they don't currently exist in the objects of ShopifySharp. At least I can't find them in Object Browser.

clement911 commented 11 months ago

It's actually already in the code base but not yet release to nuget.

See https://github.com/nozzlegear/ShopifySharp/blob/0ad9cee2c81de00d8c7a3660dc627b9aec4a5cfc/ShopifySharp/Entities/GraphQL/GraphQLSchema.generated.cs#L10332

Interestingly it will likely be in the next release, pending @nozzlegear approval.

That being said, you can use the GraphService today to issue any graphQL query. You just won't get strongly typed support.

patrickebates commented 11 months ago

That's promising. Is there a sample somewhere of performing a query with the GraphService? I'm not seeing anything right off.

clement911 commented 11 months ago

Here is an example: https://github.com/nozzlegear/ShopifySharp/blob/c2a52cd7e997723685f51d42e13e7c9f000afd6b/ShopifySharp.Tests/DateTime_Tests.cs#L28

patrickebates commented 11 months ago

Thanks much. Got the calls made, just turns out that all of the CustomerJourney data is null if the sale is done via Buy Button links.

Back to the drawing board...