Expand my Community achievements bar.

recommandations

Avatar

Level 1

if visitor comes back to home page show recently viewed tour/package in a card and two promotion tour offers in footer slot using recommendation.

Conversion – click on recommendation cards.  

12 Replies

Avatar

Community Advisor

@ManasaKo1  Can you elaborate on what your question is?

Avatar

Level 1

Actually

if visitors are from HYD show 40 % on home page hero banner, if visitor is from BLR show 50% discount on hero banner.

Conversion is click on the promo banner

Once visitor search and land on search details page - if visitor source is HYD then show promo banner with 40% off, if source is BLR show 50% promo banner in head section

Conversion – Clicks on Promo banner

if visitor comes back to home page show recently viewed tour/package in a card and two promotion tour offers in footer slot using recommendation.

Conversion – click on recommendation cards.  
this is my task I completed previous two After that I created one recommandation Activity and choose home page after I had bus_tour collection I only created this one design,  feed, created but I did not get products recently viewed products in the new tab

 

Avatar

Community Advisor

@ManasaKo1 Here's my understanding of what you've done so far/the expected journey:

The activity you've created involves displaying different promotions based on the visitor's location:

  • If a visitor is from Hyderabad (HYD), a 40% discount banner is shown on the homepage hero section.
  • If a visitor is from Bangalore (BLR), a 50% discount banner is displayed instead.
  • The conversion goal here is for users to click on the promo banner.

When a visitor lands on the search details page:

  • If the visitor's source is HYD, they will see the 40% discount banner in the header.
  • If the source is BLR, they will see the 50% promo banner in the header.
  • Again, the conversion goal is to capture clicks on the promo banner.

Additionally, when a visitor returns to the homepage:

  • Recently viewed tours or packages are displayed in a card, along with two promotional tour offers in the footer using the recommendation system.
  • The conversion goal here is to drive clicks on the recommendation cards.

You have successfully completed the first two tasks. After which you created a recommendation activity for the homepage. You used the bus_tour collection, created the design and feed, but you weren't able to get the recently viewed products to appear in the new tab.

Is that correctly understood?

In order for Recommendation to be able to show the recently viewed products, it is required that you're collecting these through the entity.id on the product detail page. Have you implemented this?

See this thread for details on the entity.id and the implementation: https://experienceleaguecommunities.adobe.com/t5/adobe-target-questions/displaying-top-4-products-in... 

Avatar

Level 1
  async function fetchAndSendProductView() {
                 try {
                     // Fetch the products JSON file
                     const response = await fetch('packages.json');
                     const products = await response.json(); // Parse the response as JSON
     
                     // Get the product ID from the URL (assuming the format is 'product.html?id=123')
                     const productId = getQueryParam('id'); // Function to get URL parameter 'id'
                   
                     // Find the product from the fetched products by matching the product ID
                     const viewedProduct = products.find(product => product.id === productId);
     
                     if (viewedProduct) {
                         // Send the product view event to Adobe Target
                         adobe.target.trackEvent({
                             "mbox": "product-view-mbox",  // Define the mbox for tracking product views
                             "params": {
                                 "entity.id": viewedProduct.id,  // Send the product ID
                                 "entity.name": viewedProduct.description,  // Send the product name
                                 "entity.categoryId": viewedProduct.destination,  // Send the category ID (if available)
                                //  "entity.pageUrl": window.location.href,  // Send the current page URL
                                 "entity.eventType": "view"  // Define the event type as 'view'
                             }
                         });
     
                         console.log(`Product ${viewedProduct.name} (ID: ${viewedProduct.id}) tracked with Adobe Target`);
                     } else {
                         console.log(`Product with ID ${productId} not found in product list.`);
                     }
     
                 } catch (error) {
                     console.error('Error fetching products or sending to Adobe Target:', error);
                 }
             }
this is my code like this I wrote but I didnot get products in new tab  and 
two promotion tour offers in footer slot using recommendation. how shall I do to display two promotion tour offers in footer slot using recommandation

Avatar

Community Advisor

I'm not a developer, but it seems that the code is sending all the relevant entities. 

Heres the things i would look into when validating things are correct configured:

 

1. confirm products are collected correctly, if you search for the products in the product catalogue are they then showing up as expected?
Screenshot 2024-10-07 at 14.46.29.png

 

 

 

 

 

 

2. debug using mboxtrace, check what Target is returning - confirm what is being returned by Target on the page: https://experienceleaguecommunities.adobe.com/t5/adobe-target-questions/using-mboxtrace-to-debug-rec... 

I hope this helps!

ps. What if you enable backup recommendations, are they showing as expected?

Avatar

Community Advisor

Oh, and the trackEvent function will not return any activity - it will only collect conversion/behaviour.

Avatar

Level 1

Now I did backup recommandation enabled and my mbox name also changed will it take time to display products?

ManasaKo1_0-1729927506127.png

here my mbox name is not displaying

 adobe.target.trackEvent({
                             "mbox": "places-viewed-mbox",  // Define the mbox for tracking product views
                             "params": {
                                 "entity.id": viewedProduct.id,  // Send the product ID
                                 "entity.name": viewedProduct.description,  // Send the product name
                                 "entity.categoryId": viewedProduct.destination,  // Send the category ID (if available)
                                 // "entity.pageUrl": window.location.href,  // Send the current page URL
                                 "entity.eventType": "view"  // Define the event type as 'view'
                             }

mbox": "places-viewed-mbox", this is mbox name

Avatar

Community Advisor

To have Target show product recommendations you need to use the getoffer and applyoffer functions instead of the trackEvent: https://experienceleague.adobe.com/en/docs/target-dev/developer/client-side/at-js-implementation/fun... 

Avatar

Level 1
 adobe.target.getOffer({
                                    "mbox": "target-global-mbox",
                                    "params": {
                                       "entity.id": viewedProduct.id,  
                                        "entity.name": viewedProduct.description
                                       "entity.categoryId": viewedProduct.destination,  
                                         "entity.eventType": "view"
                                      },
                                    "success": function(offer) {
                                       adobe.target.applyOffer( {
                                       "mbox": "target-global-mbox",
                                        "offer": offer
                                       } );
                                    },
                                     "error": function(status, error) {
                                    console.log('Error', status, error);
                               }
                            });
I changed  my code as you said eventhough I didnot get my products

Avatar

Level 1

products displayed in catalog,
 when I am doing debugging my frnd products will be displayed instead of my products  

Avatar

Level 7

Hi @ManasaKo1 , 

 

We have prepared a blog and a detailed documentation on how to configure Adobe Target recommendations. It also includes the detailed configuration steps of Recently viewed Recommendations which might help you in configuring it correctly. 

 

https://dexata.co/driving-business-growth-by-leveraging-power-of-recommendations/

 

Please have a look and let me know if it helps.

 

Thanks and Regards, 

Vaibhav Mathur

Avatar

Level 1

as of now I used adobetarget trackevent now I changed to targetPagepParams because I was working on Recently viewed algorithm I added pageUrl in csv so it will take time to update csv so I will wait for tomorrow morning and then also If  I didnot get  I will ping you again

Thank you