Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Question about RecommendationId

Vote:
 

Hello,

Using native integration, we were able to track products recommendations clicks by following this documentaion: https://world.episerver.com/documentation/developer-guides/commerce/personalization/recommendations/tracking-and-recommendations/

Above documentaion assumes that customers will click on a product, returned from Perform engine, then they will be redirected to product details page where the tracking is taken place. (RecommendationId is added to the URL)

My question is how the tracking would work if AddToCart button is shown within recommened products thumbnail. The customer will not be redirected to product details page but item will be added to the cart directly. How can we show, in Perform portal, that this product was added to cart because of a recommendation by EPiServer Perform? Maybe it is happening already, I am just asking to make sure we didn't miss anything.

Thanks!

#206425
Aug 20, 2019 21:22
Vote:
 

I'd first suggest familiarising yourself with the following articles

  1. https://world.episerver.com/documentation/developer-guides/commerce/personalization/recommendations/an-API-overview/#the-main-flows
  2. https://world.episerver.com/documentation/developer-guides/commerce/personalization/recommendations/client-side-api-integration/
  3. https://world.episerver.com/documentation/developer-guides/commerce/personalization/recommendations/server-side-api-integration/

You don't need to rely on controller attributes etc. you can fire off tracking events however you wish. 

For a working example of using both attributes and then custom server-server tracking, look not further than Quicksilver (https://github.com/episerver/Quicksilver).

So whether you want to fire off a clientside track or any controller method track - you can do this exactly when and how you like.

#206427
Aug 21, 2019 1:20
Vote:
 

Thanks Marcus for your reply!

The working example in QuickSilver taking into consideration that item will be clicked and user will be redirected to product details page where they can get the RecommendationId from the context.

I think this same as what is mentioned in this documentation:

Marking clicks

  • If a user clicks a recommended item, the click must be tracked to generate useful recommendations. To get information about which recommendation triggered the current request, use the EPiServer.Tracking.Commerce.IRecommendationContextinterface.
    • The Quicksilver template has a class, EPiServer.Reference.Commerce.Site.Features.Recommendations.Services.RecommendationContext which implements the above interface, to track clicks on recommended products.

In our website, we have AddToCart button displayed within the recommended product thumbnail. Customer can click add to cart directly without going to product details page. How can we track that this item was added to cart because of EPiServer Perform recommendation?

#206517
Aug 22, 2019 19:18
Vote:
 

No problem. 

Check out this page: https://world.episerver.com/documentation/developer-guides/tracking/product-tracking/ - specifically the section titled 'Tracking without using the CommerceTrackingAttribute'

What you should do is

  1. Create an endpoint that your page can just JS to call to (your add to cart click will fire off a tracking request to your custom endpoint)
  2. In that endpoint you want to crete a tracking object of type 'Basket'  (i.e. var trackingData = _trackingDataFactory.CreateCategoryTrackingData(category, httpContext);)
  3. Populate your tracking object with any additional data needed to be tracked (sent as part of the JS request)
  4. Track the event (i.e. var result = _trackingService.Track(trackingData, httpContext, currentContent);)
#206524
Aug 23, 2019 4:56
Vote:
 

Makes sense Marcus!

Thanks and appreciate your help.

#206552
Aug 23, 2019 16:16
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.