> Synerise Documentation — Use Cases (Part 2 of 3) > > This is part 2 of 3 of the "Use Cases" section. To reconstruct the full section, fetch all 3 parts in order (part 1, part 2, …) and concatenate them. Each article begins with a top-level "# " heading. The manifest listing all sections is at https://hub.synerise.com/llms-full.txt # Cross-sell recommendations with category tabs based on last purchased product This use case presents cross-sell recommendations based on the customer's most recently purchased product. The section displays the last purchased item (or items) together with complementary product recommendations from different categories. Recommended products are grouped into categories and presented as tabs. This allows users to browse complementary items by switching between category views instead of scrolling through a single list. The goal is to make post-purchase recommendations easier to explore while maintaining contextual relevance to the last transaction. The setup is based on three elements: - an aggregate identifying the most recently purchased product, - a product catalog to retrieve product attributes and display information, - cross-sell recommendation models generating complementary items for each purchased product.
Quantity in stock
## Prerequisites --- - Implement a [tracking code](/developers/web/installation-and-configuration) on your website or application. - Implement [transaction events](/developers/web/transactions-sdk) with product details. - Configure the [AI recommendation engine](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations) with a cross-sell model enabled. - Maintain an updated product [catalog/feed](/docs/ai-hub/recommendations-v2/item-feed-requirements). To display purchased products and recommendations correctly: - Remember to have **category** attribute in the catalog. - Verify that the product catalog contains identifiers consistent with transaction events. - Confirm that product attributes such as name, image, price, and category are available. - Make sure the feed is regularly updated. This enables proper rendering of both the purchased product and recommended items. ## Process --- 1. Create [an aggregate](/use-cases/cross-sell-with-tabs#create-an-aggregate). 2. Create [cross sell recommendation](/use-cases/cross-sell-with-tabs#create-cross-sell-recommendation). 3. Create [dynamic content campaign](/use-cases/cross-sell-with-tabs#create-dynamic-content-campaign). ## Create an aggregate --- In the first part of the process, identify the most recently seen product for each customer, creating an aggregate. This aggregate will be used later as context for recommendations. 1. Go to **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. Select **Profile aggregate**. 3. Enter a name, for example `Last seend products`. 4. Set **Analyze profiles by** to **Last Multi**. 5. Set up the size as **3 items**. 5. Select the **page.visit** event. 6. As the event parameter, select the product identifier (for example `product:reatiler_part_no`). 7. Click **+ and where** and choose the parameter which cointains product identifier (for example `product:reatiler_part_no`). 8. As the operator set up Boolean: **is true.** 7. Set the date range to **Lifetime**. 8. Save the aggregate.
Quantity in stock
## Create cross sell recommendation --- Next, configure a recommendation model that returns cross-sell products. 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. Enter the name of the recommendation (it is only visible on the list of recommendations). 3. In the **Type & Items Feed** section, click **Define**. 4. From the **Items Feed** dropdown list, select an item feed. 5. In the **Type** section, choose the **Cross-sell** recommendation type. 6. Confirm the settings by clicking **Apply**. 7. In the **Items** section, click **Define**. 2. Define the minimum and maximum number of items that will be recommended to the customer in each slot - here it will be from 8 to 20 items. 3. Define [Static filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#static-filters). 4. In our case, in the **Static filter** section, click **Define filter**. 5. Select **Visual Builder**. 6. Click **Select value**. 5. Choose **category**. 6. As an operator, choose **is defined**. 4. Confirm by clicking **Apply**.
Quantity in stock
7. In the **Slots and items ordering** section, click **Define**. 2. Choose the option **Arrange items ignoring slots and their order**. 4. Confirm by clicking **Apply**. 8. Optionally, you can define the **Boosting** factors and settings in the **Additional settings** sections. 9. In the **Additional settings** section, choose **Exclude already bought products**. If your company sells replenishable products, you can set exclusion for specific number of days, for example, exclude products bought not later than 30 days ago. 9. In the right upper corner, click **Save**. 10. Copy the recommendation ID from its URL to use it in [dynamic content campaign](#create-dynamic-content-campaign). ## Create dynamic content campaign --- In this part of the process create the dynamic content witha carousel with tabs, presenting cross-sell products from each category, which might be bought with the one of the 3 last seen products by the customer. 1. Go to **Experience Hub > Dynamic content > Create new**. 2. Enter the name of the dynamic content. 3. Choose the **Insert Object** type. 4. In the **Audience** section, select **Everyone**. ### Define content 1. In the **Content** section click **Create message** and choose the code editor. 2. You can use this basic code presented below to define the basic assumptions and dependencies in JavaScript so that dynamic content works correctly. You can use a basic HTML code, but **remember to replace the ID of [the aggregate from the previous step](#create-an-aggregate) as well as the ID of the [AI recommendation](#create-cross-sell-recommendation).** You can style this campaign according to your own business needs. HTML section details: - Get last boght products - Get recommendations for each of the last bought products - For each last bought product: get info about product from catalog - Group products for each recommendation by categories (lowest level) - Build tabs - the first is active by default - Display recommended products - Add styles controlling the tabs
Check the HTML code
<!-- 1. Get last boght products --> {% set lastBoughtProducts = []%} {% aggregate 245aa662-d642-352e-acef-18198604ac13 %} {%- for item in aggregate_result -%} {% do lastBoughtProducts.append(item)%} {%- endfor -%} {% endaggregate %} <!-- 2. Get recommendations for each of the last bpugt products --> {% set productsWithCrossSell = [] %} {%- for p in lastBoughtProducts -%} {% set itemContext = []%} {% do itemContext.append(p)%} {% recommendations3 campaignId=VR6SOFcDEbAg itemsIds=itemContext %} {% set prodObj = { "id": p, "crossSell": recommended_products3 }%} {%do productsWithCrossSell.append(prodObj)%} {% endrecommendations3 %} {%- endfor -%} <div class="cross-sell-wrapper unique-identifier"> <div class="left-carousel-wrapper"> <!-- 3. For each last bought product: get info about product from catalog --> <div class="snrs-left-carousel-header">Last bought</div> <div class="left-carousel my-main-carousel"> {% for product in productsWithCrossSell %} {% set key = product.id %} {% catalogitemv2.store-1(key) allowEmpty=true %} {% set object = catalog_result %} {% set name = object.name %} {% set img = object.image %} <div class="carousel-item" data-product-id="{{ product.id }}"> <img src="{{img}}""> <!-- <p class="snrs-prod-title">{{name}}</p> --> </div> {% endcatalogitemv2 %} {% endfor %} </div> </div> <div class="right-tabs-wrapper"> <!-- 4. Group products form each reco by categories (lowest level) --> {% for product in productsWithCrossSell %} {% set prodCategories = [] %} {% set categoryGroups = [] %} {% for p in product.crossSell %} {% set category = p.category|split(">")|last %} {% if prodCategories is not containing category %} {% do prodCategories.append(category) %} {% endif %} {% endfor %} {% for category in prodCategories %} {% set prodsArray = [] %} {% for p in product.crossSell %} {% set cat = p.category|split(">")|last %} {% if category == cat %} {# {% do prodsArray.append(p.itemId) %}#} {% do prodsArray.append(p) %} {% endif %} {% endfor %} {% set categoryWithProds = { "category": category, "products": prodsArray } %} {% do categoryGroups.append(categoryWithProds) %} {% endfor %} <!-- 5. Build tabs - the first is active by default --> <div class="product-tabs" data-product-id="{{ product.id }}"> {% set rangeMax = categoryGroups|length + 1%} {% for i in range(1, rangeMax) %} <input type="radio" name="tab-{{ product.id }}" id="tab-{{ product.id }}-{{ i }}" {% if i == 1 %}checked{% endif %}> {% endfor %} <div class="tab-labels"> {% for catGroup in categoryGroups %} {% set i = loop.index %} <label for="tab-{{ product.id }}-{{ i }}" class="tab-label">{{ catGroup.category }}</label> {% endfor %} </div> <!-- 6. Display reco products --> <div class="tab-contents"> {% for catGroup in categoryGroups %} {% set i = loop.index %} <div class="tab-content"> <div class="products-carousel"> {#{% for itemId in catGroup.products %} <div class="cross-sell-item"> Produkt ID: {{ itemId }} </div> {% endfor %}#} {% for p in catGroup.products %} <a href="{{p.productUrl}}" class="cross-sell-item"> <img src="{{p.image}}"> <p class="snrs-prod-title">{{p.name}}</p> <p class="snrs-prod-price">${{p.price}}</p> </a> {% endfor %} </div> </div> {% endfor %} </div> </div> <!-- 7. Styles controlling the tabs --> <style> {% for product in productsWithCrossSell %} {% set prodCategories = [] %} {% for p in product.crossSell %} {% set category = p.category|split(">")|last %} {% if prodCategories is not containing category %} {% do prodCategories.append(category) %} {% endif %} {% endfor %} {% set rangeMax = categoryGroups|length + 1%} {% for i in range(1, rangeMax) %} #tab-{{ product.id }}-{{ i }}:checked ~ .tab-labels .tab-label:nth-of-type({{ i }}), #tab-{{ product.id }}-{{ i }}:checked ~ .tab-contents .tab-content:nth-of-type({{ i }}) { display: block; } {% endfor %} {% endfor %} </style> {% endfor %} </div> </div> {% endfor %}
JS section details: - Add carousel library - Build carousel for products based on the aggregate result - Sync tabs with carousels - Init recomendation carousels
Check the JS code
(function(){ 'use strict'; // 1. Add carousel library var tns=function(){function e(){for(var e,t,n,i=arguments[0]||{},a=1,r=arguments.length;a<r;a++)if(null!==(e=arguments[a]))for(t in e)n=e[t],i!==n&&void 0!==n&&(i[t]=n);return i}function t(e){return["true","false"].indexOf(e)>=0?JSON.parse(e):e}function n(e,t,n){return n&&localStorage.setItem(e,t),t}function i(){var e=window.tnsId;return window.tnsId=e?e+1:1,"tns"+window.tnsId}function a(){var e=document,t=e.body;return t||(t=e.createElement("body"),t.fake=!0),t}function r(e){var t="";return e.fake&&(t=P.style.overflow,e.style.background="",e.style.overflow=P.style.overflow="hidden",P.appendChild(e)),t}function o(e,t){e.fake&&(e.remove(),P.style.overflow=t,P.offsetHeight)}function s(e){var t=document.createElement("style");return e&&t.setAttribute("media",e),document.querySelector("head").appendChild(t),t.sheet?t.sheet:t.styleSheet}function l(e,t,n,i){"insertRule"in e?e.insertRule(t+"{"+n+"}",i):e.addRule(t,n,i)}function c(e){return("insertRule"in e?e.cssRules:e.rules).length}function u(e,t){return Math.atan2(e,t)*(180/Math.PI)}function f(e,t){var n=!1,i=Math.abs(90-Math.abs(e));return i>=90-t?n="horizontal":i<=t&&(n="vertical"),n}function d(e,t){return e.className.indexOf(t)>=0}function v(e,t){d(e,t)||(e.className+=" "+t)}function h(e,t){d(e,t)&&(e.className=e.className.replace(t,""))}function p(e,t){return e.hasAttribute(t)}function m(e,t){return e.getAttribute(t)}function y(e){return void 0!==e.item}function g(e,t){if(e=y(e)||e instanceof Array?e:[e],"[object Object]"===Object.prototype.toString.call(t))for(var n=e.length;n--;)for(var i in t)e[n].setAttribute(i,t[i])}function b(e,t){e=y(e)||e instanceof Array?e:[e],t=t instanceof Array?t:[t];for(var n=t.length,i=e.length;i--;)for(var a=n;a--;)e[i].removeAttribute(t[a])}function x(e){e.style.cssText=""}function T(e){p(e,"hidden")||g(e,{hidden:""})}function E(e){p(e,"hidden")&&b(e,"hidden")}function C(e){return e.offsetWidth>0&&e.offsetHeight>0}function w(e){return"boolean"==typeof e.complete?e.complete:"number"==typeof e.naturalWidth?0!==e.naturalWidth:void 0}function N(e){for(var t=document.createElement("fakeelement"),n=(e.length,0);n<e.length;n++){var i=e[n];if(void 0!==t.style[i])return i}return!1}function O(e,t){var n=!1;return/^Webkit/.test(e)?n="webkit"+t+"End":/^O/.test(e)?n="o"+t+"End":e&&(n=t.toLowerCase()+"end"),n}function D(e,t){for(var n in t){var i=("touchstart"===n||"touchmove"===n)&&W;e.addEventListener(n,t[n],i)}}function k(e,t){for(var n in t){var i=["touchstart","touchmove"].indexOf(n)>=0&&W;e.removeEventListener(n,t[n],i)}}function A(){return{topics:{},on:function(e,t){this.topics[e]=this.topics[e]||[],this.topics[e].push(t)},off:function(e,t){if(this.topics[e])for(var n=0;n<this.topics[e].length;n++)if(this.topics[e][n]===t){this.topics[e].splice(n,1);break}},emit:function(e,t){this.topics[e]&&this.topics[e].forEach(function(e){e(t)})}}}function M(e,t,n,i,a,r,o){function s(){r-=l,u+=f,e.style[t]=n+u+c+i,r>0?setTimeout(s,l):o()}var l=Math.min(r,10),c=a.indexOf("%")>=0?"%":"px",a=a.replace(c,""),u=Number(e.style[t].replace(n,"").replace(i,"").replace(c,"")),f=(a-u)/r*l;setTimeout(s,l)}Object.keys||(Object.keys=function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}),function(){"use strict";"remove"in Element.prototype||(Element.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this)})}();var P=document.documentElement,I=!1;try{var S=Object.defineProperty({},"passive",{get:function(){I=!0}});window.addEventListener("test",null,S)}catch(e){}var W=!!I&&{passive:!0},H=navigator.userAgent,L=!0,z={};try{z=localStorage,z.tnsApp&&z.tnsApp!==H&&["tC","tSP","tMQ","tTf","tTDu","tTDe","tADu","tADe","tTE","tAE"].forEach(function(e){z.removeItem(e)}),z.tnsApp=H}catch(e){L=!1}localStorage||(z={});var B=document,R=window,j={ENTER:13,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40},q=t(z.tC)||n("tC",function(){var e=document,t=a(),n=r(t),i=e.createElement("div"),s=!1;t.appendChild(i);try{for(var l,c=["calc(10px)","-moz-calc(10px)","-webkit-calc(10px)"],u=0;u<3;u++)if(l=c[u],i.style.width=l,10===i.offsetWidth){s=l.replace("(10px)","");break}}catch(e){}return t.fake?o(t,n):i.remove(),s}(),L),G=t(z.tSP)||n("tSP",function(){var e,t,n=document,i=a(),s=r(i),l=n.createElement("div"),c=n.createElement("div");return l.style.cssText="width: 10px",c.style.cssText="float: left; width: 5.5px; height: 10px;",e=c.cloneNode(!0),l.appendChild(c),l.appendChild(e),i.appendChild(l),t=c.offsetTop!==e.offsetTop,i.fake?o(i,s):l.remove(),t}(),L),F=t(z.tMQ)||n("tMQ",function(){var e,t=document,n=a(),i=r(n),s=t.createElement("div"),l=t.createElement("style"),c="@media all and (min-width:1px){.tns-mq-test{position:absolute}}";return l.type="text/css",s.className="tns-mq-test",n.appendChild(l),n.appendChild(s),l.styleSheet?l.styleSheet.cssText=c:l.appendChild(t.createTextNode(c)),e=window.getComputedStyle?window.getComputedStyle(s).position:s.currentStyle.position,n.fake?o(n,i):s.remove(),"absolute"===e}(),L),U=t(z.tTf)||n("tTf",N(["transform","WebkitTransform","MozTransform","msTransform","OTransform"]),L),X=t(z.tTDu)||n("tTDu",N(["transitionDuration","WebkitTransitionDuration","MozTransitionDuration","OTransitionDuration"]),L),V=t(z.tTDe)||n("tTDe",N(["transitionDelay","WebkitTransitionDelay","MozTransitionDelay","OTransitionDelay"]),L),Y=t(z.tADu)||n("tADu",N(["animationDuration","WebkitAnimationDuration","MozAnimationDuration","OAnimationDuration"]),L),K=t(z.tADe)||n("tADe",N(["animationDelay","WebkitAnimationDelay","MozAnimationDelay","OAnimationDelay"]),L),Q=t(z.tTE)||n("tTE",O(X,"Transition"),L),J=t(z.tAE)||n("tAE",O(Y,"Animation"),L);F||(G=!1);var Z=function(t){function n(){return R.innerWidth||B.documentElement.clientWidth||B.body.clientWidth}function a(e){var t;do{t=e.clientWidth,e=e.parentNode}while(!t);return t}function r(e){var n=t[e];return!n&&gt&&yt.indexOf(e)>=0&&gt.forEach(function(t){mt[t][e]&&(n=!0)}),n}function o(e,n){n=n?n:xt;var i,a={slideBy:"page",edgePadding:!1,autoHeight:!0};if(!tt&&e in a)i=a[e];else if("items"===e&&o("fixedWidth"))i=Math.floor(pt/(o("fixedWidth")+o("gutter")));else if("autoHeight"===e&&"outer"===kt)i=!0;else if(i=t[e],gt&&yt.indexOf(e)>=0)for(var r=0,s=gt.length;r<s;r++){var l=gt[r];if(!(n>=l))break;e in mt[l]&&(i=mt[l][e])}return"slideBy"===e&&"page"===i&&(i=o("items")),i}function y(e){return q?q+"("+100*e+"% / "+qt+")":100*e/qt+"%"}function N(e,t,n){var i="";if(e){var a=e;t&&(a+=t),i=n?"margin: 0px "+(pt%(n+t)+t)/2+"px":lt?"margin: 0 "+e+"px 0 "+a+"px;":"padding: "+a+"px 0 "+e+"px 0;"}else if(t&&!n){var r="-"+t+"px",o=lt?r+" 0 0":"0 "+r+" 0";i="margin: 0 "+o+";"}return i}function O(e,t,n){return e?(e+t)*qt+"px":q?q+"("+100*qt+"% / "+n+")":100*qt/n+"%"}function P(e,t,n){var i="";if(lt){if(i="width:",e)i+=e+t+"px";else{var a=tt?qt:n;i+=q?q+"(100% / "+a+")":100/a+"%"}i+=ln+";"}return i}function I(e){var t="";if(e!==!1){t=(lt?"padding-":"margin-")+(lt?"right":"bottom")+": "+e+"px;"}return t}function S(e){e=e||R.event,clearTimeout(Ct),Ct=setTimeout(function(){if(st){var t=n();xt!==t&&(xt=t,W(),"outer"===kt&&en.emit("outerResized",Qe(e)))}},100)}function W(){var e=bt,t=Kt,n=Ot,i=sn;if(pt=a(ct),ot=a(ut),gt&&H(),e!==bt||Pt){var r=It,s=Lt,u=Pt,f=Mt,d=At,v=rn;if(Ot=o("items"),Dt=o("slideBy"),rn=o("disable"),sn=!!rn||!!on&&ht<=Ot,Ot!==n&&(Zt=qt-Ot,si()),rn!==v&&$(rn),sn!==i&&(sn&&(Kt=tt?jt:0),L()),e!==bt&&(St=o("speed"),Mt=o("edgePadding"),At=o("gutter"),Pt=o("fixedWidth"),rn||Pt===u||pe(),(Lt=o("autoHeight"))!==s&&(Lt||(ut.style.height=""))),It=!sn&&o("arrowKeys"),It!==r&&(It?D(B,vn):k(B,vn)),mn){var h=Dn,p=kn;Dn=!sn&&o("controls"),kn=o("controlsText"),Dn!==h&&(Dn?E(An):T(An)),kn!==p&&(Cn.innerHTML=kn[0],wn.innerHTML=kn[1])}if(yn){var m=Pn;Pn=!sn&&o("nav"),Pn!==m&&(Pn?(E(In),Ke()):T(In))}if(xn){var y=ti;ti=!sn&&o("touch"),ti!==y&&tt&&(ti?D(ft,hn):k(ft,hn))}if(Tn){var g=ri;ri=!sn&&o("mouseDrag"),ri!==g&&tt&&(ri?D(ft,pn):k(ft,pn))}if(bn){var b=Un,x=Kn,C=Jn,w=Yn;if(sn?Un=Kn=Jn=!1:(Un=o("autoplay"),Un?(Kn=o("autoplayHoverPause"),Jn=o("autoplayResetOnVisibility")):Kn=Jn=!1),Yn=o("autoplayText"),Xn=o("autoplayTimeout"),Un!==b&&(Un?(Qn&&E(Qn),jn||Gn||De()):(Qn&&T(Qn),jn&&ke())),Kn!==x&&(Kn?D(ft,fn):k(ft,fn)),Jn!==C&&(Jn?D(B,dn):k(B,dn)),Qn&&Yn!==w){var A=Un?1:0,M=Qn.innerHTML,S=M.length-w[A].length;M.substring(S)===w[A]&&(Qn.innerHTML=M.substring(0,S)+Yn[A])}}if(!F){if(sn||Mt===f&&At===d||(ut.style.cssText=N(Mt,At,Pt)),tt&&lt&&(Pt!==u||At!==d||Ot!==n)&&(ft.style.width=O(Pt,At,Ot)),lt&&(Ot!==n||At!==d||Pt!=u)){var W=P(Pt,At,Ot)+I(At);zt.removeRule(c(zt)-1),l(zt,"#"+an+" > .tns-item",W,c(zt))}Pt||Kt!==t||ye(0)}Kt!==t&&(en.emit("indexChanged",Qe()),ye(0),Qt=Kt),Ot!==n&&(ne(),se(),ee(),navigator.msMaxTouchPoints&&re())}lt||rn||(ae(),Ve(),pe()),z(!0),ee()}function H(){bt=0,gt.forEach(function(e,t){xt>=e&&(bt=t+1)})}function L(){var e="tns-transparent";if(sn){if(!Nt){if(Mt&&(ut.style.margin="0px"),jt)for(var t=jt;t--;)tt&&v(vt[t],e),v(vt[qt-t-1],e);Nt=!0}}else if(Nt){if(Mt&&!Pt&&F&&(ut.style.margin=""),jt)for(var t=jt;t--;)tt&&h(vt[t],e),h(vt[qt-t-1],e);Nt=!1}}function z(e){Pt&&Mt&&(sn||pt<=Pt+At?"0px"!==ut.style.margin&&(ut.style.margin="0px"):e&&(ut.style.cssText=N(Mt,At,Pt)))}function $(e){var t=vt.length;if(e){if(zt.disabled=!0,ft.className=ft.className.replace(nn.substring(1),""),x(ft),Ht)for(var n=jt;n--;)tt&&T(vt[n]),T(vt[t-n-1]);if(lt&&tt||x(ut),!tt)for(var i=Kt,a=Kt+ht;i<a;i++){var r=vt[i];x(r),h(r,nt),h(r,rt)}}else{if(zt.disabled=!1,ft.className+=nn,lt||ae(),pe(),Ht)for(var n=jt;n--;)tt&&E(vt[n]),E(vt[t-n-1]);if(!tt)for(var i=Kt,a=Kt+ht;i<a;i++){var r=vt[i],o=i<Kt+Ot?nt:rt;r.style.left=100*(i-Kt)/Ot+"%",v(r,o)}}}function _(){if(Bt&&!rn){var e=Kt,t=Kt+Ot;for(Mt&&(e-=1,t+=1);e<t;e++)[].forEach.call(vt[e].querySelectorAll(".tns-lazy-img"),function(e){var t={};t[Q]=function(e){e.stopPropagation()},D(e,t),d(e,"loaded")||(e.src=m(e,"data-src"),v(e,"loaded"))})}}function ee(){if(Lt&&!rn){for(var e=[],t=Kt,n=Kt+Ot;t<n;t++)[].forEach.call(vt[t].querySelectorAll("img"),function(t){e.push(t)});0===e.length?ie():te(e)}}function te(e){e.forEach(function(t,n){w(t)&&e.splice(n,1)}),0===e.length?ie():setTimeout(function(){te(e)},16)}function ne(){_(),oe(),de(),Ke(),le()}function ie(){for(var e,t=[],n=Kt,i=Kt+Ot;n<i;n++)t.push(vt[n].offsetHeight);e=Math.max.apply(null,t),ut.style.height!==e&&(X&&ve(St),ut.style.height=e+"px")}function ae(){Et=[0];for(var e,t=vt[0].getBoundingClientRect().top,n=1;n<qt;n++)e=vt[n].getBoundingClientRect().top,Et.push(e-t)}function re(){ct.style.msScrollSnapPointsX="snapInterval(0%, "+100/Ot+"%)"}function oe(){for(var e=Kt+Math.min(ht,Ot),t=qt;t--;){var n=vt[t];t>=Kt&&t<e?p(n,"tabindex")&&(g(n,{"aria-hidden":"false"}),b(n,["tabindex"]),v(n,En)):(p(n,"tabindex")||g(n,{"aria-hidden":"true",tabindex:"-1"}),d(n,En)&&h(n,En))}}function se(){if(!tt){for(var e=Kt+Math.min(ht,Ot),t=qt;t--;){var n=vt[t];t>=Kt&&t<e?(v(n,"tns-moving"),n.style.left=100*(t-Kt)/Ot+"%",v(n,nt),h(n,rt)):n.style.left&&(n.style.left="",v(n,rt),h(n,nt)),h(n,it)}setTimeout(function(){[].forEach.call(vt,function(e){h(e,"tns-moving")})},300)}}function le(){if(Pn&&(Ln=Hn!==-1?Hn:Kt%ht,Hn=-1,Ln!==zn)){var e=Mn[zn],t=Mn[Ln];g(e,{tabindex:"-1","aria-selected":"false"}),g(t,{tabindex:"0","aria-selected":"true"}),h(e,Bn),v(t,Bn)}}function ce(e){return"button"===e.nodeName.toLowerCase()}function ue(e){return"true"===e.getAttribute("aria-disabled")}function fe(e,t,n){e?t.disabled=n:t.setAttribute("aria-disabled",n.toString())}function de(){if(Dn&&!Wt&&!Ht){var e=Nn?Cn.disabled:ue(Cn),t=On?wn.disabled:ue(wn),n=Kt===Jt,i=!Wt&&Kt===Zt;n&&!e&&fe(Nn,Cn,!0),!n&&e&&fe(Nn,Cn,!1),i&&!t&&fe(On,wn,!0),!i&&t&&fe(On,wn,!1)}}function ve(e,t){e=e?e/1e3+"s":"",t=t||ft,t.style[X]=e,tt||(t.style[Y]=e),lt||(ut.style[X]=e)}function he(){var e;if(lt)if(Pt)e=-(Pt+At)*Kt+"px";else{var t=U?qt:Ot;e=100*-Kt/t+"%"}else e=-Et[Kt]+"px";return e}function pe(e){e||(e=he()),ft.style[Ut]=Xt+e+Vt}function me(e,t,n,i){for(var a=e,r=e+Ot;a<r;a++){var o=vt[a];i||(o.style.left=100*(a-Kt)/Ot+"%"),X&&ve(St,o),at&&V&&(o.style[V]=o.style[K]=at*(a-e)/1e3+"s"),h(o,t),v(o,n),i&&Rt.push(o)}}function ye(e,t){isNaN(e)&&(e=St),jn&&!C(ft)&&(e=0),X&&ve(e),li(e,t)}function ge(e,t){Ft&&si(),(Kt!==Qt||t)&&(en.emit("indexChanged",Qe()),en.emit("transitionStart",Qe()),jn&&e&&["click","keydown"].indexOf(e.type)>=0&&ke(),$t=!0,ye())}function be(e){return e.toLowerCase().replace(/-/g,"")}function xe(e){if(tt||$t){if(en.emit("transitionEnd",Qe(e)),!tt&&Rt.length>0)for(var t=0;t<Ot;t++){var n=Rt[t];n.style.left="",X&&ve(0,n),at&&V&&(n.style[V]=n.style[K]=""),h(n,it),v(n,rt)}if(!e||!tt&&e.target.parentNode===ft||e.target===ft&&be(e.propertyName)===be(Ut)){if(!Ft){var i=Kt;si(),Kt!==i&&(en.emit("indexChanged",Qe()),X&&ve(0),pe())}ee(),"inner"===kt&&en.emit("innerLoaded",Qe()),$t=!1,zn=Ln,Qt=Kt}}}function Te(e,t){if(!sn)if("prev"===e)Ee(t,-1);else if("next"===e)Ee(t,1);else if(!$t){var n=Kt%ht,i=0;if(n<0&&(n+=ht),"first"===e)i=-n;else if("last"===e)i=ht-Ot-n;else if("number"!=typeof e&&(e=parseInt(e)),!isNaN(e)){var a=e%ht;a<0&&(a+=ht),i=a-n}Kt+=i,Kt%ht!=Qt%ht&&ge(t)}}function Ee(e,t){if(!$t){var n;if(!t){e=e||R.event;for(var i=e.target||e.srcElement;i!==An&&[Cn,wn].indexOf(i)<0;)i=i.parentNode;var a=[Cn,wn].indexOf(i);a>=0&&(n=!0,t=0===a?-1:1)}if(Wt){if(Kt===Jt&&t===-1)return void Te("last",e);if(Kt===Zt&&1===t)return void Te(0,e)}t&&(Kt+=Dt*t,ge(n||e&&"keydown"===e.type?e:null))}}function Ce(e){if(!$t){e=e||R.event;for(var t,n=e.target||e.srcElement;n!==In&&!p(n,"data-nav");)n=n.parentNode;p(n,"data-nav")&&(t=Hn=[].indexOf.call(Mn,n),Te(t,e))}}function we(){Rn=setInterval(function(){Ee(null,Vn)},Xn),jn=!0}function Ne(){clearInterval(Rn),jn=!1}function Oe(e,t){g(Qn,{"data-action":e}),Qn.innerHTML=Zn[0]+e+Zn[1]+t}function De(){we(),Qn&&Oe("stop",Yn[1])}function ke(){Ne(),Qn&&Oe("start",Yn[0])}function Ae(){Un&&!jn&&(De(),Gn=!1)}function Me(){jn&&(ke(),Gn=!0)}function Pe(){jn?(ke(),Gn=!0):(De(),Gn=!1)}function Ie(){B.hidden?jn&&(Ne(),Fn=!0):Fn&&(we(),Fn=!1)}function Se(){jn&&(Ne(),qn=!0)}function We(){qn&&(we(),qn=!1)}function He(e){switch(e=e||R.event,e.keyCode){case j.LEFT:Ee(e,-1);break;case j.RIGHT:Ee(e,1)}}function Le(e){switch(e=e||R.event,e.keyCode){case j.LEFT:case j.UP:case j.PAGEUP:Cn.disabled||Ee(e,-1);break;case j.RIGHT:case j.DOWN:case j.PAGEDOWN:wn.disabled||Ee(e,1);break;case j.HOME:Te(0,e);break;case j.END:Te(ht-1,e)}}function ze(e){e.focus()}function Be(e){function n(e){return t.navContainer?e:Sn[e]}var i=B.activeElement;if(p(i,"data-nav")){e=e||R.event;var a=e.keyCode,r=[].indexOf.call(Mn,i),o=Sn.length,s=Sn.indexOf(r);switch(t.navContainer&&(o=ht,s=r),a){case j.LEFT:case j.PAGEUP:s>0&&ze(Mn[n(s-1)]);break;case j.UP:case j.HOME:s>0&&ze(Mn[n(0)]);break;case j.RIGHT:case j.PAGEDOWN:s<o-1&&ze(Mn[n(s+1)]);break;case j.DOWN:case j.END:s<o-1&&ze(Mn[n(o-1)]);break;case j.ENTER:case j.SPACE:Hn=r,Te(r,e)}}}function Re(){ye(0,ft.scrollLeft()),Qt=Kt}function je(e){return e.target||e.srcElement}function qe(e){return e.type.indexOf("touch")>=0}function Ge(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Fe(e){if(ai=0,wt=!1,ni=ii=null,!$t){e=e||R.event;var t;qe(e)?(t=e.changedTouches[0],en.emit("touchStart",Qe(e))):(t=e,Ge(e),en.emit("dragStart",Qe(e))),ni=parseInt(t.clientX),ii=parseInt(t.clientY),$n=parseFloat(ft.style[Ut].replace(Xt,"").replace(Vt,""))}}function Ue(e){if(!$t&&null!==ni){e=e||R.event;var n;if(qe(e)?n=e.changedTouches[0]:(n=e,Ge(e)),_n=parseInt(n.clientX)-ni,ei=parseInt(n.clientY)-ii,0===ai&&(ai=f(u(ei,_n),15)===t.axis),ai){qe(e)?en.emit("touchMove",Qe(e)):(oi||(oi=!0),en.emit("dragMove",Qe(e))),wt||(wt=!0);var i=$n;if(lt)if(Pt)i+=_n,i+="px";else{var a=U?_n*Ot*100/(ot*qt):100*_n/ot;i+=a,i+="%"}else i+=ei,i+="px";U&&ve(0),ft.style[Ut]=Xt+i+Vt}}}function Xe(e){if(!$t&&wt){e=e||R.event;var t;qe(e)?(t=e.changedTouches[0],en.emit("touchEnd",Qe(e))):(t=e,en.emit("dragEnd",Qe(e))),_n=parseInt(t.clientX)-ni,ei=parseInt(t.clientY)-ii;var n=Boolean(lt?_n:ei);if(ai=0,wt=!1,ni=ii=null,lt){var i=-_n*Ot/ot;i=_n>0?Math.floor(i):Math.ceil(i),Kt+=i}else{var a=-($n+ei);if(a<=0)Kt=Jt;else if(a>=Et[Et.length-1])Kt=Zt;else{var r=0;do{r++,Kt=ei<0?r+1:r}while(r<qt&&a>=Et[r+1])}}if(ge(e,n),oi){oi=!1;var o=je(e);D(o,{click:function e(t){Ge(t),k(o,{click:e})}})}}}function Ve(){ut.style.height=Et[Kt+Ot]-Et[Kt]+"px"}function Ye(){Sn=[];for(var e=Kt%ht%Ot;e<ht;)!Ht&&e+Ot>ht&&(e=ht-Ot),Sn.push(e),e+=Ot;(Ht&&Sn.length*Ot<ht||!Ht&&Sn[0]>0)&&Sn.unshift(0)}function Ke(){Pn&&!gn&&(Ye(),Sn!==Wn&&([].forEach.call(Mn,function(e,t){Sn.indexOf(t)<0?T(e):E(e)}),Wn=Sn))}function Qe(e){return{container:ft,slideItems:vt,navContainer:In,navItems:Mn,controlsContainer:An,hasControls:mn,prevButton:Cn,nextButton:wn,items:Ot,slideBy:Dt,cloneCount:jt,slideCount:ht,slideCountNew:qt,index:Kt,indexCached:Qt,navCurrentIndex:Ln,navCurrentIndexCached:zn,visibleNavIndexes:Sn,visibleNavIndexesCached:Wn,event:e||{}}}t=e({container:B.querySelector(".slider"),mode:"carousel",axis:"horizontal",items:1,gutter:0,edgePadding:0,fixedWidth:!1,slideBy:1,controls:!0,controlsText:["prev","next"],controlsContainer:!1,nav:!0,navContainer:!1,navAsThumbnails:!1,arrowKeys:!1,speed:300,autoplay:!1,autoplayTimeout:5e3,autoplayDirection:"forward",autoplayText:["start","stop"],autoplayHoverPause:!1,autoplayButton:!1,autoplayButtonOutput:!0,autoplayResetOnVisibility:!0,loop:!0,rewind:!1,autoHeight:!1,responsive:!1,lazyload:!1,touch:!0,mouseDrag:!1,nested:!1,freezable:!0,onInit:!1},t||{}),["container","controlsContainer","navContainer","autoplayButton"].forEach(function(e){"string"==typeof t[e]&&(t[e]=B.querySelector(t[e]))});var Je=R.console&&"function"==typeof R.console.warn;if(!t.container||!t.container.nodeName)return void(Je&&console.warn("Can't find container element."));if(t.container.children.length<2)return void(Je&&console.warn("Slides less than 2."));if(t.responsive){var Ze={},$e=t.responsive;for(var _e in $e){var et=$e[_e];Ze[_e]="number"==typeof et?{items:et}:et}t.responsive=Ze,Ze=null,0 in t.responsive&&(t=e(t,t.responsive[0]),delete t.responsive[0])}var tt="carousel"===t.mode;if(!tt){t.axis="horizontal",t.rewind=!1,t.loop=!0,t.edgePadding=!1;var nt="tns-fadeIn",it="tns-fadeOut",at=!1,rt=t.animateNormal||"tns-normal";Q&&J&&(nt=t.animateIn||nt,it=t.animateOut||it,at=t.animateDelay||at)}var ot,st,lt="horizontal"===t.axis,ct=B.createElement("div"),ut=B.createElement("div"),ft=t.container,dt=ft.parentNode,vt=ft.children,ht=vt.length,pt=a(dt),mt=t.responsive,yt=[],gt=!1,bt=0,xt=n();if(mt){gt=Object.keys(mt).map(function(e){return parseInt(e)}).sort(function(e,t){return e-t}),gt.forEach(function(e){yt=yt.concat(Object.keys(mt[e]))});var Tt=[];yt.forEach(function(e){Tt.indexOf(e)<0&&Tt.push(e)}),yt=Tt,H()}var Et,Ct,wt,Nt,Ot=o("items"),Dt="page"===o("slideBy")?Ot:o("slideBy"),kt=t.nested,At=o("gutter"),Mt=o("edgePadding"),Pt=o("fixedWidth"),It=o("arrowKeys"),St=o("speed"),Wt=t.rewind,Ht=!Wt&&t.loop,Lt=o("autoHeight"),zt=s(),Bt=t.lazyload,Rt=[],jt=Ht?2*ht:0,qt=tt?ht+2*jt:ht+jt,Gt=!(!Pt||Ht||Mt),Ft=!tt||!Ht,Ut=lt?"left":"top",Xt="",Vt="",Yt=o("startIndex"),Kt=Yt?function(e){return e%=ht,e<0&&(e+=ht),e=Math.min(e,qt-Ot)}(Yt):tt?jt:0,Qt=Kt,Jt=0,Zt=qt-Ot,$t=!1,_t=t.onInit,en=new A,tn=ft.id,nn=" tns-slider tns-"+t.mode,an=ft.id||i(),rn=o("disable"),on=t.freezable,sn=!!rn||!!on&&ht<=Ot,ln="inner"===kt?" !important":"",cn={click:Ee,keydown:Le},un={click:Ce,keydown:Be},fn={mouseover:Se,mouseout:We},dn={visibilitychange:Ie},vn={keydown:He},hn={touchstart:Fe,touchmove:Ue,touchend:Xe,touchcancel:Xe},pn={mousedown:Fe,mousemove:Ue,mouseup:Xe,mouseleave:Xe},mn=r("controls"),yn=r("nav"),gn=t.navAsThumbnails,bn=r("autoplay"),xn=r("touch"),Tn=r("mouseDrag"),En="tns-slide-active";if(mn)var Cn,wn,Nn,On,Dn=o("controls"),kn=o("controlsText"),An=t.controlsContainer;if(yn)var Mn,Pn=o("nav"),In=t.navContainer,Sn=[],Wn=Sn,Hn=-1,Ln=Kt%ht,zn=Ln,Bn="tns-nav-active";if(bn)var Rn,jn,qn,Gn,Fn,Un=o("autoplay"),Xn=o("autoplayTimeout"),Vn="forward"===t.autoplayDirection?1:-1,Yn=o("autoplayText"),Kn=o("autoplayHoverPause"),Qn=t.autoplayButton,Jn=o("autoplayResetOnVisibility"),Zn=["<span class='tns-visually-hidden'>"," animation</span>"];if(xn)var $n,_n,ei,ti=o("touch"),ni=null,ii=null,ai=0;if(Tn)var ri=o("mouseDrag"),oi=!1;sn&&(Dn=Pn=ti=ri=It=Un=Kn=Jn=!1),U&&(Ut=U,Xt="translate",Xt+=lt?"X(":"Y(",Vt=")"),function(){ct.appendChild(ut),dt.insertBefore(ct,ft),ut.appendChild(ft),ot=a(ut);var e="tns-outer",n="tns-inner",i=r("gutter");if(tt?lt&&(r("edgePadding")||i&&!t.fixedWidth)?e+=" tns-ovh":n+=" tns-ovh":i&&(e+=" tns-ovh"),ct.className=e,ut.className=n,ut.id=an+"-iw",Lt&&(ut.className+=" tns-ah",ut.style[X]=St/1e3+"s"),""===ft.id&&(ft.id=an),nn+=G?" tns-subpixel":" tns-no-subpixel",nn+=q?" tns-calc":" tns-no-calc",tt&&(nn+=" tns-"+t.axis),ft.className+=nn,tt&&Q){var s={};s[Q]=xe,D(ft,s)}e=n=null;for(var u=0;u<ht;u++){var f=vt[u];f.id||(f.id=an+"-item"+u),v(f,"tns-item"),!tt&&rt&&v(f,rt),g(f,{"aria-hidden":"true",tabindex:"-1"})}if(Ht||Mt){for(var d=B.createDocumentFragment(),p=B.createDocumentFragment(),m=jt;m--;){var x=m%ht,E=vt[x].cloneNode(!0);if(b(E,"id"),p.insertBefore(E,p.firstChild),tt){var C=vt[ht-1-x].cloneNode(!0);b(C,"id"),d.appendChild(C)}}ft.insertBefore(d,ft.firstChild),ft.appendChild(p),vt=ft.children}for(var w=Kt,k=Kt+Math.min(ht,Ot);w<k;w++){var f=vt[w];g(f,{"aria-hidden":"false"}),b(f,["tabindex"]),v(f,En),tt||(f.style.left=100*(w-Kt)/Ot+"%",v(f,nt),h(f,rt))}if(tt&&lt&&(G?(l(zt,"#"+an+" > .tns-item","font-size:"+R.getComputedStyle(vt[0]).fontSize+";",c(zt)),l(zt,"#"+an,"font-size:0;",c(zt))):[].forEach.call(vt,function(e,t){e.style.marginLeft=y(t)})),F){var A=N(t.edgePadding,t.gutter,t.fixedWidth);l(zt,"#"+an+"-iw",A,c(zt)),tt&&lt&&(A="width:"+O(t.fixedWidth,t.gutter,t.items),l(zt,"#"+an,A,c(zt))),(lt||t.gutter)&&(A=P(t.fixedWidth,t.gutter,t.items)+I(t.gutter),l(zt,"#"+an+" > .tns-item",A,c(zt)))}else if(ut.style.cssText=N(Mt,At,Pt),tt&&lt&&(ft.style.width=O(Pt,At,Ot)),lt||At){var A=P(Pt,At,Ot)+I(At);l(zt,"#"+an+" > .tns-item",A,c(zt))}if(lt||rn||(ae(),Ve()),mt&&F&&gt.forEach(function(e){var t=mt[e],n="",i="",a="",s="",l=o("items",e),c=o("fixedWidth",e),u=o("edgePadding",e),f=o("gutter",e);("edgePadding"in t||"gutter"in t)&&(i="#"+an+"-iw{"+N(u,f,c)+"}"),tt&&lt&&("fixedWidth"in t||"gutter"in t||"items"in t)&&(a="#"+an+"{width:"+O(c,f,l)+"}"),("fixedWidth"in t||r("fixedWidth")&&"gutter"in t||!tt&&"items"in t)&&(s+=P(c,f,l)),"gutter"in t&&(s+=I(f)),s.length>0&&(s="#"+an+" > .tns-item{"+s+"}"),n=i+a+s,n.length>0&&zt.insertRule("@media (min-width: "+e/16+"em) {"+n+"}",zt.cssRules.length)}),tt&&!rn&&pe(),navigator.msMaxTouchPoints&&(v(ct,"ms-touch"),D(ct,{scroll:Re}),re()),yn){var M=tt?jt:0;if(In)g(In,{"aria-label":"Carousel Pagination"}),Mn=In.children,[].forEach.call(Mn,function(e,t){g(e,{"data-nav":t,tabindex:"-1","aria-selected":"false","aria-controls":vt[M+t].id})});else{for(var H="",j=gn?"":" hidden",w=0;w<ht;w++)H+='<button data-nav="'+w+'" tabindex="-1" aria-selected="false" aria-controls="'+vt[M+w].id+j+'" type="button"></button>';H='<div class="tns-nav" aria-label="Carousel Pagination">'+H+"</div>",ct.insertAdjacentHTML("afterbegin",H),In=ct.querySelector(".tns-nav"),Mn=In.children}if(Ke(),X){var U=X.substring(0,X.length-18).toLowerCase(),A="transition: all "+St/1e3+"s";U&&(A="-"+U+"-"+A),l(zt,"[aria-controls^="+an+"-item]",A,c(zt))}g(Mn[Ln],{tabindex:"0","aria-selected":"true"}),v(Mn[Ln],Bn),D(In,un),Pn||T(In)}if(bn){var V=Un?"stop":"start";Qn?g(Qn,{"data-action":V}):t.autoplayButtonOutput&&(ut.insertAdjacentHTML("beforebegin",'<button data-action="'+V+'" type="button">'+Zn[0]+V+Zn[1]+Yn[0]+"</button>"),Qn=ct.querySelector("[data-action]")),Qn&&D(Qn,{click:Pe}),Un?(De(),Kn&&D(ft,fn),Jn&&D(ft,dn)):Qn&&T(Qn)}mn&&(An?(Cn=An.children[0],wn=An.children[1],g(An,{"aria-label":"Carousel Navigation",tabindex:"0"}),g(Cn,{"data-controls":"prev"}),g(wn,{"data-controls":"next"}),g(An.children,{"aria-controls":an,tabindex:"-1"})):(ct.insertAdjacentHTML("afterbegin",'<div class="tns-controls" aria-label="Carousel Navigation" tabindex="0"><button data-controls="prev" tabindex="-1" aria-controls="'+an+'" type="button">'+kn[0]+'</button><button data-controls="next" tabindex="-1" aria-controls="'+an+'" type="button">'+kn[1]+"</button></div>"),An=ct.querySelector(".tns-controls"),Cn=An.children[0],wn=An.children[1]),Nn=ce(Cn),On=ce(wn),de(),D(An,cn),Dn||T(An)),ti&&D(ft,hn),ri&&D(ft,pn),It&&D(B,vn),"inner"===kt?en.on("outerResized",function(){W(),en.emit("innerLoaded",Qe())}):(D(R,{resize:S}),"outer"===kt&&en.on("innerLoaded",ee)),_(),ee(),L(),z(),en.on("indexChanged",ne),"function"==typeof _t&&_t(Qe()),"inner"===kt&&en.emit("innerLoaded",Qe()),rn&&$(!0),st=!0}();var si=function(){return Ht?function(){var e=Jt,t=Zt;if(tt)if(e+=Dt,t-=Dt,Mt)e+=1,t-=1;else if(Pt){var n=At?At:0;pt%(Pt+n)>n&&(t-=1)}if(Kt>t)for(;Kt>=e+ht;)Kt-=ht;else if(Kt<e)for(;Kt<=t-ht;)Kt+=ht}:function(){Kt=Math.max(Jt,Math.min(Zt,Kt))}}(),li=function(){return tt?function(e,t){t||(t=he()),Gt&&Kt===Zt&&(t=-((Pt+At)*qt-ot)+"px"),X||!e?(pe(t),e&&C(ft)||xe()):M(ft,Ut,Xt,Vt,t,St,xe),lt||Ve()}:function(e){Rt=[];var t={};t[Q]=t[J]=xe,k(vt[Qt],t),D(vt[Kt],t),me(Qt,nt,it,!0),me(Kt,rt,nt),Q&&J&&e||xe()}}();return{getInfo:Qe,events:en,goTo:Te,play:Ae,pause:Me,isOn:st,rebuild:function(){return Z(t)},destroy:function(){if(k(R,{resize:S}),k(B,vn),zt.disabled=!0,Ht)for(var e=jt;e--;)tt&&vt[0].remove(),vt[vt.length-1].remove();var n=["tns-item",En];tt||(n=n.concat("tns-normal",nt));for(var i=ht;i--;){var a=vt[i];a.id.indexOf(an+"-item")>=0&&(a.id=""),n.forEach(function(e){h(a,e)})}if(b(vt,["style","aria-hidden","tabindex"]),vt=an=ht=qt=jt=null,Dn&&(k(An,cn),t.controlsContainer&&(b(An,["aria-label","tabindex"]),b(An.children,["aria-controls","aria-disabled","tabindex"])),An=Cn=wn=null),Pn&&(k(In,un),t.navContainer&&(b(In,["aria-label"]),b(Mn,["aria-selected","aria-controls","tabindex"])),In=Mn=null),Un&&(clearInterval(Rn),Qn&&k(Qn,{click:Pe}),k(ft,fn),k(ft,dn),t.autoplayButton&&b(Qn,["data-action"])),ft.id=tn||"",ft.className=ft.className.replace(nn,""),x(ft),tt&&Q){var r={};r[Q]=xe,k(ft,r)}k(ft,hn),k(ft,pn),dt.insertBefore(ft,ct),ct.remove(),ct=ut=ft=Kt=Qt=Ot=Dt=Ln=zn=mn=Sn=Wn=this.getInfo=this.events=this.goTo=this.play=this.pause=this.destroy=null,this.isOn=st=!1}}};return Z}(); // 2. Build carousel for products from aggregate const sliderMain = tns({ container: '.unique-identifier .my-main-carousel', items: 1, slideBy: 1, controls: true, nav: false, gutter: 10 }); // 3. Synch tabs with carousels function updateTabs(info) { let index, activeSlide; // Update slider for more than 1 product if (info && info.slideItems && info.slideItems.length) { index = info.index; activeSlide = info.slideItems[index]; } else { // Fallback for single product activeSlide = document.querySelector('.unique-identifier .glider-slide[data-product-id]'); } if (activeSlide) { const productId = activeSlide.getAttribute('data-product-id'); const productTabsAll = document.querySelectorAll('.unique-identifier .product-tabs'); const productTabsEl = document.querySelector(`.unique-identifier .product-tabs[data-product-id="${productId}"]`); productTabsAll.forEach(tab => tab.style.display = "none"); if (productTabsEl) { productTabsEl.style.display = "flex"; } } } updateTabs(sliderMain?.getInfo?.()); if (sliderMain?.events?.on) { sliderMain.events.on('indexChanged', updateTabs); } // 4. Init recomendation carousels document.querySelectorAll('.unique-identifier .products-carousel').forEach((carousel, index) => { tns({ container: carousel, items: 3, slideBy: 1, controls: true, center: false, nav: false, gutter: 10, loop: false, responsive: { 0: { items: 2 }, 768: { items: 4 } } }); }); })()
### Schedule the message and configure display settings --- As the final part of the process, you need to set the schedule, display settings configuration, capping, priority of the message among other in-app messages. 1. In the **Schedule** section: 1. Click **Define**. 2. Choose **Run immediately** option. 3. Click **Apply**. 2. In the **Display settings** section: 1. Click **Define**. 2. Define the **Delay display** as **0** and **Priority index** as **1**. 5. Click **Apply**. 3. Optionally, you can define the UTM parameters in the **UTM & URL parameters** section. Otherwise, click **Skip step**. 4. Optionally, you can add the custom parameters in the **Additional parameters** section. Otherwise, click **Skip step**. 3. To start your campaign, click **Activate**. ## Check the use case set up on the Synerise Demo workspace --- In our Synerise Demo workspace you can check the configuration of the: - [Aggregate](https://app.synerise.com/analytics-v2/aggregates/245aa662-d642-352e-acef-18198604ac13) - [AI Recommendation](https://app.synerise.com/ai-v2/recommendations/VR6SOFcDEbAg) - [Dynamic content](https://app.synerise.com/campaigns/dynamic-content/preview/281259da-85a4-43fc-8e1c-c025652656b0) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 7 events per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~3), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Dynamic content](/docs/campaign/dynamiccontent) - [Recommendations](/docs/ai-hub/recommendations-v2) # Cross-sell recommendations in the basket Display recommended products on the cart page, matched to the user's preferences using AI algorithms. You can encourage customers to buy other products and thus increase the value of the basket. Algorithms allow you to choose products commonly bought by past customers with the same basket content and are likely to interest current customers. It's also a good way to mention promotions for complementary product categories. Such recommendations are of value to customers, keep them engaged and encourage them to buy something more. Without such recommendations they would leave the website earlier and buy less. ![Screenshot presenting Cross-sell campaign in the Synerise platform](/api/docs/image/f8a57079df9dd82ae8b22dc747691385d7d51d29/use-cases/all-cases/_gfx/crosssell2.png) ## Example of use - Retail industry A client from the fashion industry used this type of recommendation, because they wanted to increase the average value of online shopping baskets. Profile decided to use recommendations of similar products on every product page and in this way encourage hesitate customer to make a faster decision. **Results** Results after one month: - CTR: 0.76%, - Conversion rate 38.5% (percentage of purchases to the number of clicks). ## How to do it --- The purpose of this type of recommendation is to offer additional products to the ones the customers are viewing and get them to add more items to their shopping carts. The system compares the products which were viewed by other users of a similar profile to the product that is currently being viewed by a specific user. On this basis, the system prepares product recommendations that may encourage the user to add a product to the cart. Learn how to configure your [cross-sell recommendations](/docs/ai-hub/recommendations-v2/recommendation-types#cross-sell-and-cart-recommendations). Above you will find complete guide which will show you how to create and configure your cross-sell recommendations and implement them in your campaigns. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). # Coupon for membership anniversary The main reason why it is worth having a **loyalty program** is to retain customers by rewarding them for their repeat purchase behavior. Also, customers appreciate such programs because they can get access to rewards and special offers. Setting up loyalty programs can help improve your brand recognition, increase growth and improve customer service. It is also worth remembering special days for your club members, not only their birthday, but also **membership anniversary**, which can be a great opportunity to send them special rewards like coupons. ## Example of use - Retail industry --- A customer from the footwear industry has had a customer club for several years and makes special offers and promotions available to members. They decided to show their appreciation for such clients by sending them an email on the anniversary of joining the club. Each email contained an individual rebate code.
Screenshot presenting anniversary coupon
Anniversary coupon
## Prerequisites --- To implement this use case, you have to: - [Configure your email account](/docs/campaign/e-mail/configuring-email-account). - Import customer base with `email addres`. and `registration date`. - Implement [tracking code](/docs/settings/tool/tracking_codes). ## Process --- Prepare use case that will consist of 4 steps: 1. [Prepare a coupon pool](/use-cases/coupon_for_anniversary#prepare-a-coupon-pool). 2. [Prepare an email template](/use-cases/coupon_for_anniversary#prepare-an-email-template). 3. [Prepare workflow](/use-cases/coupon_for_anniversary#prepare-workflow). ## Prepare a coupon pool ---
In [this](/docs/assets/code-pools) article, you will find the rules and procedures needed to create and use voucher pool in Synerise.
On user registration anniversaries, it’s good to send each of them individual coupon codes with a discount. To do it you will have to import to Synerise coupons previously prepared in your ecommerce platform, which will apply the appropriate discount in the shopping cart. 1. To import such coupons, go to **Data Modeling Hub > Voucher Pools** and prepare a **Voucher pool**, to which you will add your coupons. 2. Add an obligatory **Pool name**, and set the Emission start and end dates. 3. When the pool is created, click **Import** and choose **CSV with vouchers**.
Screenshot coupon pool
Prepare coupon pool
Remember that your csv should have only 1 column, without a name.
## Prepare an email template --- To distribute coupon codes in an email, prepare a template - design banners, copy and add the ID of the coupon pool. 1. Go to **Experience Hub > Emails > Templates > Drag&drop builder** or **Code editor** to create an email template.. 2. Click **Inserts** in the upper right corner, find **Pools** on the list of inserts, then choose the **Coupon pool** prepared in the previous step. 3. Copy and paste the Jinjava code of the pool in the place where the coupon code should be shown to the user. Instead of `{% voucher %}` voucher-hash `{% endvoucher %}`, a user will see a unique coupon code.
Screenshot presenting email template for anniversarie coupon
Prepare an email template
If your codes have the appropriate format, you can insert them as barcodes, details [here]( /docs/assets/code-pools/).
## Prepare workflow --- To start sending your prepared email template you have to create a workflow, which in basic configuration may look like the one below. To do this, go to **Automation Hub > Workflow > New workflow**. ### Add the Audience as attribute To start the journey for every user who has a anniversary on a given date, select the **Audience** node.
Screenshot presenting adding the trigger
Add the trigger
1. Set the **Run trigger** to repeatable. 2. Select 1-day interval. 3. Select the **New audience** tab. 4. Click **Define conditions**. 5. Define three conditions, every has a registration date, the first one matches the current day, the second matches the current month, and the third one doesn't match the current year:
Screenshot Prepare anniversary attribute
Prepare anniversary attribute
### Set up the anniversary email When you finish setting up the anniversary attribute, you can set the **Send Email** node by selecting the appropriate email account, choosing the template that you prepared previously and adding the email subject and UTMs.
Screenshot presenting Set the Send Email node
Email datail
### Prepare the final settings 1. **Add End nodes** where the workflow should finish for users. 2. Define **capping**. 3. Optionally, **add titles** to each node so the workflow will be more understandable to your colleagues. 4. Name the **workflow**. 5. To save it as a draft, click Save, or activate the workflow by clicking **Save & Run**.
Screenshot presenting workflow
Prepare workflow
## Check the workflow set up on the Synerise Demo workspace --- You can check the [workflow](https://app.synerise.com/automations/automation-diagram/8d237fd3-5772-414d-a738-199b7fcc7dff) configuration directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 7 events per profile that completes the flow: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`voucherCode.assigned`](/docs/assets/events/event-reference/loyalty#vouchercodeassigned) (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1). ## Read more --- - [Creating code pools](/docs/assets/code-pools) - [Email templates](/docs/campaign/e-mail) - [Import clients](/docs/automation/actions/synerise-integrations/import-customers#example-of-use) - [Workflow](/docs/automation) # Collect and update weather information in a catalog The targeting of advertisements or messages can be based on external data, such as weather information. This type of communication with recipients is especially relevant to companies from the medical, fashion, beverage, or agricultural industries. By collecting data on cloud cover, air temperature, and pressure, we are able to better advertise products, arouse customer interest, and even strengthen the positive perception of a brand. This use case describes how to retrieve data from the WeatherAPI portal and save it in the Synerise catalog. As the next steps (not covered as part of this use case), you may send marketing communication to the customers encouraging them to buy sunglasses for the upcoming sunny days. ## Prerequisites --- - [Assign the following permission](/docs/settings/tool/api) to your workspace API key allowing you to authorize requests and update contents in the catalog: `CATALOGS_ITEM_BATCH_CATALOG_CREATE` - Create an account at the [WeatherAPI](https://www.weatherapi.com/) portal that provides weather information. - Prepare a `CSV` file with the list of your points of sales (POS). The file must include the columns with the following names: - `attributes.store_name`- The name of the store - `attributes.storeId` - The ID of the store - `email` - Email address of the POS.
- If your points of sales don't have email addresses, instead of the `email` column, add `customId` column and assign to it the same value as to `attributes.storeId`. - If you implemented [non-unique email](/docs/settings/configuration/non-unique-emails) setting, use `customId` instead of `email`.
- `attributes.store_city` - City where the POS is located - `attributes.latitude` - Latitude of the POS - `attributes.longitude` - Longitude of the POS
If you want to update the weather information for the city of residence for your customers and you already have their location data (longitude and latitude) saved as attributes on the profile cards in **Behavioral Data Hub > Profiles**, you can skip this part of the process.
## Process --- In this use case, you will go through the following steps: 1. [Import a list of offline stores](/use-cases/data_with_current_weather_information#import-a-list-of-offline-stores). 2. [Create a segmentation](/use-cases/data_with_current_weather_information#create-a-segmentation) that gathers the points of sales you imported. 3. [Create a catalog](/use-cases/data_with_current_weather_information#create-a-catalog) which will contain regularly updated weather information. 4. [Create a workflow](/use-cases/data_with_current_weather_information#create-a-workflow) which retrieves weather information from the WeatherAPI portal and saves it in the catalog. ## Import a list of offline stores --- To collect weather information for each store, first you must import them with their location into Synerise. In this part of the process, you will import the list of POSes to Synerise as profiles (each POS will have a profile in **Behavioral Data Hub > Profiles**). This way, in the further part of the process, you will be able to create a segmentation of POSes and use it in a [workflow](/glossary/#workflow) that updates weather information for each POS. For this purpose, you will create a workflow that will import the list of POSes to Synerise. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. 3. Click **Add trigger**. 4. From the dropdown list, select **Scheduled Run**. 5. Click the node. 6. Set the **Run trigger** option to **one time**. 7. Select the **Immediately** tab. 8. Confirm by clicking **Apply**. 9. Click **THEN**. 11. From the dropdown list, select **Local File**. 10. Click the node. 11. Click **Upload a new file or drag one here**. 12. Select the file you created as a part of [prerequisites](/use-cases/data_with_current_weather_information#prerequisites). 13. If needed, modify **Delimiter**, **Quotation mark**, and **Escape character**. 14. Confirm by clicking **Apply**. 10. Click **THEN**. 15. From the dropdown list, select **Import Profiles**. This node doesn't require any configuration. 16. Click **THEN**. 17. From the dropdown list, select **End**.
Automation Hub workflow for importing POS store data for weather-based targeting
Configuration of the workflow
17. Click **Save & Run**. **Result**: Each POS have a profile. ## Create a segmentation --- In this part of the process, create a segmentation that gathers all points of sales you imported to Synerise. 1. Go to Decision Hub icon **Decision Hub > Segmentation > New segmentation**. 2. Enter a name for the segmentation. 2. Choose the `storeId` attribute. 3. As an operator, choose **Is true**.
Configuration of the segmentation
Configuration of the segmentation
5. Save your segmentation.
If this segmentation is to include customers, not points of sales (POS), you can, for example, use the attribute responsible for longitude and latitude with the value **"is true"** - then all customers who have this value defined on their card in Profiles will be included.
## Create a catalog --- In this part of the process, create a catalog that will store the current weather information for each point of sales. This catalog will be later updated by [the workflow](/use-cases/data_with_current_weather_information#create-a-workflow) that requests the weather information. 1. Go to **Data Modeling Hub > Catalogs > New Catalog**. 2. Enter the name of the catalog. 3. Confirm by clicking **Apply**. 3. Find the catalog on the list and click it. **Result**: Its URL looks as follows: `https://app.synerise.com/spa/modules/catalogs/catalogs/1234`. The number at the end is the catalog ID, save it in a notepad as you will need it later.
Instruction on creating catalogs is available [here](/docs/assets/catalogs/creating-catalogs).
## Create a workflow --- In this part of the process, you will create a workflow for all points of sales you created (for this purpose, you will use [the segmentation you created earlier](/use-cases/data_with_current_weather_information#create-a-segmentation)). This workflow will be launched repetitively (at a frequency required by your business) to retrieve data from the [Weather API](https://www.weatherapi.com/) portal and save it in [the catalog you created eariler](/use-cases/data_with_current_weather_information#create-a-catalog). ### Add the Audience node Start with the **Audience** node. In its configuration, you will use [the segmentation you created in previous steps](/use-cases/data_with_current_weather_information#create-a-segmentation) and define the frequency of launching the workflow. 1. Click **Add trigger**. 2. From the dropdown list, select the **Audience** node. 3. Leave the **Run trigger** option at default (**repeatable**). 4. Define the values for the **Interval** (frequency), **Begin at**, and **Timezone** fields according to your business requirements. 4. In the **Define audience** section, click **Select segment**. 5. Select [the segmentation you created in previous steps](/use-cases/data_with_current_weather_information#create-a-segmentation). 6. Confirm by clicking **Apply**.
Automation Hub Audience node configuration with weather-based segmentation and repeatable interval
Configuration of the Audience node
7. Confirm the settings in the node by clicking **Apply**. ### Add the Get Weather Information node Add the **Get Weather Information** node which retrieves weather information. 1. Click **THEN**. 2. From the dropdown list, select **Get Weather Information**. 3. Click the node. 2. Click **Select connection**. 3. From the dropdown list, select the connection. If you haven't established a connection yet, see [Create a connection](/docs/automation/integration/weatherapi/get-weather-information#create-a-connection). 4. Leave the selection in the **Weather data period** field at default (**current weather**). 5. In the **Location** field, enter `{{ customer.latitude }},{{ customer.longitude }}` 6. Fill the rest of the configuration form according to instructions [here](/docs/automation/integration/weatherapi/get-weather-information#define-the-integration-settings). 7. Confirm the settings by clicking **Apply**. ### Add the Event Filter node By adding the **Event Filter** node, the workflow waits until the `weatherapi.getWeatherInfo` event is generated on the profile card of the points of sales. This way, you can be sure that there is weather information. The event contains parameters with weather information configured in the previous node for each POS. 1. Click **THEN**. 2. From the dropdown list, select **Event Filter**. 1. Leave the **Check** option at default.
If there are other workflows which depend on the occurrence of this event, adjust the time of checking according to your business needs.
2. Select the **weatherapi.getWeatherInfo** event. 4. Confirm by clicking **Apply**.
The configuration of the Event Filter node
The configuration of the Event Filter node
### Add the Outgoing Integration node This webhook will be used to save the retrieved information to the catalog you created in [previous part of the process](/use-cases/data_with_current_weather_information#create-a-catalog). 1. Click **THEN**. 2. From the dropdown list, select **Outgoing Integration**. 1. Select the **Custom webhook** tab. 2. In the **Action name** field, enter `save.weather` (you can use different name, it's just an example). 3. Select **POST method**. 4. In the **Endpoint** field, enter `https://hub.synerise.com/api-reference/asset-management#operation/addItemsBatch` 4. Leave **content-type** at default: `application / json`. 5. In the body of the request, paste the request body with the weather parameters returned by WeatherAPI you would like to save in the catalog. Below you can find example code:
Check the example code
{ "value": { "StoreId": "{{ customer['storeId'] }}", "condition_text": "{{ event.params['body.current.condition.text'] }}", "condition_code": "{{ event.params['body.current.condition.code'] }}", "location_name": "{{ event.params['body.location.name'] }}", "last_updated": "{{ event.params['body.current.last_updated'] }}", "temp_c": "{{ event.params['body.current.temp_c'] }}" }, "itemKey": "{{ customer['storeId'] }}" }
This example uses inserts with [event context](/developers/inserts/automation#event-parameters) to access WeatherAPI response data from the **Event Filter** node. The parameters from the response are injected into a request to the catalogs API and saved in a catalog. | Column name in the catalog | Information saved in the column | |---------------------------------------|----------------------------------------------------------------| | `StoreId` | The ID of the point of sales | | `condition_text` | Weather condition (as a string, for example `Mist`) | | `condition_code` | Weather condition (as [WeatherAPI code](https://www.weatherapi.com/docs/#weather-icons) ) | | `location_name` | City name | | `last_updated` | Local time when the real time data was updated. | | `temp_c` | Temperature given in degrees Celsius | | `itemKey` | Unique identifier in the catalog (in this case, same as POS ID), necessary to save the weather data to the corresponding POS entry. |
The configuration of the Outgoing Integration node
The configuration of the Outgoing Integration node
9. In the **Authorization** section, select **By API key**. 10. From the dropdown list, select the API key who has enabled the `CATALOGS_ITEM_BATCH_CATALOG_CREATE` permission. 11. Confirm the settings by clicking **Apply**. ### Set up final settings of the workflow 1. After the **Outgoing Integration** node, add the **End** node. 3. Optionally, add titles to each node so the workflow will be more understandable to your colleagues. 4. Enter the name of the workflow.
The complete configuration of the workflow
The complete configuration of the workflow
5. Finish your work: - To save the workflow as a draft, click **Save**. - To activate the workflow, click **Save & Run**. As a result, you will receive a catalog with regularly updated weather data for each point of sales included in the **Audience** node.
Screenshot presenting catalog
Update weather data in catalog
## What's next --- The outcome of this use case is a regularly updated catalog with weather data for the region of your points of sales. You can use this information in your communication with customers by [adding references to this catalog](/developers/inserts/insert-usage#extracting-values-from-catalogs) in the templates. This way, based on the weather conditions, you can prepare a message for your customers. ### Adding new POS To add new points of sales, you can import them as shown in [this part of the process](#import-a-list-of-offline-stores) or you can add them manually in **Behavioral Data Hub > Profiles** ### Updating existing POS To update existing POS, you can do it on their profiles in **Behavioral Data Hub > Profiles** or you can import a file with points of sales with their updated data. ### Removing POS To remove a point of sales, go to **Behavioral Data Hub > Profiles**, find the POS you want to remove and use the context menu on the right hand side to remove it. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of use case in Synerise Demo workspace: - [List import](https://app.synerise.com/automations/workflows/automation-diagram/e9d59ed5-88e9-4cc1-b15e-8e8ab8cfd583) - [Catalog](https://app.synerise.com/assets/catalogs/15969) - [Segmentation](https://app.synerise.com/analytics/segmentations/cced0b32-546e-4440-9e69-4b07a7543871) - [Workflow configuration](https://app.synerise.com/automations/automation-diagram/b563bcc3-0c40-47a1-b75e-11ee64eac64a) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 7 events per workflow execution: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`weatherapi.getWeatherInfo`](/docs/assets/events/event-reference/integration#weatherapigetweatherinfo) (~1), [`webhook.response`](/docs/assets/events/event-reference/integration#webhookresponse-and-custom-webhook-response-names) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Catalogs](/docs/assets/catalogs) - [Get Weather Information node](/docs/automation/integration/weatherapi/get-weather-information) - [Jinjava inserts](/developers/inserts/insert-usage) - [Outgoing Integration](/docs/automation/integration/outgoing-webhook) # Cross-sell recommendations from different category Cross-sell recommendations are designed to surface complementary products that can be used together with the item currently viewed. Instead of showing similar or alternative items, it focuses on cross-selling by selecting products from different categories, encouraging broader exploration and potential basket building. In this use case, the recommendation returns from 6 to 12 items. A static filter ensures that **none of the recommended products share the same category as the context product**. For example, if the user is viewing a table, the system may suggest chairs, bookshelf — but not other tables. This approach helps avoid redundancy and instead promotes useful add-ons or combinations across categories. What is more we will promote and demote specific categories from search results. ## Prerequisites --- - Implement a [tracking code](/developers/web/installation-and-configuration) into your website. - [Configure AI engine](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). Enable cross-sell recommendation model. - Implement the [transaction events](/developers/web/transactions-sdk). ## Prepare an AI recommendations --- We will configure a cross-sell recommendation which returns up to 12 items. A static filter ensures that **none of the recommended products share the same category as the context product**. 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. Enter the name of the recommendation (it is only visible on the list of recommendations). 3. In the **Type & Items Feed** section, click **Define**. 4. From the **Items Feed** dropdown list, select an item feed. 5. In the **Type** section, choose the **Cross-sell** recommendation type. 6. Confirm the settings by clicking **Apply**. 7. In the **Items** section, click **Define**. 2. Define the minimum and maximum number of items that will be recommended to the customer in each slot - here it will be from 6 to 12 items. 3. Define [Static filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#static-filters). 4. In our case, in the **Static filter** section, click **Define filter**. 5. Select **Visual Builder**. 6. Click **Select value**. 5. Choose **category**. 6. As an operator, choose **Not in**. 7. Click the icon which appeared next to the field with operator and from the dropdown list, select **Context** (eye icon). 7. As the value, choose `category`, to be sure that the category of recommended products will not be the same as the category of the currently viewed item. 8. In the **Category level** input area that appear, define the category level as a numeric value.
If your products categories have a `X > Y > Z` structure, level 0 will be `X > Y > Z`. Level 1 will be `X > Y` and so on. Here, you define how granular the category recommendations will be. For example, if you are selling shoes, you will have a `Outdoor > Sport > Running` category and a `Outdoor > Sport > Football` category. If level 0 is provided, both categories can be recommended. If level 1 is provided `Outdoor > Sport` category will be recommended to the user.
4. Confirm by clicking **Apply**. 8. Define the boosting rules by clicking **Define** in the **Boosting** section. 9. Click **Add rule**. 10. Click **Define rule** and choose **Visual builder**. 11. Click **Select value** and choose the **category**. 12. As an operator select **Not in**. 13. Click on **0 items** and select the categories you want to demote from the recommendatons results from the list. 14. Click **Apply**. 15. In the **Promote/Demote** selector, select **Demote**. 12. Use the slider to adjust how much you want the rule to affect the results.
Boosting itemsr
Boosting items
9. Click **Add rule**. 10. Click **Define rule** and choose **Visual builder**. 11. Click **Select value** and choose the **category**. 12. As an operator select **In**. 13. Click on **0 items** and select the categories you want to promote from the recommendatons results from the list. 14. Click **Apply**. 15. In the **Promote/Demote** selector, select **Promote** (default value). 12. Use the slider to adjust how much you want the rule to affect the results.
Screenshot of the boosting strength slider
The boosting strength slider
13. Click **Apply** to save changes.
Boosting itemsr
Boosting items
9. In the **Additional settings** section, choose **Exclude already bought products**. If your company sells replenishable products, you can set exclusion for specific number of days, for example, exclude products bought not later than 30 days ago. 9. In the right upper corner, click **Save**. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of the [AI Recommendation](https://app.synerise.com/ai-v2/recommendations/76urzbmYEpFE) in our Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Recommendations](/docs/ai-hub/recommendations-v2) # Display Discount Information in Mobile App Using Screen View Campaign Synerise [documents](/docs/assets/documents) are objects that allow users to build mobile applications or create single elements to display in the applications for example a simple information about ongoing discount season. A [screen view](/docs/campaign/screen-views) lets you display the content of documents in a mobile application. This way, you can create and deliver the content dedicated to defined customer groups and also group the documents and use those group in the further communication. In this use case, you will display an image that contains information about discounts available for all customers. The image will be included in the body of a document, and the whole document will be published by means of a screen view. ## Prerequisites --- - [Implement Synerise SDK in your mobile app](/developers/mobile-sdk). - Upload an image with the information about discounts, you can do it in Data Modeling Hub icon **Data Modeling Hub > Files** - [Meet the screen views requirements](/docs/campaign/screen-views/introduction-to-screen-views#requirements) - [Meet the documents requirements](/docs/assets/documents/introduction-to-documents#requirements) ## Process --- In this use case, you will go through the following steps: 1. [Create a document](/use-cases/documents-promotion#create-a-document) with basic promotion targeted to everyone. 2. [Create a screen view](/use-cases/documents-promotion#create-a-screen-view) based on the document with the general promotion and target it to everyone. ## Create a document --- As the first part of the process, create a document with general promotion targeted to the whole database. 1. Go to Data Modeling Hub icon **Data Modeling Hub > Documents > Add document**. 2. Enter the name for your document. 2. In the **Audience** section, choose to whom the message will be displayed. Select **Everyone**. 3. In the **Configuration** section: 1. In the **Slug** field, enter the slug of the document, we recommend using the following name convention: `this-is-slug-name`. 2. In the **Priority** field, use a number to define the document priority. The order of documents is defined by the priority value (1 is the highest, 100 is the lowest). 3. Optionally you can choose the **Group** to which you add your document. In this case we focus on single promotion. 4. From the **Type** dropdown list, select a document type. Document type defines how the document is validated by your mobile application. To create a new type, from the dropdown list, click **Add type**.
Full explanation of the type is available [here](/docs/assets/documents/introduction-to-documents#terminology).
5. In the **Body** field, add the content of the promotion in the JSON format. Below you will find an easy examples of the document body that contains the promotion created in Synerise:
{
       "cover": {
       "image": "https://example.com/link-to-image/",
       "title": "Promo"
         }
       }
The view of document congifuration
Document configuration
7. Optionally, to check the preview of the document for the specific customer, use **Preview body**. 8. To save your changes, click **Apply**. 1. In the **Schedule** section, define the time when the document will be active. - To activate a document immediately, choose **Run immediately** your campaign will be launched immediately after activation. - To schedule the activation of the document at a specific date, select the **Scheduled** option and define the time range. 2. Click **Apply** to save your changes. 3. To activate immediately or at a scheduled date, click the **Activate** button.
The view of document congifuration
Document configuration
## Create a screen view --- In this part of the process, create screen views for the document created in the previous step. 1. Go to Experience Hub icon **Experience Hub > Screen views > New Screen View**. 2. Enter the name of the screen view. 2. In the **Audience** section, choose to whom the message will be displayed. In this case, select **Everyone**. 5. Confirm your choice by clicking the **Apply** button. 6. To create the content of your screen view, in the **Content** section click the **Change** button. 1. In the **Screen views feed**, select the general feed to display. 2. Set up the **Priority**. If multiple screen views match the conditions, the one with the higher priority is displayed (1 is the highest, 100 is the lowest).
You can learn more about the order of displaying multiple screen views [here](/docs/campaign/screen-views/creating-screen-views#conflicts).
3. Select the document you created in the [previous step](#create-a-document) by clicking the **Specified documents**. 4. From the dropdown list, select the document.
The configuration of the screen view
The configuration of the screen view
5. Confirm your choice by clicking **Add**. 4. Click **Apply** to save your changes. 6. Go to the **Schedule** section and click the **Change** button. 7. Set up when campaign will be active using option **Run immediately** or set up a specific time range using option **Scheduled**. 4. To save your changes, click **Apply**. 5. To run your screen views campaign, click **Activate**.
The configuration of the screen view
The configuration of the screen view
## What's next --- For a screen view to be visible in a mobile application, you must fetch it using the appropriate SDK method for: - [iOS](/developers/mobile-sdk/method-reference/ios/content#generate-screen-view), - [Android](/developers/mobile-sdk/method-reference/android/content#generate-screen-view), - [React Native](/developers/mobile-sdk/method-reference/react-native/content#generate-screen-view) - [Flutter](/developers/mobile-sdk/method-reference/flutter/content#generate-screen-view) ## Check the use case set up on the Synerise Demo workspace --- In the Synerise Demo workspace, you can check: - [Document](https://app.synerise.com/assets/documents/3e03fc3a-5875-4273-b552-407a6d653de7) - [Screen view](https://app.synerise.com/campaigns/screen-views/screen-view/f4283005-966e-4510-82f0-1eab94db6652) - [Workflow](https://app.synerise.com/automations/automation-diagram/48972f25-04ff-43c3-a06f-1e34c7089e06) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case does not generate any events. ## Read more --- - [Documents](/docs/assets/documents) - [Screen views](/docs/campaign/screen-views) # Discount coupon for installing the application --- Mobile app can be used to **increase customer loyalty** because it allows businesses to communicate directly with their customers using ads, promotions, and notifications. As a primary channel of communication with customers, it is very important to increase the number of application users. It is a good idea to encourage users to install the app using special benefits as an incentive. This not only helps to convince users to download and install the app, but also creates more positive engagement right from the start. ## Example of use - Retail industry **Challenge** A customer from the fashion industry has decided to increase the number of users of their mobile application. To achieve this, they prepared a special promotion — a 5% discount for online shopping and in physical stores for new users of the application. After downloading it, the customer received a unique discount code available in one of the application screens, valid for 30 days. To use it efficiently and to not extend the queues at the checkout, the discount took the form of a bar code that could be easily scanned. The campaign was promoted with leaflets in physical stores and online using banners. ![Screenshot presenting discount for installig the application](/api/docs/image/f8a57079df9dd82ae8b22dc747691385d7d51d29/use-cases/all-cases/_gfx/discount-for-app.png) ## Prerequisites --- - Integration of Synerise [mobile SDK](/developers/). - Integration of promotions. - Import of [code pools](/docs/assets/code-pools). ## Process --- 1. [Create an aggregate](/use-cases/discount-for-app#create-an-aggregate). 2. [Create a segment](/use-cases/discount-for-app#create-a-segment). 3. [Prepare a workflow](/use-cases/discount-for-app#prepare-a-workflow). 4. [Build a segment](/use-cases/discount-for-app#build-a-segment). ## Create an aggregate --- 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Count**. 4. Select the `client.applicationStarted` event. 5. Define the period from which the aggregate will return products from the event. 6. Save the aggregate. ![Screenshot presenting discount for installig the application](/api/docs/image/f8a57079df9dd82ae8b22dc747691385d7d51d29/use-cases/all-cases/_gfx/discount-for-app2.png) ## Create a segment --- Prepare a customer segment for which the aggregate value is 1. 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Give the segmentation a meaningful name. 3. Click **Choose filter** and select an aggregate created in previous step. 4. As a operator choose **equal**. 5. As the value of aggregate add `#1`. 4. Click **Save**. ![Screenshot presenting discount for installig the application](/api/docs/image/f8a57079df9dd82ae8b22dc747691385d7d51d29/use-cases/all-cases/_gfx/discount-for-app3.png) ## Prepare a workflow --- Prepare a segment of people who will be able to view the promotion in the application, ie. people who installed the application only after the promotion has started. To do this, prepare an automation that will give new users of the application a unique event (it is important because the rebate code will be available to the customers only for 30 days). 1. Go to **Automation Hub > Workflows > New workflow**. 2. Choose **Audience** as a trigger. 3. In the **Audience** node, choose segment prepared in previous step. 4. As the action node choose **Generate Event**. 5. Add json with a custom event that can be built, e.g. in this way:
{
     "action": "install.app",
     "category": "category.automation.event",
     "label": "App installed",
     "params": {
       "app-started": "first"
     }
   }
In this case the action event is the key - here it will be: install.app - it will be used to prepare the proper segment. 6. Add the **End** node and save your workflow. ## Build a segment --- Based on event created before, prepare a segment of customers who will see the promotion in the application - people who get the specific event from the automation from previous step during last 30 days. 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Give the segmentation a meaningful name. 3. Click **Choose filter** and select the event from the automation from previous step. 4. Define the time range as last 30 days. 4. Click **Save**. ## What's next --- Prepare the new promotion for this segment. Complete the promotion content and enter in the additional parameters a json containing a pool of previously imported codes:
{“poolUuid": “XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXX"}. // uuid from the link of your code pool"
In order for the code to be displayed as a barcode, this option must be supported on the application side.
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of use case in Synerise Demo workspace: - [Aggregate](https://app.synerise.com/analytics/aggregates/b1e036fd-aebd-3fce-afe9-c24b273f492d) - [Segmentation based on an aggregate that returns the number of times a customer started the mobile application ](https://app.synerise.com/analytics-v2/segmentations/6246814c-3578-4d77-8630-f4d8a0697664) - [Workflow configuration](https://app.synerise.com/automations/workflows/automation-diagram/7bf1f995-56ca-4a12-85bf-24256a4fda1e) - [Segmentation based on the event defined in the Generate Event node in a workflow](https://app.synerise.com/analytics-v2/segmentations/6ee14466-c3a1-4f20-9eb2-d2e3c6950148) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 6 events per profile that completes the flow: [`client.applicationStarted`](/docs/assets/events/event-reference/web-and-app#clientapplicationstarted) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), `install.app` (~1), [`client.activatePromotion`](/docs/assets/events/event-reference/loyalty#clientactivatepromotion) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Import code pools](/docs/assets/code-pools) - [Segmentation](/docs/analytics/segmentations/creating-segmentations) - [Setting a promotions](/docs/ai-hub/promotions/creating-promotions-for-entire-basket) # Dynamic content campaign with personalized recommendations Creating personalized dynamic content tailored to the individual customer's journey, serves as a powerful communication channel. This strategic approach allows you to seamlessly connect with customers at precisely the right moment, delivering a message that resonates with their needs and preferences. In different industries, the objectives of dynamic messaging may vary, but one thing remains constant - the undeniable effectiveness of this form of communication. Its adaptability allows it to be used in countless ways, turning out to be a versatile tool in the arsenal. This use case illustrates how you can create your dynamic content using drag & drop builder and predefined HTML blocks with product recommendations.
Low stock campaign
## Prerequisites --- - [Configure an item catalog for recommendations](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). Enable personalized recommendations. - [Import your product feed to AI engine](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). ## Process --- In this use case, you will go through the following steps: 1. [Prepare AI recommendations](/use-cases/recommendations-bestsellers#prepare-ai-recommendation). 2. [Create dynamic content campaign](/use-cases/recommendations-bestsellers#create-dynamic-content). ## Prepare AI recommendation --- In this part of the process, you will create recommendations which will be used in dynamic content in the further part of the process. 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. Enter the name of the recommendation (it is only visible on the list of recommendations). 3. In the **Type & Items feed** section, click **Define**. 4. From the **Items feed** dropdown list, select a product feed that has a trained model. 5. Select the **Personalized** recommendation type. 6. Confirm the recommendation type by clicking **Apply**. 7. In the **Items** section, click **Define**. 8. Click **Add slot**. 9. Click the **Unnamed slot** that was created. 10. Define the minimum and maximum number of products displayed in the frame according to your needs. 11. Optionally, you can use filters to include specific items in the recommendation frame. 12. Confirm the configuration by clicking **Apply**. 13. Optionally, you can define the settings in the **Boosting** and **Additional settings** sections.
Learn more about [boosting](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#define-the-boosting-factors) and [additional settings](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#additional-settings).
14. Click **Save**.
AI recommendation configuration
AI recommendation campaign configuration
## Create dynamic content --- In this part of the process, create a dynamic content campaign with personalized product recommendations using drag & drop builder and predefined HTML block with product recommendations. 1. Go to Experience Hub icon **Experience Hub > Dynamic content > Create new**. 2. Enter the name of the dynamic content. 3. Choose the **Web layer** type. 4. As an audience, select the user segment for which you want to display the recommendation. ### Define Content 5. In the **Content** section, click **Define**. 6. In the **Content tab**, click **Create Message**. 6. In the upper right corner, click **+ New template**. 7. On the pop-up, select **Drag & Drop builder**. 8. Create a dynamic content template by customizing the message style and copy using standard design elements such as Title, Paragraph, List, Image, Button, Divider, Social, HTML, Icons and Menu. 9. Use **HTML blocks** element to add predefined product recommendations block. 1. On the right side of the screen, select and drag the **HTML blocks** element to the template. **Result**:
The HTML block added to the template
The HTML block added to the template
2. On the **HTML blocks** you added to the template, click **Configure**. **Result**: A pop-up appears.
Predefined blocks folder
Predefined blocks folder
3. Choose **Predefined blocks** folder. 4. Select block with recommended products. #### Edit the block in the Config tab The form in the **Config** tab is already filled with default values. You can keep them or change them to fit your business needs. 1. In the **Recommended products** section from the **Recommendation campaign ID** dropdown list, select the [recommendation you prepared in the previous step](/use-cases/dynamic-content-with-drag-and-drop-builder#prepare-ai-recommendation). You can find it by typing its name or ID in the search box. 2. In the section below, you have the option to customize width, number of products in row, product title font color, button background color, button font color, button border radius, button text. 3. After you make changes to the template, you can check the preview. 1. On the upper left side, click the **Preview Contexts** button. 2. Enter the ID of a customer. 3. Click **Apply**.
The view of the html block
Html block preview
9. To save this block as a template, click an arrow on the left to the **Next** button, and select **Save as**. On the pop-up, enter the name of the template and select the folder in which the template will be saved. 10. To use this block in a dynamic content template, click **Next**.
We recommend placing the HTML block as the sole element in the row. Additionally, ensure that the styling of the block is compatible with the styling of the template.
### Preview dynamic content template --- You can check the preview of the dynamic content directly in the template builder using [Preview Contexts](/docs/campaign/dynamiccontent/testing-dynamic-content/previewing-dynamic-content#preview-in-the-template-builder) option or you can use the [Live preview](/docs/campaign/dynamiccontent/testing-dynamic-content/previewing-dynamic-content#the-live-preview-option) option to see how dynamic content looks on the target website. 9. To save this dynamic content template, on the left to the **Next** button, click an arrow and select **Save as**. On the pop-up, enter the name of the template and select the folder in which the template will be saved. 10. To use this template in a dynamic content campaign, click **Next**. 11. Confirm by clicking **Apply**. ### Define schedule and display settings 9. In the **Schedule** section, select the date when the dynamic content is activated. 10. In **Display settings**, define the circumstances for displaying the content.
Instructions how to do it are available [here](/docs/campaign/dynamiccontent/creating-dynamic-content/creating-dynamic-content#schedule-dynamic-content).
11. Confirm by clicking **Apply**. 12. Optionally, you can define the UTM parameters for your dynamic content campaign. 13. Activate the dynamic content. ## What's next --- Feel free to choose any HTML block that fits your business campaign. Additionally, you can use the recommendation ID in various communication types, as explained [here](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#distributing-recommendations). ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of the campaign components directly in Synerise Demo workspace: - [AI recommendation](https://app.synerise.com/ai-v2/recommendations/7NKlKKkRBQ2d), - [Dynamic content](https://app.synerise.com/campaigns/create/68ffe89d-bc76-41a2-9c1e-37dd79f8b4d0). If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 5 events per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Dynamic content using drag & drop builder](/docs/campaign/dynamiccontent/creating-dynamic-content-templates/dynamic-content-drag-and-drop) - [Recommendations](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign) - [Using recommendations in dynamic content](/developers/inserts/recommendations-v2) # Dynamic content with recommendation carousel Similar item recommendations are a powerful tool for online retailers that suggests products to customers that are similar to those they are currently browsing or have purchased in the past. These recommendations are useful as they can help customers discover new products that they might not otherwise find, and they can also help sellers increase sales by promoting products that customers are more likely to be interested in. This use case describes the implementation of dynamic content (DC) with recommendations of similar items on a website. With predefined dynamic content web layer templates, you can create such a DC much faster without having to create a template from scratch.
Dynamic content with recommendation carousel
## Prerequisites --- - Implement a [tracking code](/developers/web/installation-and-configuration) into your website. - [Configure AI engine](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). - [Configure an item catalog for recommendations](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). Enable similar items recommendations. ## Process --- In this use case, you will go through the following steps: 1. [Prepare AI recommendations](/use-cases/dynamic-content-recommendation-carousel#prepare-ai-recommendations). 2. [Create dynamic content](/use-cases/dynamic-content-recommendation-carousel#create-dynamic-content-campaign) with similar item recommendations using the predefined dynamic content web layer template. ## Prepare AI recommendations --- In this part of the process, you will configure a similar items recommendation which will be later used in the dynamic content. 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. Enter the name of the recommendation (it is only visible on the list of recommendation). 3. In the **Type & Items feed** section, click **Define**. 4. From the **Items feed** dropdown list, select an item feed. 5. In the **Type** section, choose the **Similar items** recommendation type. 6. Confirm the settings by clicking **Apply**. 7. In the **Items** section, click **Define**. 1. Click **Add slot**. 2. Define the minimum and maximum number of items that will be recommended to the customer in each slot. 3. Optionally, define [Static filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#static-filters) and [Elastic filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#elastic-filters). 4. Confirm by clicking **Apply**. 8. Optionally, you can define the **Boosting** factors and settings in the **Additional settings** section. 9. In the right upper corner, click **Save**. ## Create dynamic content campaign --- Create a dynamic content campaign with recommendations of similar items using a predefined dynamic content web layer template. This dynamic content will be displayed as a pop-up on your site for the customers who have added products to their shopping cart. 1. Go to Experience Hub icon **Experience Hub > Dynamic content > Create new**. 2. Enter the name of the dynamic content. 3. Choose the **Web layer** type. 4. As the audience, select **Everyone**. ### Define content 5. In the **Content** section, click **Define**. 6. In the **Content** tab, click **Create Message**. 7. From the list of template folders, select a folder with the predefined **Web layer templates**. **Result**: You are redirected to the list of predefined templates.
Web layer templates folder
Web layer templates folder
8. Select the **Recommendations** template. **Result**: You are redirected to the template builder.
You can edit the template in two ways, by editing the code of the template ([add inserts](/docs/campaign/dynamiccontent/creating-dynamic-content-templates/dynamic-content-template-builder#adding-a-snippet-to-the-template-code), [add variables](/docs/campaign/dynamiccontent/creating-dynamic-content-templates/dynamic-content-template-builder#adding-a-variable)) and/or by filling out the form in the Config tab. In this use case, we will use the capabilities of the predefined Config tab.
#### Edit the form in the Config tab The form in the **Config** tab is already filled in with default values. You can keep them or change them to fit your business needs. 1. From the **Recommendation campaign** dropdown list, select the ID of recommendation campaign you created [in the previous step](/use-cases/dynamic-content-recommendation-carousel#prepare-ai-recommendations). You can find it by typing its name or ID in the search box. 2. In the **Header text** field, define the header text to appear in the popup message. 3. In the **Currency** field, specify the currency in which you want to display the prices of the recommended products. 4. In the **Bottom text** field, define the copy you want to appear in this section. 5. In the **Font** field, define the font of all text displayed in the dynamic content. 6. Define the colors in the **Bottom bar background** and **Bottom bar text color** fields. 7. Choose the most suitable carousel scrolling method for you by enabling one or all toggles at the same time: - **Carousel autoplay**: activation of this toggle allows automatic scrolling of items in the carousel; - **Carousel loop**: activation of this toggle allows users to navigate to the first article in the carousel by clicking the arrow after the last article displayed in the carousel; - Enabling these two options at the same time will combine these functionalities. In this case, the recommendation carousel will scroll automatically and return to the first item automatically after displaying the last one. - If you don't activate any of the toggles, users will have to scroll through the carousel on their own, and when they get to the last item, it won't automatically redirect them to the beginning of the carousel. 8. In the following fields, define the item amount that you would like to display in small, medium, large and extra large screens. 7. After you make changes to the template, you can check the preview. 1. Click the **Preview Contexts** button on the upper left side. 2. Enter the ID of a customer and define the product context. 3. Click **Apply**.
If you are using custom attributes in your product feed, you need to replace the names of the standard attributes used in the template code with the names of the attributes used in your feed. In our case, we changed the names of following attributes (according to the custom attribute names used in our product feed): - `link` -> `productUrl` - `imageLink` -> `image` - `title` -> `name` - `item.price.value`-> `item.price` - `item.salePrice.value` -> `item.salePrice`
4. If the template is ready, in the upper right corner click **Save this template > Save as**. 5. On the popup: 1. In the **Template name field**, enter the name of the template. 2. From the **Template folder** dropdown list, select the folder where the template will be saved. 3. Confirm by clicking **Apply**. 6. To continue the process of configuring the dynamic content campaign, click **Next**. 7. To save your content changes, click **Apply**. ### Define schedule and display settings 1. In the **Schedule** section, click **Define** and set the time when the message will be active. 2. In the **Display Settings** section, click **Define**. 3. Specify circumstances for dynamic content to be displayed. Optionally, you can also define the Advanced options. In our case, we will define the frequency of dynamic content to be displayed to **Once per day**. You can also define the type of device you want to show your dynamic content. 4. Click **Apply**. 5. Optionally, you can define the UTM parameters and additional parameters for your dynamic content campaign.
Dynamic content configuration
Dynamic content configuration
6. Click **Activate**. **Result**: This is an example of how the pop-up with the predefined template may look like on the website:
Example of dynamic content with carousel on a website
Example of dynamic content with carousel on a website
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of each step from this use case in our Synerise Demo workspace: - [AI Recommendation](https://app.synerise.com/ai-v2/recommendations/FvK977G7W8LM) - [Dynamic content](https://app.synerise.com/campaigns/create/c1aff499-c68f-463e-94ba-bb3cd0c43294) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 5 events per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Dynamic content](/docs/campaign/dynamiccontent) - [Dynamic content template builder](/docs/campaign/dynamiccontent/creating-dynamic-content-templates/dynamic-content-template-builder) - [Recommendations](/docs/ai-hub/recommendations-v2) # Create a Purchase Report Based on Product Categories While creating a purchase analysis of specific products, we often want to group them according to specific rules, for example, by their category. However, the product category is not always added to the parameters of the transaction event. In this case, you can use Decision Hub, which creates the necessary parameter on the fly without changing the integration. In this use case, you'll learn how to create category parameters on the fly using Synerise Decision Hub and how to create a report that shows how many purchases were made for products in the defined categories. ## Prerequisites --- - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). - Prepare a list of product SKUs that you would like to group into specific product categories. ## Process --- - [Create an expression](/use-cases/group_products_by_category#group-sold-products-by-their-category-with-sku) that groups sold products into categories based on their SKU. - [Create a metric](/use-cases/group_products_by_category#create-a-metric) that returns the number of products purchased within the defined category. - [Create a report](/use-cases/group_products_by_category#create-a-report) that shows the metric result broken down into defined groups (product categories). ## Group sold products by their category with SKU ---
In our case, event expression is be based on the products SKU. Hovewer, it is only the example of the configuration of the expression. Depending on your business needs and parameters used in the product events, you can create any conditions that can be based for example on fragment from the product name, url, and any other conditions.
In this part of the process, you will create an event expression for the **product.buy** event. The formula of this expression will assign a product with a given SKU to a specific product category.
Groups of these SKUs have a repeating string in the middle (for example, one SKU has ZZ**XXXX**YY and another has AA**XXXX**BB)
If the SKU is included in the group corresponding to the regular expression conditions (constant with the value “.*XXXX.*”), then the expression assigns it to the product group (for example, constant with the value `Laptop`). The next groups of products will be added in the same way. If the product doesn't meet the expression conditions, it will be assigned to the `other` category. 1. Go to <Behavioral Data Hub icon **Behavioral Data Hub > Expression > New expression**. 2. Enter the name of the expression. 3. Set the Expression for option to **Event**. 4. From the dropdown list, select **product.buy**. 5. Build the expression as shown in the screenshot below:
Expression configuration
Expression configuration
## Create a metric --- Create a metric to receive the number of purchased products of the groups defined in the previous step. 1. Go to Behavioral Data Hub icon **Decision Hub > Metrics > New mertic**. 2. Enter the name of the metric. 3. As a metric kind, select **Simple metric**. 4. As the aggregator, set **Count**. 5. As the occurrence type, set **All**. 6. From the Choose event dropdown list, select **product.buy** event. 7. Click **Where** button. Result: The Choose parameter button appears. 8. Click the **Choose parameter** button. Result: A pop-up appears. 9. On the pop-up, click the **three-dot** button Result: A dropdown shows. 10. From the dropdown, select **Expressions**. 11. In the list of expressions, find the event expression you have created [earlier](/use-cases/group_products_by_category#group-sold-products-by-their-category-with-sku). 12. Click the **Choose parameter** button. 13. From the dropdown, select **Not equal**. 14. In the text field, enter `other`. 15. To select a specific time range, click the **calendar** icon. 16. Confirm your choice with the **Apply** button. 17. Save metrics.
Metrics configuration
Metrics configuration
## Create a report --- In this part of the process, create a report based on the metric and expression you prepared before. The result of the report is a table with the number of purchased products in each category over a specified time period. 1. Go to Behavioral Data Hub icon **Decision Hub > Reports > New report**. 2. Enter the name of the report. 3. Select metric you created in [this part](/use-cases/group_products_by_category#create-a-metric) of the process. 4. From the **Range** dropdown list, select the number of top (the most frequently bought group of products) to be shown in the preview of the report.
The selected number of product groups in the range must be greater than the number of product groups defined in the expression - for the report to pull them all in.
5. In the Dimension section, select the expression created in [this step](/use-cases/group_products_by_category#group-sold-products-by-their-category-with-sku). 6. In the date range, select the time that will be analyzed. 7. Save the report. 8. Click **Preview** to see the results.
Report configuration
Report configuration
Preview the results of the report:
Report preview
Report preview
The sold products presented in the report are grouped according to predefined categories. You can use this data to compare whether sales of a particular product group have increased during the period of interest. If there has been a noticeable increase in product group sales, there is likely to be a fraud. In this case, you can implement an alert system using email alert/sms alert nodes or outgoing integration. You can take inspiration from the following [use case](/use-cases/slack-integration), which describes the process of creating a workflow that sends alert messages based on the results of metrics to a Slack channel. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of each step from this use case in our Synerise Demo workspace: - [Expression](https://app.synerise.com/analytics/expressions/b6b60b91-9333-42db-9a87-9343a87d87fd) - [Metric](https://app.synerise.com/analytics/metrics/9399b940-b639-4bba-a83f-2d320827cf6e) - [Report](https://app.synerise.com/analytics/reports/9d2f7346-368d-4099-8e9f-dd749641a374) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case does not generate any events. ## Read more --- - [Expressions](/docs/crm/expressions) - [Metrics](/docs/analytics/metrics) - [Reports](/docs/analytics/reports) # Extra points for purchases from the specific locations during specific time In today's highly competitive business environment, establishing and nurturing customer loyalty holds immense significance for companies aiming to maintain their customer base and drive revenue growth. To accomplish this, deploying a well-designed loyalty program emerges as a powerful tool, incentivizing customers for their purchases and fostering continuous engagement and brand advocacy. This specific use case delves into the implementation of a targeted loyalty program, wherein customers earn reward points for transactions conducted exclusively at a designated point of sale (POS). The program's strategic focus aligns with the grand opening of a new store, offering a limited-time promotion that is exclusively available during the opening weekend. Following a purchase, it is possible to send customers an email informing them of their existing points balance. Although the specifics of this communication process are not addressed in this particular scenario, if you are interested in acquiring knowledge on generating analytics to calculate point balances for customers, we suggest referring to this [use case](/use-cases/loyalty-points-for-category), which offers a comprehensive, step-by-step tutorial on creating such analytics. ## Prerequisites --- - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). Make sure that you implement shopID parameter that contains the ID of the point of sales where the purchase has been made. - Implement basic [loyalty program](/use-cases/loyalty-programs-basics) based on which you granted customers with 1 point for every 1 PLN spent. ## Security configuration Before you start working with this module, if you are a Synerise customer or partner, consider reading [the section about denylisting events](/docs/settings/tool/api#denylist). This natively accessible configuration will allow you to manage the restrictions in points management that may help you prevent fraud. ## Create a workflow --- Design a workflow that awards 150 points for completing 10 transactions within a specified timeframe and location. In our particular use case, this will apply during the weekend when the grand opening of the stationary shop will take place. For the purposes of this use case, we will use the `ShopID` of the stationary shop, which is **POS4**. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Profile Event trigger node At this stage, we will configure the conditions that launch the workflow. As a trigger, we will use the `transaction.charge` event. 1. As the first node of the workflow, add **Profile Event**. In the configuration of the node: 1. From **Choose event** dropdown menu, choose the `transaction.charge` event. 2. Click the **+ where** button and from the dropdown list, choose **shopID**. 3. From the **Choose operator** dropdown, select **Equal**. 4. In the text field, type the name of the **shopID**, as `POS4`. 5. Click the **+ where** button and from the dropdown list, choose **revenue**. 6. From the **Choose operator** dropdown, choose **More or equal to**. 7. In the text field enter `10`. 8. Click the **+ where button** and from the dropdown list, choose **TIMESTAMP**. 9. From the **Choose operator** dropdown, choose **Custom (Date)**. 10. Click **Select date range**. 11. Set the time range in which your promotion is active. In this use case, it will be one week. 2. Confirm by clicking **Apply**.
Profile
Profile Event trigger node
### Configure the Generate Event node In this part of the process, you will create a node that generates a `points.loyalty` event which adds extra loyalty points. This event is created in addition to the regular `points.loyalty` event. In result, the customer receives points for a purchase in the specific point of sales twice: - Points based on the loyalty points schema described as a part of prerequisites. - Extra points through this workflow. The body of the additional event will contain 150 bonus points for purchases in location - POS4. 1. As the second node of the workflow, add **Generate Event**. 2. In the **Event name** field, enter `points.loyalty`. 4. In the **Body** section, define the parameters of this event, and click **Apply**. **Example content of **Body** section:**
{
     "bonusType": "location - POS4",
      "points": "150"
   }
The event body is an example. You can add more parameters or change the point calculation, perform any mathematical formula according to your business needs.
Generate Event node configuration
Generate Event node configuration
### Add the end node --- 1. On the **Generate Event** node, click the plus icon. 2. From the dropdown list, select **End**. 3. Optionally, define **capping**. 4. Optionally, add titles to each node so the workflow will be more understandable to your colleagues. 5. In the upper right corner, click **Save & Run**.
Automation Hub workflow for awarding loyalty points for POS transactions
The workflow configuration
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of the [workflow](https://app.synerise.com/automations/automation-diagram/db6e214d-59ee-49e1-ac73-62341017f825) directly in Synerise Demo workspace: If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 5 events per profile that completes the flow: [`transaction.charge`](/docs/assets/events/event-reference/items#transactioncharge) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`points.loyalty`](/docs/assets/events/event-reference/loyalty#pointsloyalty) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Expressions](/docs/crm/expressions) - [Loyalty programs basics](/use-cases/loyalty-programs-basics) # Loyalty points for the first purchase after registration There are various strategies to motivate new customers to join your loyalty program, boost revenue, and encourage repeat purchases, ultimately fostering long-term loyalty. One effective approach is to provide customers with rewarding loyalty points immediately upon registration, coupled with a minimum transaction requirement. By offering these points, you incentivize customers to increase their spending while providing them with a valuable currency that can be used to unlock a range of rewards, discounts, and exclusive benefits. In this use case, we will create a workflow that grants 100 loyalty points for new loyalty program members. This offer will be available for transactions equal to or higher than 10$. ## Prerequisites --- - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). - Add a [custom event](https://hub.synerise.com/api-reference/data-management#operation/CustomEvent) to save data to customers' profiles when they perform an activity. In this particular use case: `points.register` - Integrate Synerise [mobile SDK](/developers/) in your mobile application. - Integrate mechanism for awarding loyalty points.
Find more in the [Loyalty programs basics](/use-cases/loyalty-programs-basics) use case.
## Security configuration --- Before you start working with this hub, if you are a Synerise customer or partner, consider reading [the section about denylisting events](/docs/settings/tool/api#denylist). This natively accessible configuration will allow you to manage the restrictions in points management that may help you prevent fraud. ## Process --- In this use case, you will go through the following steps: 1. [Create a segmentation](#create-a-segmentation) that groups customers that already have loyalty points for registration. 2. [Create a workflow](#create-a-workflow) which grants 100 loyalty points for the first purchase worth a minimum $10 after registration. ## Create a segmentation --- In this part of the process, you create a segmentation based on the `points.register` event. 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter a meaningful name for the segmentation. 3. Click the **Add condition** and from the dropdown list, select the `points.register` event. 4. In the calendar in the right bottom of the page: 1. In the **Relative date range** section, click **More** and from the dropdown list, select **Lifetime**. 2. Click **Apply**.
Decision Hub segmentation configuration filtering customers who registered for the loyalty program
Segmentation configuration
5. Click **Save**. The segment is saved and can be viewed in **Preview**. ## Create a workflow --- Create a workflow that grants 100 loyalty points for the first purchase for a minimum value to customers who register for the first time. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Profile Event trigger node At this stage, we will configure the conditions that launch the workflow. As a trigger, we will use the `transaction.charge` event with value equal to or higher than $10. 1. As the first node of the workflow, add **Profile Event**. In the configuration of the node: 1. From **Choose event** dropdown menu, choose the `transaction.charge` event. 2. Click the **+ where** button and from the dropdown list, choose **$revenue**. 3. From the **Choose operator** dropdown, select **More or equal to (Number)**. 4. In the text field, type the minimal value of the transaction. In our case it will be `10`. 5. Confirm by clicking **Apply**.
The view of the Profile Event node configuration
Profile Event node configuration
### Define the Profile Filter node As the next step, add the Profile Filter node, which checks if the customer already has points for the registration. If the customer has not yet received loyalty points for registration, then in the next step we will generate an event with those points for them, and if they have already received points, then the workflow ends. 1. Add **Profile Filter** node. 2. Click **Choose filter > Profiles > Segmentations** and from the dropdown list, select [the segmentation you created in the previous step](#create-a-segmentation). 3. From the **Choose operator** dropdown, choose **Is true (Boolean)**. 4. Click **Apply**.
Automation Hub Profile Filter node checking customer segmentation for existing loyalty points
Profile Filter node configuration
### Congifure the Generate Event node 1. To the **Not matched** path, add a **Generate Event** node. 2. In the settings of the node: 1. Enable the **Action limit** toggle. 2. In the **Event name** field, enter the name of the event. In our case, we are using `points.register` event. 4. In the **Body** section, use the following code and modify it to your needs:
{
               "points": "100"
               }
3. Click **Apply**.
The view of the Generate Event node configuration
Generate Event node configuration
### Add final setting to your workflow 1. Add the **End** node to both paths. 2. Launch the workflow by clicking **Save&Run**.
Automation Hub workflow for awarding loyalty points on registration
Configuration of the workflow
## Check the use case set up on the Synerise Demo workspace --- In Synerise Demo workspace, you can check the configuration of: - [Segmentation](https://app.synerise.com/analytics-v2/segmentations/5b6f8c9a-5bef-4902-acd7-46bad11e976f) - [Workflow](https://app.synerise.com/automations/automation-diagram/637d8052-4bff-4040-81db-afd3f1db59c7) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 6 events per profile that completes the flow: [`transaction.charge`](/docs/assets/events/event-reference/items#transactioncharge) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~2), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), `points.register` (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Jinjava inserts](/developers/inserts) - [Snippets](/docs/assets/snippets) - [Segmentation](/docs/analytics/segmentations) # Birthday email with coupon It is very important to improve customer loyalty with special **birthday coupons**. On your customer’s special day you can send them a code and at the same time reward yourself with a good chance of more sales for your online business. Your customers will definitely have a positive reaction when you help to celebrate the occasion and having a gift in the form of discount will make them more likely to spend. If you add automatic birthday emails into your loyalty program it will enable you to build a **more engaged and loyal** customer base. ## Example of use - Retail industry A customer from the fashion industry had a loyalty club where users shared their date of birth. Based on this information, the company could prepare a birthday email. As a medium, they used email. Customers received an individual discount coupon on their birthday for **20% off** on any product, valid for 14 days. The coupon was valid in both offline and online stores.
Email with a birthday coupon
Email with a birthday coupon
**Results** - OR 12,16% - CTR 18,43% ## Prerequisites --- - Implement [Synerise tracker](/developers/web/installation-and-configuration#creating-a-tracking-code) on your website. - [Email account configuration](/docs/campaign/e-mail/configuring-email-account). - Import of customer base with birthdate in format YYYY-MM-DD. - Import of [code pools](/docs/assets/code-pools). ## Process --- To prepare such a scenario, you have to follow 4 important steps. 1. [Import user base](/use-cases/birthday-coupon#import-user-base). 2. [Prepare coupon pool](/use-cases/birthday-coupon#prepare-coupon-pool). 3. [Prepare an email template](/use-cases/birthday-coupon#prepare-an-email-template). 4. [Prepare workflow](/use-cases/birthday-coupon#prepare-workflow). ## Import user base --- To be able to send a message to users on their birthday, you have to store information about their birthdate. You can prepare a one-time **csv import**, which in basic format may contain only 2 columns: 1. email address. 2. date of birthday.
To prepare this use case, birthdates must be in the YYYY-MM-DD format.
Explanation

Import the prepared file to Synerise as import Clients according to the manual found here. Also you can update users via API, or send it from forms. No matter which method you use, you have to map those fields as Synerise default attributes: email and birthDate.

## Prepare coupon pool --- On a user’s birthday, you can send each of them an individual coupon code with a discount. To do it, you will have to import to Synerise coupons previously prepared in your ecommerce platform, which will apply the appropriate discount in the shopping cart. 1. To import such coupons, go to Vouchers and prepare a **Voucher pool**, to which you will add your coupons. 2. Add an obligatory **Pool name**, and set the Emission start and end dates. 3. When the pool is created, click **Import** and choose **CSV with vouchers**.
Screenshot presenting birthday coupon
Prepare coupon pool
Remember that your csv should have only 1 column, without a name.
## Prepare an email template --- To distribute coupon codes in an email, prepare a template. 1. Go to **Experience Hub > Emails > Templates > Drag&drop builder** or **Code editor** to create email template. 2. Click **Inserts** in the upper right corner, find Pools on the list of inserts, then choose the **Coupon pool** prepared in the previous step. 3. Copy and paste it in the place where the coupon code should be shown to the user. Instead of **{% voucher %} voucher-hash {% endvoucher %}**, user will see his individual coupon code.
Screenshot presenting email template for birthday coupon
Prepare email template
If your codes have the appropriate format, you can insert them as barcodes, details [here](/developers/inserts/insert-usage#barcodes).
## Prepare workflow --- To start sending your prepared email template you have to create a workflow, which in basic configuration may look like the one below. To do this, go to **Automation Hub > Workflows > New workflow**.
Screenshot presenting automation for birthday coupon
Prepare a workflow
### Add the Audience node To start the workflow for every user who has a birthday on a given date, select the **Audience** node. Set the **Run trigger** option to **repeatable** with 1-day interval.
Screenshot presenting choose the Audience trigger
Audience trigger
### Set up the birthday attribute Your audience in this trigger has to be customers who have a birthday on this day. During segment creation choose the birthdate attribute, select date format and indicate that value in this attribute has to match the current day and month.
Screenshot presenting choose the birthdate attribute
Birthdate attribute
### Set up the birthday email When you finish setting up the birthday attribute, you can set the **Send Email** node by selecting the appropriate email account, choosing the template that you prepared previously and adding the email subject and UTMs.
Screenshot presenting Set the Send Email node
Email datail
### Prepare the final settings 1. **Add End nodes** where the workflow should finish for users. 2. Define **capping**. 3. Optionally, **add titles** to each node so the workflow will be more understandable to your colleagues. 4. Name the **workflow**. 5. To save it as a draft, click Save, or activate the workflow by clicking **Save & Run**.
Set capping 1 for 1 year to avoid a situation in which the customers change their date of birth to get an additional discount twice or more.
## Check the use case set up on the Synerise Demo workspace --- Check the [workflow settings](https://app.synerise.com/automations/automation-diagram/51b318f7-e9dc-477e-9a95-a7b99ee5a2d0) in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 7 events per profile that completes the flow: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`voucherCode.assigned`](/docs/assets/events/event-reference/loyalty#vouchercodeassigned) (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1). ## Read more --- - [Creating code pools](/docs/assets/code-pools) - [Email templates](/docs/campaign/e-mail) - [Import clients](/docs/automation/actions/synerise-integrations/import-customers) - [Inserting coupons](/developers/inserts/insert-usage#code-pools) - [Updating users via API](https://hub.synerise.com/api-referenceClientManagement/ClientManagement.html#operation/BatchAddOrUpdateClients ) - [Workflow](/docs/automation) # Secret sale --- Personalized offers are more effective than intrusive advertising. When you offer something that is tailored to your target group, it is more likely to be successful. In fact, there are many ways that companies can use **personalized offers to increase their sales**. One of the most popular ways is through personalized discount for a given segment of users who might be interested in such a product. You should use appropriate group of recipients and personalize discount based on their behavior, products they visited etc. This method is often used to reach out to potential customers and get them interested in **specific offer**. ## Example of use - Retail industry (jewelry) **Challenge** For one of our customers we prepared a special temporary campaign that worked for the needs of the internal marketing strategy. For a given segment of users, the client offered a reduction in the prices of products from 5 collections if the product chosen by the user had the right weight of stones. In this case it was one carat. We segregated the appropriate group of recipients who might be interested in such a product (they visited products from these collections). Then, we displayed a message to them **when they clicked on the dropdown menu with the weight of the stone**. The message was visible only to logged-in users. Also, in order to check how the campaign worked, we collected information on the size of the stones that were added on the product card and what was finally placed in the basket. ![Screenshot presenting secret sale](/api/docs/image/f8a57079df9dd82ae8b22dc747691385d7d51d29/use-cases/all-cases/_gfx/secret-sale.png) ## Requirements --- - Tracker key - Sending data about the carats based on custom events ## How to do it --- 1. Create dynamic content that contains code that will display messages.
(function()
   {if (document.querySelector('.account-link')){ // collecting information about whether the user is logged in 
   document.querySelectorAll(".current")[1].addEventListener("click", function () { // condition that the campaign should be displayed after clicking the dropdown with a mass of stone 
   document.querySelector('.sale').style.display='block'; // event that is sent when the campaign is displayed 
   SR.event.trackCustomEvent('sale', {
   action: "rings_show"
   }, 'Secret sale');
   });
   } 
   }());
2. Apply appropriate settings that will allow messages to be displayed on selected collections. 3. Attach custom events to measure campaign results. 4. Create analytics that will allow you to check campaign performance. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), `sale` (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1). ## Read more --- - Read more about [custom events](/developers/web/event-tracking#declarative-tracking-custom-events) - Read more about [dynamic content campaigns](/docs/campaign/dynamiccontent) # Step discount promotion Elevate your customers engagement with step discounts, aligning savings with their journey, while strengthening their connection to your brand. Enable them to access higher discounts with each transaction, incentivizing loyalty and fostering more interactions. Transform their shopping experience into a journey towards greater value, connecting them with offers that resonate. This use case describes how to create a step discount promotion for one product. The customer will receive a discount of 5, 10 and 15% respectively on the first, second and third purchase of the same product. The promotion will work only for loyalty program members (customers logged into the mobile app). ## Prerequisites --- - Implement promotions in your [mobile application](/developers/mobile-sdk/loyalty), website or through [API](https://hub.synerise.com/api-reference/loyalty-and-engagement#operation/profileLogin) - [Implement transactional events](/developers/web/methods-reference#tracking-transactions). - [Import the product feed to a catalog](/use-cases/import-product-feed-to-catalog). ## Process --- In this use case, you will go through the following steps: 1. [Prepare a segmentation](#prepare-a-segmentation) of customers who are members of the loyalty program. 2. [Create a promotion](#create-a-promotion) with step discount for one product. ## Prepare a segmentation --- In this part of the process, create a segmentation of customers who are members of the company's loyalty program. 1. Go to Behavioral Data Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of segmentation. 3. From the **Add condition** dropdown list, select the **loyaltyCard** attribute. 4. As the logical operator select Boolean **Is true**.
The conditions used in the segment will vary depending on your loyalty program integration (for example, the name of the attribute may be different). You must define the segmentation accordingly.
## Create a promotion --- Create a step discount promotion aimed at loyalty club members for one specific product. The promotion gives a 5, 10 and 15% discount for the item, the discount grows with every transaction. 1. Go to AI Hub icon **AI Hub > Regular Promotions > Add Promotion**. 2. Enter a name for the promotion. 3. Select the **For selected items** type of promotion. 4. In the **Audience** section, select the [segmentation created in the previous step](#prepare-a-segmentation). 5. In the **Content** section: 1. Define the name, descriptions, thumbnail and image of the promotion. 3. Optionally, you can add tags to the promotion and JSON code with advanced params. 2. Confirm the settings by clicking **Apply**.
The view of Content configuration
Content configuration
6. In the **Type and limits** section: 1. Leave **General** in the **Type section**. 2. Enter a **Priority** for the promotion.
Priority defines the order of display in the customer’s view. 1 is the highest priority. If two or more promotions applicable to a customer have the same priority, the order of display is determined by the date of creation. The one that was created earlier takes the priority over the other promotion.
3. Leave **Single** for the promotion logic. 4. In the **Limit per profile** field, type 1. 5. From the **Discount type** dropdown list, select **Percentage**. 6. From the **Discount mode** dropdown list, select **Steps**. 7. Assign **Transaction number** for each **Discount value**.
The view of configuration of discount thresholds for each purchase
Configuration of discount thresholds for each purchase
8. Confirm the settings by clicking **Apply**.
AI Hub promotion Type and limits section with step discount mode showing transaction number thresholds
Type and limits configuration
7. In the **Schedule** section, specify the time, when you want to display your promotion according to yout business needs. 8. In the **Items** section: 1. From the **Source catalog** dropdown list, select a catalog of items. 2. In the **Include items** section, choose **Selected items**. 3. Click **Select items** and select the product you want the step discount to apply to.
The view of Items configuration
Items configuration
10. Optionally select **stores** where the profiles can redeem the promotion. 9. To apply configuration and run the promotion, click **Publish**. ## Check the use case set up on the Synerise Demo workspace --- You can also check the configuration of the [segmentation](https://app.synerise.com/analytics-v2/segmentations/614f5ac1-8bdb-41ec-8d9d-8ad2d6cd65f2) and [promotion settings](https://app.synerise.com/campaigns/promotions/97531b2e-0440-4bf0-806b-52ab594d9c06) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 9 events per profile that completes the flow: [`client.activatePromotion`](/docs/assets/events/event-reference/loyalty#clientactivatepromotion) (~3), [`transaction.charge`](/docs/assets/events/event-reference/items#transactioncharge) (~3), [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~3). ## Read more --- - [Catalogs](/docs/assets/catalogs/introduction-to-catalogs) - [Promotions](/docs/ai-hub/promotions) - [Segmentation](/docs/analytics/segmentations) # Send offline conversion to Google Ads With Synerise, businesses can optimize their marketing strategies and bridge the gap between digital advertising and brick-and-mortar sales. By integrating online and offline operations, you can accurately track conversions from Google Ads when customers purchase through an ad and choose in-store pickup and payment. Thanks to Synerise's integration with Google Ads, you can automate the process of sending offline conversions to your Google Ads account. This seamless attribution of offline conversions to specific ad campaigns empowers businesses to optimize their marketing strategies and successfully connect digital advertising with brick-and-mortar sales. It's important to note that an offline conversion can encompass various offline events, such as visiting a store, restaurant, or any other conversion event your business recognizes. In this use case, we will create a workflow to send offline conversion data to Google Ads. The workflow will be triggered by a custom event - purchase through an ad with in-store pickup and payment. ## Prerequisites --- - [Implement SDK to a website](/developers/web/installation-and-configuration) to which a profile is referred after clicking the ad. - [Implement sending events about completing offline conversion](https://hub.synerise.com/api-reference/data-management#operation/CustomEvent). It can include `value` and `currency` parameters (there is an option to send these additional parameters to Google Ads) - Create a Google Ads account. - Launch an ad campaign through Google Ads. - [Create an event expression](/docs/automation/integration/google-ads/google-ads-send-offline-conversions#create-an-expression) to extract the `gclid` parameter from the URL of visited website. - [Create an aggregate](/docs/automation/integration/google-ads/google-ads-send-offline-conversions#create-an-aggregate) that retrieves the value of the `gclid` parameter from the latest page visit to your website (or according to your business needs).
In this case, the conversion will be attributed to the last clicked ad before the conversion. This attribution is configurable, allowing you to determine which clicked ad should be associated with the conversion. You can configure these settings by specifying the date or other conditions, or by changing the aggregator from "last" to "first."
## Create a workflow to send conversion data to Google Ads --- Create a workflow which sends offline conversion data to Google Ads, after a customer pays for an order in a brick-and-mortar store. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the trigger node As a trigger, we will use the `offline.transaction` custom event for a transaction made in brick-and-mortar store when picking up an order. 1. As the first node of the workflow, add **Profile Event**. 2. In the configuration of the node, from the **Choose event** dropdown menu, choose `offline.transaction` event. 2. Click **Apply**. ### Configure the Send Offline Conversion node 1. As the next node, add **Google Ads > Send Offline Conversion**. 2. In the configuration of the node, from the dropdown list, select the connection. - If no connections are available or you want to create a new one, see [Create a connection](/docs/automation/integration/google-ads/google-ads-send-offline-conversions#create-a-connection). - If you selected an existing connection, proceed to next step. 2. In the **Google Ads customer ID** field, enter the ID of the Google Ads account. It can't contain dashes. [Learn how to find this number](https://support.google.com/google-ads/answer/1704344?hl=en). 2. In the **The Google click ID (GCLID) associated with this conversion** field, enter the part of the URL that starts with `?gclid=`. For that purpose, you can enter a Jinjava tag that inserts the value of the [aggregate you created as the part of the prerequisites](#prerequisites): `{% aggregate AGGREGATE_ID %}{{ aggregate_result[0] }}{% endaggregate %}`. Replace the `AGGREGATE_ID` with an actual ID of the aggregate, you can find it in the URL while previewing the aggregate. 5. In the **Conversion action ID** field, enter the ID of the conversion. You can find it in the Google Ads panel. When you go to conversion action details, the URL contains the `ctId` parameter (for example, `ctId=123456789`) whose value is the conversion action ID. [Learn more about conversion action in Google Ads](https://support.google.com/google-ads/answer/6032150?hl=en). 6. In the **Conversion time** field, enter the time of the conversion in the following format: `yyyy-mm-dd hh:mm:ss+|-hh:mm`. For that purpose, you can use [a Jinjava code](/developers/inserts/automation) that inserts date of conversion dynamically, from the trigger, that is, offline conversion. For example, `{{ event.params.time|timestamp_to_time|datetimeformat('%y-%m-%d %H:%M:%S+2:00') }}`. 7. Optionally, in the **Conversion value for the advertiser** field, enter the value. For that purpose, you can use [a Jinjava code](/developers/inserts/automation) that inserts the value dynamically based on the event context from the trigger, that is, offline conversion. For example, `{{ event.params.value }}`. 8. Optionally, in the **Currency associated with the conversion value** field, enter the currency. For that purpose, you can use [a Jinjava code](/developers/inserts/automation) that inserts the value dynamically based on the event context from the trigger, that is, offline conversion `{{ event.parmas.currency }}`. 9. In **Customer match consent import script** type jinjava script to import customer match consent from your database. You can use constant value. 10. In **Ad Personalization consent import source** type jinjava script to import ad personalization consent from your database. You can use sonstant value. 9. Confirm the settings by clicking **Apply**.
The view of the configuration of the Send Offline Conversion node
Configuration of the Send Offline Conversion node
### Add the finishing node 1. Add the **End** node. 2. In the upper right corner, click **Save & Run**. **Result**:
Automation Hub workflow for sending offline conversion data to Google Ads
Workflow configuration
## Check the use case set up on the Synerise Demo workspace --- In Synerise Demo workspace, you can check the configuration of: - [expression](https://app.synerise.com/analytics/expressions/3e366c6a-f4a4-4013-8c92-e3b22274e296) - [aggregate](https://app.synerise.com/analytics/aggregates/8ebdd493-0d08-3ad0-9aa8-d87c616ca286) - [workflow](https://app.synerise.com/automations/automation-diagram/4bac04d4-f883-4800-8b83-215b9a123a43) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 5 events per profile that completes the flow: `offline.transaction` (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`googleAds.sendOfflineConversion`](/docs/assets/events/event-reference/integration#googleadssendofflineconversion) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Automation Hub](/docs/automation) - [Expressions](/docs/crm/expressions) - [Google Ads integration](/docs/automation/integration/google-ads) - [Reusing event context from preceding nodes](/developers/inserts/automation) # Send Automated Slack Messages Based on Metric Results You can integrate Synerise with Slack using a dedicated node to build a variety of business scenarios. One of them is building a workflow that sends messages to a Slack channel based on metrics, expressions, reports or any other analyses created in Synerise. This particular use case reuses a metric (which is a part of an analytical dashboard) that counts the number of customers who signed up for the video call the day before. The message to the channel contains information with the value of the metric.
Screenshot presenting personalized search on a website with no results
Slack integration
## Prerequisites --- - Create [an incoming webhook in Slack](https://api.slack.com/messaging/webhooks). - Implement [an event](/docs/assets/events/event-definitions) that you want to use in the metric whose result will be sent in a message to a Slack channel.
In this use case, we track data from the form that enables to sign up for the video call using [SDK form tracking method](/developers/web/tracking-form-data/tracking-form-data-sdk). This method generates a `form.submit` event which we will later used in the metric. Learn more about other ways to implement events using [web SDK](/developers/web/event-tracking#declarative-tracking-custom-events), [mobile SDK](/developers/mobile-sdk/event-tracking) or [API](https://hub.synerise.com/api-reference/data-management#operation/CustomEvent).
## Process --- 1. [Create a metric in Synerise](/use-cases/slack-integration#create-a-metric-in-synerise). 3. [Create a workflow in Synerise](/use-cases/slack-integration#create-a-workflow-in-synerise). ## Create a metric in Synerise --- In this step, we will create a metric whose result will be later sent in the Slack message. The configuration is exemplary, it may vary depending on your implementation of events. 1. In Synerise, go to Decision Hub icon **Decision Hub > Metrics > New metric**. 2. Leave the metric kind at default (**Simple**). 3. Leave the metric type at default (**Event**) 2. From the **Choose event** dropdown list, select the **form.submit** event. 3. As the event parameter, select the **formType**. 4. As a logical operator, select **Equal (String)**. 5. In the text field, enter `videocall`.
Configuration of the metric that calculates the number of sign-ups for a video call the day before
Configuration of the metric that calculates the number of sign-ups for a video call the day before
In this use case, the metric is included in the [analytical dashboard](/docs/analytics/analytics-dashboard) which is later linked in the alert message in Slack.
## Create a workflow in Synerise --- In this part of the process, you will create a workflow that sends a message to a Slack channel with the number of customers who signed up for a video call. The message will contain the metric result and the link to the analytical dashboard that contains the metric. 1. In Synerise, go to **Automation Hub > Workflows > New workflow**. 2. Start with the **Scheduled Run** node. In the configuration of the node: 1. Set the **Run trigger** option to **all time**. 2. Select the **Everyday** tab. 3. Select the time zone. 3. Select the time when the workflow will be launched. 4. Confirm by clicking **Apply**.
Configuration of the workflow that sends alert messages with the metric results to the Slack channel
Configuration of the workflow that sends alert messages with the metric results to the Slack channel
### Configure Slack Integration node In this step, you will configure the settings of the outgoing integration that sends the message to a Slack channel. #### Create a connection 1. On the **Scheduled Run** node, click **THEN**. 2. From the dropdown list, select **Slack > Send Channel Message**. 3. In the configuration of the node: - If you already create a connection, select the connection from the list. - If you haven't created any connection yet: 1. At the top of the dropdown list, click **Add connection**. 2. In the **Incoming Webhook URL** field, enter the incoming webhook URL you created as a part of [prerequisites](/use-cases/slack-integration#prerequisites). 3. Click **Next**. 4. In the **Connection name** field, enter the name for the connection you created. 5. Click **Apply**. **Result**: A connection is created and selected. #### Define the integration parameters 1. In the **Type of message** field, choose **interactive message (JSON)**. 2. Below add JSON body of message which should be sent to Slack channel.
{
       "blocks": [
           {
               "type": "section",
               "text": {
                   "type": "mrkdwn",
                   "text": "Number of people signed in for the videocall: `{% metricsvar metric_id:XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX %}{{ metric_result }}{% endmetricsvar %}`\nNumber of people having the videocall today: `{% metricsvar metric_id:XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX %}{{ metric_result }}{% endmetricsvar %}`"
               },
               "accessory": {
                   "type": "button",
                   "text": {
                       "type": "plain_text",
                       "text": "check dashboard",
                       "emoji": true
                   },
                   "url": "https://app.synerise.com/spa/modules/dashboards/analytics/dashboards/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
               }
           }
       ]
       }
In the JSON body: - Insert the ID of the metric you created in the [previous step](/use-cases/slack-integration#create-a-metric-in-synerise). - Optionally, if you want to refer users to the analytical dashboard, for the `url` parameter, insert the link to the dashboard. If you choose not to, remove the `accessory` object from the JSON body. 3. Confirm by clicking **Apply**. 5. Add the **End** node. 6. Launch the workflow by clicking **Save&Run**.
Configuration of the workflow that sends alert messages based on the metric results to the Slack channel
Configuration of the workflow that sends alert messages based on the metric results to the Slack channel
**Result**: The message is sent to the Slack channel.
Message on the Slack channel
Message on the Slack channel
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of use case in Synerise Demo workspace: - [Metric](https://app.synerise.com/analytics/metrics/b4a6958d-7f86-47d6-a8c8-c89fe1c76aba) - [Workflow configuration](https://app.synerise.com/automations/workflows/automation-diagram/3509dfae-73b4-4333-9e16-c3d957568748) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 4 events per workflow execution: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`slack.sendChannelMessage`](/docs/assets/events/event-reference/integration#slacksendchannelmessage) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Integration](/docs/automation/integration) - [Inserts](/developers/inserts) # Manage loyalty points expiration with rolling logic In many loyalty programs, points remain valid only for a limited period of time. To manage this process effectively, it is important to accurately calculate when points expire and update customer balances accordingly. There are two common approaches to handling point expiration. The first is rolling cancellation, where each points-earning event has its own expiration date calculated from the moment the points were awarded. The second is batch expiration, where points are removed periodically for the entire customer base according to predefined rules. In this use case, we focus on the more flexible rolling expiration model, in which points expire individually after a defined validity period. This approach allows you to maintain accurate point balances, monitor expiring points continuously, easily modify point expiration rules, and proactively inform customers about upcoming point reductions. #### Use case assumptions The expiration mechanism can be configured in many different ways depending on business requirements. For the purpose of this use case, we assume the following setup: - Loyalty points are awarded through the `points.loyalty` event based on the `transaction.charge` event which generates the points. Optionally, you can implement other loyalty point-earning events for different actions (such as completing a survey, newsletter subscription, fast order pickup etc). - Points can be spent on rewards through the `client.activatePromotion` event. - The default retention of the two above mentioned events is set to 30 days, however we recommend to change it to infinite. - Each point-earning event can have its own configurable expiration time, however in this case we assume that points which have not been redeemed expire after 6 months (182 days) from the moment they are awarded. - Expired points are recorded with the `points.expire` event generated by workflow and later used in expressions calculating the current balance. - The expiration process runs daily. ## Prerequisites --- Integrate mechanism for awarding loyalty points. With the help of Synerise support implement the `points.loyalty` and `client.activatePromotion` events, as well as necessary custom loyalty events.
Find more in the [Loyalty programs basics](/use-cases/loyalty-programs-basics) use case.
## Security configuration --- Before you start working with this hub, if you are a Synerise customer or partner, consider reading [the section about denylisting events](/docs/settings/tool/api#denylist). This natively accessible configuration will allow you to manage the restrictions in points management that may help you prevent fraud. ## Process --- In this use case, you will go through the following steps: 1. [Create an aggregate summing collected points](/use-cases/rolling-points-expiration#create-an-aggregate-summing-collected-points). 2. [Create an aggregate summing expired points](/use-cases/rolling-points-expiration#create-an-aggregate-summing-expired-points). 3. [Create an aggregate summing points redeemed on promotions](/use-cases/rolling-points-expiration#create-an-aggregate-summing-points-redeemed-on-promotions). 4. [Create an aggregate summing all points are to potentially expire](/use-cases/rolling-points-expiration#create-an-aggregate-summing-all-points-that-are-to-potentially-expire). 5. [Create an expression summing aggregates with all lost points](/use-cases/rolling-points-expiration#create-an-expression-summing-aggregates-with-all-lost-points) 6. [Create an expression calculating current point balance](/use-cases/rolling-points-expiration#create-an-expression-calculating-current-point-balance) 7. [Create an expression calculating points to expire](/use-cases/rolling-points-expiration#create-an-expression-calculating-points-to-expire) 8. [Create a segmentation of customers with points to expire](/use-cases/rolling-points-expiration#create-a-segmentation-of-customers-with-points-to-expire) 9. [Create a workflow](/use-cases/rolling-points-expiration#create-a-workflow) ## Create an aggregate summing collected points --- Start with creating an aggregate which returns the sum of points for the `points.loyalty` event. We recommend setting the analyzed period to **Lifetime**. The result of the aggregate will be used in an expression calculating current point balance. 1. Go to Behavioral Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 3. Enter the name of the aggregate. 4. Click **Analyze profiles by** and select **Sum**. 5. Select the `points.loyalty` event. 6. As a parameter, choose `points`. 7. Set the analyzed period to **Lifetime**. 8. Click **Save**.
Decision Hub aggregate summing the points parameter of all points.loyalty events in a customer's lifetime
The configuration of an aggregate summing all points.loyalty events in a customer’s lifetime
## Create an aggregate summing expired points --- In this part of the process, create an aggregate which returns the sum of expired points based on the `points.expire` event. We recommend setting the analyzed period to **Lifetime**. The result of the aggregate will be used in an expression calculating all lost points. 1. Go to Behavioral Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 3. Enter the name of the aggregate. 4. Click **Analyze profiles by** and select **Sum**. 5. Select the `points.expire` event. 6. As a parameter, choose `points`. 7. Set the analyzed period to **Lifetime**. 8. Click **Save**.
Decision Hub aggregate summing the points parameter of all points.expire events in a customer's lifetime
The configuration of an aggregate summing all points.expire events in a customer’s lifetime
## Create an aggregate summing points redeemed on promotions --- In this stage of the process, create an aggregate that counts the sum of redeemed points based on `client.activatePromotion` event. We recommend setting the analyzed period to **Lifetime**. The result of the aggregate will be used in an expression calculating all lost points. 1. Go to Behavioral Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 3. Enter the name of the aggregate. 4. Click **Analyze profiles by** and select **Sum**. 5. Select the `client.activatePromotion` event. 6. As the event parameter, select `promotionRequireRedeemedPoints`. 7. Set the analyzed period to **Lifetime**. 8. Click **Save**.
Decision Hub aggregate summing the promotionRequireRedeemedPoints parameter of all client.activatePromotion events in a customer's lifetime
The configuration of an aggregate summing all client.activatePromotion events in a customer’s lifetime.
## Create an aggregate summing all points that are to potentially expire --- In this step, create an aggregate that returns the total number of loyalty points awarded more than 182 days ago based on the `points.loyalty` event. These points may have reached the expiration threshold and could potentially expire at the time of calculation. The analyzed time range is set from 20 years ago up to 182 days before today. This allows the aggregate to include all historical point-earning events that are old enough to be considered for expiration. Since the system does not allow setting an infinite time range, 20 years is safe to use instead of lifetime. The result of this aggregate will be used later in an expression that calculates how many points should expire. 1. Go to Behavioral Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 3. Enter the name of the aggregate. 4. Click **Analyze profiles by** and select **Sum**. 5. Select the `points.loyalty` event. 6. As a parameter, choose `points`. 7. Set the analyzed period to last **20 years** before **182 days**. 8. Click **Save**.
Decision Hub aggregate summing points.loyalty events from 20 years ago up to 182 days before today to identify historically earned points eligible for expiration
The configuration of an aggregate summing all points.loyalty historical events up to the date points are to potentially expire in 6 months
## Create an expression summing aggregates with all lost points --- In this part of the process, prepare an expression which is a sum of two aggregates created in the previous steps: [aggregate summing expired points](#create-an-aggregate-summing-expired-points) and [aggregate summing redeemed points](#create-an-aggregate-summing-points-redeemed-on-promotions). 1. Go to Behavioral Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. From the **Expressions for** dropdown list, select **Attribute**. 3. Build the following formula of the expression:
Behavioral Data Hub expression formula summing aggregates of expired and redeemed loyalty points
Formula of an expression summing up aggregates with all lost points
4. Save the expression. ## Create an expression calculating current point balance --- In this part of the process, prepare a current point balance expression by substracting lost points (the sum of [aggregate summing expired points](#create-an-aggregate-summing-expired-points) and [aggregate summing redeemed points](#create-an-aggregate-summing-points-redeemed-on-promotions)) from all points gathered ([aggregate summing collected points](#create-an-aggregate-summing-collected-points)). 1. Go to Behavioral Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. From the **Expressions for** dropdown list, select **Attribute**. 3. Build the following formula of the expression:
Behavioral Data Hub expression formula calculating current loyalty point balance
Formula of an expression calculating the current point balance
5. Save the expression. ## Create an expression calculating points to expire --- In this part of the process, we create a formula that will tell how many points should be counted as expired, taking into account that some of them may already have been used on rewards. The result of this expression will be used in the segmentation of customers whose points should expire. This expression is based on the condition that if the number of collected points returned by the [aggregate summing all points that reached the expiration threshold](#create-an-aggregate-summing-all-points-that-are-to- potentially-expire) is equal to or lower than the results of the [expression summing aggregates with all lost points](#create-an-expression-summing-aggregates-with-all-lost-points) which includes all points already deducted from the balance up to this moment (in this case, up to 6 months ago), then we assume that all points eligible for expiration have already been redeemed or expired. In this case, the expression returns 0. Otherwise, we subtract the value of the [expression summing aggregates with all lost points](#create-an-expression-summing-aggregates-with-all-lost-points) from the result of the [aggregate summing all points that reached the expiration threshold](#create-an-aggregate-summing-all-points-that-are-to-potentially- expire). The returned value equals the number of points that should expire. 1. Go to Behavioral Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. From the **Expressions for** dropdown list, select **Attribute**. 3. Build the following formula of the expression:
Behavioral Data Hub expression formula calculating loyalty points eligible for expiration
Formula of an expression calculating points to expire
4. Save the expression. ## Create a segmentation of customers with points to expire --- In this step, create a segment of users who have loyalty points eligible for expiration. This segment will serve as the audience for the daily workflow responsible for generating the `points.expire` event. The segmentation is based on the following conditions: - The user received loyalty points at least 182 days ago. In this simplified example, we check the occurrence of the `points.loyalty` event. If your loyalty program awards points through multiple events, you can include them using the OR operator. - The result of the [expression calculating points to expire](#create-an-expression-calculating-points-to-expire) is greater than 0. 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of the segmentation. 3. Choose **Add condition**. 4. From the dropdown list, choose the `points.loyalty` event. 5. As a parameter, choose `points`. 6. Select the **More than** operator. 7. In the left field, leave the **#** icon and enter `0` in the value field. 8. Using the date picker in the lower-right corner, set the time range to **Last 24 hours before 182 days**. 9. Choose **Add condition** once again. 10. From the dropdown list, choose the [expression calculating points to expire](#create-an-expression-calculating-points-to-expire) you have created in the previous part of the process. 11. Select the **More than** operator. 12. In the left field, leave the **#** icon and enter `0` in the value field. 13. Save the segmentation.
Segmentation settings
The configuration of a segmentation of users who have points to expire
## Create a workflow --- In this part of the process, you will create a simple workflow that runs daily, preferably shortly after midnight. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the trigger node --- The workflow is triggered for customers who belong to the [segmentation](#create-a-segmentation-of-customers-with-points-to-expire) created in the previous step every day at a defined time. 1. As the first node, add the **Audience** node. 2. In the configuration of the node, set the **Schedule** option to **Repeat runs**. 3. Select the correct time zone. 4. Set the interval to 1 per day. 5. Choose the day and time when the process starts. We recommend scheduling it a few seconds (5–10) after midnight. 6. In **Define audience**, choose **Segments**, click **Select segments** and select the [segmentation](#create-a-segmentation-of-customers-with-points-to-expire) created in the previous step. 7. Click **Apply**.
The view of the audience configuration
The configuration of Audience node
### Define the Generate Event node --- 1. Add the **Generate Event** node. In the node settings: 1. In the **Event name**, enter `points.expire`. 2. In the **Body section**, use the following Jinjava, entering the UUID of the [expression calculating points to expire](#create-an-expression-calculating-points-to-expire) which allows to dynamically generate events with points number personalized for each user.
{
                       "points": " {% expression %} a7d340ac-906d-49af-83a1-fbe4015bc76f {% endexpression %} ",
               }
The result of such action will be such an event:
The view of the points.expire event
The view of the points.expire event on customer's profile
2. Click **Apply**.
The view of the generate event node configuration
The configuration of Generate Event node
### Add the finishing node --- 1. Add the **End** node. 2. In the upper right corner, click **Save & Run**.
Automation Hub workflow for rolling loyalty points expiration
The configuration of the workflow for expiring points
## What's next --- Once the rolling expiration mechanism is configured, you can extend this setup with additional communication scenarios. For example, you can create a campaign that informs customers in advance about points that will expire soon. Sending a notification a few days or weeks before the expiration date helps customers use their points before they disappear. Such communication can include personalized information about the number of points that will expire and highlight rewards or promotions where those points can be redeemed. This approach not only improves the customer experience but also increases engagement with the loyalty program and can boost the number of transactions. ## Check the use case set up on the Synerise Demo workspace --- You can check all the analytics directly in the Synerise Demo workspace: - [Aggregate returning the sum of collected loyalty points](https://app.synerise.com/analytics-v2/aggregates/2d104df4-9de2-378e-ad28-1e3e70b66a23) - [Aggregate returning the sum of expired loyalty points](https://app.synerise.com/analytics-v2/aggregates/65310b9f-ec28-3317-8292-215891bb26a7) - [Aggregate returning the loyalty points redeemed on promotions](https://app.synerise.com/analytics-v2/aggregates/2d7417d3-38ce-3704-9cea-9940cdb4d8aa) - [Aggregate returning the sum of points that are potentially to expire](https://app.synerise.com/analytics-v2/aggregates/053abceb-b1a3-32f2-b960-fed98a97e4fa) - [Expression returning the sum of aggregates with all lost points](https://app.synerise.com/analytics/expressions/23785c1e-9093-48cf-8c83-6b4f6099689e) - [Expression calculating current point balance](https://app.synerise.com/analytics/expressions/66fa052f-434c-4a54-901f-0c7483c38160) - [Expression calculating points to expire](https://app.synerise.com/analytics/expressions/8dfe993d-f84f-4608-a936-4f83a6d9acfa) - [Segmentation of customers with points to expire](https://app.synerise.com/analytics-v2/segmentations/f616b0d0-d615-4f4a-af6c-4907d33f5b4a) - [Workflow for expiring points](https://app.synerise.com/automations/workflows/automation-diagram/0c21290d-cdeb-4493-a83b-90a8db22d0b6) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 5 events per profile that completes the flow: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~2), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), `points.expire` (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Expressions](/docs/crm/expressions) - [Segmentations](/docs/analytics/segmentations) - [Audience node](/docs/automation/triggers/audience-node) - [Generate Event node](/docs/automation/actions/send-client-event) - [End node](/docs/automation/flow-control/end-node) - [Loyalty events](/docs/assets/events/event-reference/loyalty) Check our other [loyalty use cases](/use-cases/?ordering=DESC&sortBy=publishDate&filters=tags%3D%3D%22loyalty%22) # Predict churn Churn prediction is a business strategy that involves identifying customers who are likely to stop using a product or service in the near future. Churn prediction can help businesses reduce customer churn rates, increase customer loyalty, and improve overall business performance. With the Prediction feature you can create predictive models that accurately forecast customer behavior, enabling you to take targeted actions to reduce churn and improve customer satisfaction. In this use case, we will create a prediction which will help us identify customers likely to churn. As the prediction target we will use an expression with the segmentation of customers who had a transaction and have not visited our page in the last 30 days.
Churn prediction
Churn prediction
## Prerequisites --- - [Integrate JS SDK](/developers/web/installation-and-configuration). - [Enable the Custom prediction model](/docs/ai-hub/predictions/enabling-predictions#enabling-regression-and-classification-predictions). ## Process --- In this use case, you will go through the following steps: 1. [Create a segmentation](#create-a-segmentation). 2. [Create an expression](#create-an-expression). 2. [Create a prediction](#create-a-prediction). ## Create a segmentation --- In this step, we create a group of customers who have made at least one transaction but have not visited the site in the last 30 days. This segmentation will be used in an expression in the next step. 1. Go to Decision Hub icon**Decision Hub > Segmentations > New Segmentation**. 2. Optionally, switch the **Show in profile card** toggle on. 3. Enter the name of the segmentation. 4. From the **Add condition** dropdown list, select the `transaction.charge` event.
Events may have different labels between workspace, but you can always find them by their action name (in this step, it's **transaction.charge**).
5. Using the date picker in the lower-right corner, set the time range to **Relative time range > More > Lifetime**. 6. From the **Add condition** dropdown list, select the `Visited page` event. 7. Change **Performed** action to **Not performed**. 8. Using the date picker in the lower-right corner, set the time range to **Relative time range > Custom > Last 30 days**. 9. Save the segmentation. ## Create an expression --- In this part of the process, create an expression that will serve as the target for the prediction model. The expression will return `1` if a customer belongs to the previously defined segmentation and `0` if they don't. 10. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 11. Enter the name of the expression. 12. From the **Expressions for** dropdown list, select **Attribute**. Predictions work only with attribute expressions. 13. In the formula creator, click the **Select** node and from the drop-down list select **Function > If**. 14. As the first argument, select the segmentation you created earlier. 15. As the second argument, select **Constant** and set its value to `1`. 16. As the third argument, select **Constant** and set its value to `0`. 16. Save the expression.
The view of the configuration of the expression
Configuration of the expression
## Create a prediction --- 1. Go to AI Hub icon in left menu **(AI Predictions) Models > New prediction**. 2. In the upper-right corner, enter a name for the prediction. 3. In the **Prediction type** section, click **Define**. 4. Select **Classification** and click **Apply** ### Select the audience In this section you decide which segment of the customers should be taken into account while making a prediction. For every individual in the segment, Synerise produces a single prediction. Segmentations can be very complex and the possibilities of building the conditions are practically unlimited. In this example, a simple segmentation will include customers who have a marketing agreement. 1. In the **Audience** section, click **Define**. You can use existing segmentations. This example shows how to create a new one. 2. Click **Choose segmentation > Create new**. 3. Enter a segmentation name and click **Next step**. 4. Click **Choose filter**, from the dropdown list, select **Attribute> Email agreement**. 5. From the **choose operator** dropdown list, select **Equal (String)**. 6. In the text field, enter `enabled`. 7. Click **Create segmentation**. **Result**: The segmentation is saved as the audience of the prediction and also becomes available in the **Decision Hub** for other uses. 8. Click **Apply**.
The view of the configuration of the Audience
Audience configuration.
### Select prediction target 1. In the **What would you like to predict?** section, click **Define**. 2. Click **Select expression** and select the [expression created earlier](#create-an-expression). 3. Click **Apply**. ### Select inputs In this section, you set up input [features](/docs/glossary#feature) based on which the prediction model will be trained. It is possible to select feature inputs manually, but we recommend using the automatic selection, as explained below. Our algorithms evaluate feature relevance in context of the prediction target and are, in most cases, more effective than manual selection. 1. In the **Model inputs** section, click **Define**. 2. Click **Add feature > Automatically**. **Result:** The list is populated with input features. 3. Click **Apply**. ### Configure additional settings The additional settings define how often re-calculations are made and the content of events produced by the prediction. 1. In the **Settings** section, click **Define**. 2. From the **How many days in advance do you want to make a prediction** list, select **30 days**. 3. In the **Calculation frequency** section, select **Recurring calculation**. 4. From the **How frequently should the model be trained?** list, select **30 days**. 5. In the **Prediction start** section, select **Immediately**. 6. In **How would you like to display results**, select **5-point scale**. The algorithm detects the importance of a prediction. 7. In the **Define the value of the score name parameter** section, enter a user-friendly name for the prediction score. The name is shown as the value of the `scoreName` parameter in the `snr.prediction.score` event. 8. Click **Apply**. 9. To finish and calculate the prediction, click **Save & Calculate**. **Result:** The prediction results are saved as `snr.prediction.score` events in customer profiles. ## What's next --- You can use the prediction results in your work, for example to [Automated Emails for Customer Retention Using Churn Predictions](/use-cases/predictions-automation) or [Evaluate results of churn prediction](/use-cases/predictions-dashboard). A more advanced example of using a segmentation created from a churn prediction is described in [Promote discounted items to customers at risk of churn](/use-cases/boost-discounts-for-churn-risk). ## Check the use case set up on the Synerise Demo workspace --- You can check all configurations directly in Synerise Demo workspace: - [Segmentation](https://app.synerise.com/analytics/segmentations/81b51633-7dea-4c03-9d6a-9e385d337085) - [Expression](https://app.synerise.com/analytics/expressions/2f5a598f-56db-4aa3-914e-567ec5de135b) - [Audience segmentation](https://app.synerise.com/analytics-v2/segmentations/bd85a7e3-6700-4367-9906-471811dd1c76) - [Prediction](https://app.synerise.com/ai-v2/predictions/generic-scoring/bgycsoovxgby) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates 1 event per profile that completes the flow: [`snr.prediction.score`](/docs/assets/events/event-reference/predictions#snrpredictionscore) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Expressions](/docs/crm/expressions) - [Predictions](/docs/ai-hub/predictions) - [Segmentation](/docs/analytics/segmentations) # Send campaign analytics and performance data to Google Sheets Thanks to the data context Jinjava tag, you can export campaign performance data from Synerise to Google Sheets. Automate updating Google spreadsheet with detailed report summarizing key metrics from your campaigns, this integration opens up new possibilities for data analysis and informed decision-making. This use case shows a workflow configuration that sends daily data referencing webpush campaigns from Synerise to Google Spreadsheets. ## Prerequisites --- - Check the [requirements](/docs/automation/integration/google-sheets/upload-data-to-spreadsheets#prerequisites) you must meet to integrate Synerise with Google Spreadsheets. - Prepare a Google Spreadsheet to which you want to send the data. ## Create a workflow --- In this part of the process, prepare a workflow that sends statistics to a spreadsheet. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the trigger node --- At this stage, we will configure the conditions that launch the workflow. We will create a scheduled workflow, that starts every week on Monday at 9:45 A.M. 1. As the first node of the workflow, add **Scheduled Run**. In the configuration of the node: 1. In the **Run trigger** section, leave the default **all time** option. 2. In the **Repeat runs** section, choose suitable timezone. 3. To launch the workflow every week at the defined time, click the **Every week** tab below. 4. Select the desired day, in our case **Monday**. 5. Click **Add time** and set it according to your needs, in our case to `9:45`. 5. Confirm by clicking **Apply**.
Scheduled Run Node
The configuration of the Scheduled Run node
### Configure the Get Statistics Node --- As the next node, choose **Get Statistics** to retrieve webpush campaign statistics from a specified time range. 1. Select the **By time range** tab. 2. From the **Campaign type** dropdown list, select **Webpush**. 3. In the **Set time range** field, select the time range from which you would like to export the statistics. In our case, in the **Relative time range** section, select the **Last week** option. 5. The default setting includes statistics exclusively for campaigns sent through Experience Hub. If you also want to include statistics for campaigns launched through Automation Hub, enable the **Include automation statistics** option. If this option is selected, the output will include campaigns set up by Automation Hub that meet one of the following criteria: - the date of creation is within the indicated time range, - at least one sending event has occurred in the indicated time range. 6. Optionally, if you want to export variants of one campaign as separate records, enable the **Breakdown by variants** toggle.
By default, if statistics of a campaign selected for export contains more than one version (due to A/B testing), the statistics for each variant are a single aggregated record.

Campaign statistics data retrieved through the **Get Statistics** node before sending can be [transformed](/docs/automation/data-transformation-and-imports/introduction) to better align their format with specific requirements. To simplify building validation rules, you can download sample data in various formats (.csv, .json, .jsonl).
7. Name your node `Campaigns sent yesterday` so it corresponds with [the Jinjava in the next step](#configure-integration-and-add-the-finishing-node). 8. Confirm by clicking **Apply**.
Get Statistics Node
Configuration of the Get Statistics Node
### Configure Upload Data to Spreadsheet node ---
- You must have an account in Google Sheets. - Your account must have permissions to edit the spreadsheet you want to update.
1. Click **Then** and add the **Upload Data to Spreadsheet** node. In the configuration of the node: 1. Click **Select connection**. 2. From the dropdown list, select the connection. - If no connections are available or you want to create a new one, click the **Select connection** dropdown list, and the **Add connection**. Find how to do it [here](/docs/automation/integration/google-sheets/upload-data-to-spreadsheets#create-a-connection). - If you selected an existing connection, proceed to the [Configure integration and add the finishing node](#configure-integration-and-add-the-finishing-node) step. #### Configure integration and add the finishing node In this step, fill in the form that allows you to send data from Synerise to a table in Google Sheets. 1. In the **Spreadsheet ID** field, enter the ID of the spreadsheet to which you want to upload data. You can find the ID in the URL of the spreadsheet. 2. In the **Range** field, define the range of cells to which the data will be uploaded. The values will be appended to the first empty cell available within the indicated range. The value in this field must be given in the A1 notation, for example `Sheet1!A4:A`, then the data will be added in a column to A4 and A5 cells in the `Sheet1` Spreadsheet. 3. As the **Dimension**, select **Rows**. 4. In the **Values** field, paste the Jinjava that loops over the results of the **Get Statistics** node:
[ {%- datareference node='Campaigns sent yesterday' maxRows=100 -%}
       {%- for r in datareference_result -%}
       ["{{ r.campaignHash }}", "{{ r.campaignTitle }}", "{{ r.campaignType }}", "{{ r.clickRate }}", "{{ r.showRate }}", "{{ r.sendingTime}}", "{{ r.sendingTimeZone}}", "{{ r.uniqueClickCount }}","{{ r.sendingTime }}", "{{ r.uniqueShowCount }}" "{{ r.uniqueCappingCount }}", "{{ r.uniqueSendCount }}", "{{ r.utm.campaign }}", "{{ r.utm.content }}", "{{ r.utm.medium }}", "{{ r.utm.source }}", "{{ r.utm.term }}"] {%- if not(loop.last) -%},{%- endif -%}
       {%- endfor -%}
       {%- enddatareference -%} ]
Upload Data to Spreadsheet Node
The configuration of the Upload Data to Spreadsheet Node
5. Click **Apply**. 6. After the **Upload Data to Spreadsheet** node, add the **End** node. 7. Confirm by clicking **Save**. 8. In the upper right corner, click **Save & Run**.
Automation Hub workflow for data reference integration with Google Sheets
The configuration of the Workflow
## Check the use case set up on the Synerise Demo workspace --- You can check the [workflow configuration](https://app.synerise.com/automations/workflows/automation-diagram/88a74673-e053-4ebc-8181-28f0eaf80f68) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 5 events per workflow execution: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~2), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`googleSheets.uploadData`](/docs/assets/events/event-reference/integration#googlesheetsuploaddata) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Automation inserts](/developers/inserts/automation#data-context) # Early Access Discount for a Specific Product Create a buzz around your product and draw attention to your store, while attracting a larger audience by offering significant discount for a limited time. Build anticipation and excitement among your loyalty and future customers with an early preview of the remarkable discount opportunity. This use case describes how to create a high discount promotion for one product with an early preview. The customer will receive a 70% discount for a specific product three days in advance, which can be redeemed only on the weekend. ## Prerequisites --- - Implement promotions in your [mobile application](/developers/mobile-sdk/loyalty), website or through [API](https://hub.synerise.com/api-reference/loyalty-and-engagement#operation/profileLogin) - [Implement transactional events](/developers/web/methods-reference#tracking-transactions). - [Import the product feed to a catalog](/use-cases/import-product-feed-to-catalog). ## Create a promotion --- Create a straightforward weekend promotion for a specific product with a substantial discount rate (for example 70%). The promotion will be previewable three days prior to its activation. 1. Go to AI Hub icon **AI Hub > Regular Promotions > Add Promotion**. 2. Enter a name for the promotion. 3. Select the **For selected items** type of promotion. 4. In the **Audience** section, choose **Everyone**. 5. In the **Content** section: 1. Define the name, descriptions, thumbnail, and image of the promotion. 3. Optionally, you can add tags to the promotion and JSON code with additional promotion parameters. 2. Confirm the settings by clicking **Apply**.
The view of Content configuration
Content configuration
6. In the **Type and limits** section: 1. Leave **General** in the **Type section**. 1. In the **Type section** field, select **General** (default option). 2. In the **Priority**, enter a number that defines the priority of the promotion.
Priority defines the order of display in the customer’s view. 1 is the highest priority. If two or more promotions applicable to a customer have the same priority, the order of display is determined by the date of creation. The one that was created earlier takes the priority over the other promotion.
3. Select the **Single** tab (default choice). 4. In the **Limit per profile** field, type `1`. 5. From the **Discount type** dropdown list, select **Percentage**. 6. In **Discount mode**, leave the default option (**Static**). 7. In the **Value** field, type `70`. 8. Confirm the settings by clicking **Apply**.
AI Hub promotion Type and limits section with single 70% percentage discount limited to one per profile
Type and limits configuration
7. In the **Schedule** section: 1. In the **Display time** section, choose **Scheduled**. 2. Pick the dates in the **Start** and **End** fields, in this case the promotion should start three days before the weekend and end on Sunday. 3. In the **Activity time** section, deselect **Same as display time**. 4. Set a date range when the promotion can be activated. Pick the dates in the **Start** and **End** fields, in this case promotion should be active on a selected weekend. 3. In the **Lasting** field, you can enter the time (in seconds) that a promotion remains redeemable after it is activated. `0` is interpreted as infinity. 4. Confirm the settings by clicking **Apply**.
The view of Schedule configuration
Schedule configuration
8. In the **Items** section: 1. From the **Source catalog** dropdown list, select a catalog of items. 2. In the **Include items** section, choose **Selected items**. 3. Click **Select items** and select the product you want the discount to apply to.
The view of Items configuration
Items configuration
9. To apply configuration and run the promotion, click **Publish**. ## Check the use case set up on the Synerise Demo workspace --- You can check the [promotion configuration](https://app.synerise.com/campaigns/promotions/90f3a031-7026-4313-af56-8538d7bea0d0) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 4 events per profile that completes the flow: [`client.activatePromotion`](/docs/assets/events/event-reference/loyalty#clientactivatepromotion) (~1), [`transaction.charge`](/docs/assets/events/event-reference/items#transactioncharge) (~1), [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~2). ## Read more --- - [Catalogs](/docs/assets/catalogs/introduction-to-catalogs) - [Promotions](/docs/ai-hub/promotions) # Test with different types of recommendations --- In Synerise we have many different types of recommendations. You can choose the one that best suits you and your business. We recommended adding them in different stages of the customer journey. From which type you should start? You can discover this only through testing. Testing different types of recommendations determine which one will convert best is the optimal solution. ## Example of use - Retail Industry **Challenge** We created a strategy for the website of a client from the retail industry consisting of different types of recommendations: - Personalized recommendations on the home page - Personalized recommendation on the listing based on gender - Cross-selling recommendations on the product page - Cart recommendations in the basket - Recommendations on the zero-search results page All of the recommendations were added to the campaign dashboard to monitor results. The results were generally good, but we decided to compare them with the results from another brand belonging to the customer. We also decided to switch from cross-selling and cart recommendations to fully personalized recommendations because we did not have any historical transactions from the client and we wanted to compare which gave better results in a situation when you do not have any data but you want to still personalize the content. We implemented the same recommendations as in the first brand (except the recommendations on the product page). **Solution** We decided to make three changes: **1st** We put personalized recommendations everywhere on the site ![Screenshot presenting recommendations](/api/docs/image/f8a57079df9dd82ae8b22dc747691385d7d51d29/use-cases/all-cases/_gfx/recommendations1a.png) **2nd** We put sets of products on the cart recommendations - when someone added a men’s shirt to a cart, we recommend only ties ![Screenshot presenting recommendations](/api/docs/image/f8a57079df9dd82ae8b22dc747691385d7d51d29/use-cases/all-cases/_gfx/recommendations1b.png) **3rd** We put sets of products on the cart recommendations - when someone added a men’s trousers to a cart, we recommend only shirts ![Screenshot presenting recommendations](/api/docs/image/f8a57079df9dd82ae8b22dc747691385d7d51d29/use-cases/all-cases/_gfx/recommendations1c.png) **Results** - **2%** CTR for sets recommendations (ties to shirts) - **3%** CTR (shirts to trousers) - **6%** CTR - personalized basket recommendations These results show that AI can make better decisions than even someone with lots of industry experience. After comparing these two campaigns, we learned that: - **14%** of users bought products based on recommendations on brand A - **21%** of users bought products based on recommendations on brand B Personalized recommendations for brand B worked better than mixed types of recommendations on the different steps of the journey. We also compared two different types of recommendations in the basket: - **~1%** Conversion rate - in case of sets of products (ties to shirt, shirt to pants) - **4%** Conversion rate - in case of personalized recommendations ## Requirements **General:** - Product feed - OG:tags - Transactions - Page visits (Synerise tracker) **Additional:** - Historical transactions - Historical page visits - Other activities and user behavior ## How to do it --- 1. At first you must choose what type of recommendation would you like to use on your website. 2. Set up the campaign: - Declare the quantity of returning products in your recommendation - Configure the recommendations filter. You can use brand filter, category, price, discounts, gender and a few other additional settings. - Adjust the additional settings. This part will help you with choosing the optimal set of products and put them in the most favorable order. 3. Copy the campaign ID from its URL. 4. Decide where you want to display your campaign. In this case it was a dynamic content campaign. 5. In the dynamic content creator, adjust the settings: - Choose one of two types of campaigns. In this case, it should be an inserted object, because we want to place a slider on our website. - Define the audience – people who should see your campaign. - Create the content - remember to copy the unique ID code from your recommendations model and put it directly in the code of dynamic content campaign as campaign ID. - Configure the additional display settings and schedule your campaign time. ## Generated events This use case generates approximately 5 events per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - Learn how to build [AI recommendations](/docs/ai-hub/recommendations-v2) - Learn more about [dynamic content campaigns](/docs/campaign/dynamiccontent) # Carousel with recently viewed products --- Contextualized recommendations tailored to customer interests help to influence purchasing decisions. To create a recommendation, it is worth using recently viewed products, which will provide a good context for them. In this way you can display not only last seen products to remind customers about them, but also show similar products to make sure that even if they will not buy last seen products they can be interested in similar categories. ## Example of use – Home appliances industry One of our clients decided to personalize the offer on their home page by placing a carousel with recently viewed products on it. To make the offer more attractive for each of the products in the carousel, they additionally recommended a dozen or so similar products using AI algorithms. ![Screenshot presenting products recommended for recently viewed ](/api/docs/image/f8a57079df9dd82ae8b22dc747691385d7d51d29/use-cases/all-cases/_gfx/recommended_to_similar.png) **Results** - CTR **11.5%** - AB tests (division 50/50), where in group A general personalized recommendations were displayed, and in group B recently viewed with similar recommended products. **Group B showed an 11% better conversion than group A** ## Requirements --- - Synerise Tracker - Imported correct product feed - OG tags implemented (required: product: retailer_part_no consistent with the product ID in the feed) - Trained Similar Recommendations Model ## How to do it 1. Prepare the aggregate with recently viewed products. 2. Prepare an AI campaign with a similar model. The campaign should return from 4 to about 20 products. You can use any filters you want. 3. Prepare dynamic content for the carousel, where you add the aggregate and based on it you will call a similar campaign to each of the products from the aggregate and save the result into separate tables. Then, place all products in the carousel, remembering that when the user scrolls through recently viewed products, the right side should immediately display products recommended from a similar campaign named for the currently displayed last seen product. Using Jinjava, call the IDs of products recently viewed from the aggregate and create a carousel on the left side of the screen.
{% set productsSKU = [] %} 
{% aggregate aggregate_hash %} 
{% for p in aggregate_result %} 
{% do productsSKU.append(p) %} 
// HERE CAROUSEL ON THE LEFT SIDE 
{% endfor %} 
{% endaggregate %}
Iterate over the board with recently viewed products, trigger a similar campaign for each of them and create a carousel on the right.
{% for productSKU in productsSKU %}  
{% set exampleProd = [] %}  
{% set exampleProdUpdt = exampleProd.append(productSKU) %}  
{% recommendations2 campaignId=campaign_hash products=exampleProd %}  
{% for p in recommended_products2 %}  
// HERE CAROUSEL ON THE RIGHT SIDE  
{% endfor %} {% endrecommendations2 %} {% endfor %}
## Generated events This use case generates approximately 7 events per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~3), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - Read more about [Aggregates](/docs/crm/aggregates) - Read more about [Jinjava inserts](/developers/inserts/insert-usage) (aggregates and recommendations) - Read more about [Loops in Jinjava](/developers/inserts/tag) - Read more about [Product feed preparation](/developers/product-feed) # Switch Brands in Product Recommendations with Custom Filters In order to diversify or monetize positions in the recommendation frame, you can use the recommendation slots. By combining using slots and recommendation filters, you can create branding campaigns. Such campaigns can be later displayed on the product page. In this example, we will set a campaign that will return items similar to the one that is the context. However, when the context item's brand is “BrandA”, the first two items in the recommendation frame will be from the “BrandB” brand. This can be done to better position items from a brand that you have a partnership with, as the first two positions in a recommendation frame have the highest click-through rate. To make this possible, we will utilize slots. The first slot will contain two items and no filter will be applied, unless the context item’s brand is “BrandA”, then they will be filtered to items that are from the “BrandB” brand. The second slot, consisting of four items, won't have filters and will display similar items to the context one.
Brand switching campaign
Brand switching campaign
## Prerequisites --- The [similar recommendation model](/docs/ai-hub/recommendations-v2) must be enabled and ready. ## Create recommendations --- 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. Enter the campaign name. 3. In the **Type & Items feed** section: 1. Click **Define**. 2. From the dropdown list, select the catalog that contains items for the recommendation. 3. As the type, select **Similar items**. 4. Click **Apply**. 4. In the **Items** section, click **Add slot**. You can name the slot for later reference. 5. Set the minimum and maximum number of items to `2`.
Setting the minimum and maximum number of items to the same number ensures that exactly this many items will appear in the slot.
6. Click **Static filter** and choose **IQL Query**. 7. Create a filter that applies the following logic: - If the context brand is "BrandA", filter the results to the "BrandB" brand. - If the context brand is NOT "BrandA", no filter should be applied. It should resemble the following filter: `IF(context.brand == "BrandA", brand == "BrandB", ALL)` 8. Add another **slot**. 9. Set minimum and maximum number of items to `4`. 10. Enable the **Keep slots in order** toggle. 11. Click **Apply**. 12. In **Boosting**, you can enable [boosting](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#define-the-boosting-factors). 13. In **Additional settings**, you can exclude already bought products and set a metric to sort by. 14. Save the campaign by clicking **Save**. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Filters](/docs/ai-hub/recommendations-v2/recommendation-filters) - [Recommendation campaigns](/docs/ai-hub/recommendations-v2) # Cloning Complex Analyses and Segmentations Across Workspaces For organizations operating in multiple workspaces, transferring analytics from one workspace to another can be challenging and time-consuming, especially when the analytics involved are complex and interdependent. The Synerise's clone feature is designed to alleviate these difficulties by streamlining the transfer process and ensuring that all dependencies and mapping relationships are maintained. In this use case, we delve into a practical implementation of cloning RFM segmentation analytics that requires the transfer of a complex, nested analysis. Using cloning, we ensure that all necessary dependencies are maintained, and mapping conflicts are resolved in a timely and efficient manner. You will find a detailed guide on how to create a RFM analysis in [this use case](/use-cases/rfm-analysis).
For a detailed guide on how to perform object cloning between workspaces, including all possible scenarios that can occur during the cloning, see [this article](/docs/settings/workspace/cloning-objects/cloning-analyses-to-workspaces).
## Prerequisites --- Follow all the prerequisites described in [this article](/docs/settings/workspace/cloning-objects/cloning-analyses-to-workspaces). ## Clone segmentation --- 1. Go to Decision Hub icon **Decision Hub > Segmentations**. 2. On the list of segmentations, find the segmentation you want to clone. 3. To the right side of the analysis author information, click Three-dot icon. 4. From the context menu, select **Clone to workspace**. **Result**: The **Choose destination** pop-up appears. 5. On the pop-up, select the workspace or workspaces to which you want to clone your analysis.
A pop-up with selection of workspaces
A pop-up with selection of workspaces
6. Confirm your choice by clicking **Next**. **Result**: You are directed to the mapping wizard.
Mapping wizard
Mapping wizard
1. In the **Objects to clone** section, click **Change solutions**. 2. Next to the target workspace name, click the downward arrow icon. **Result**: The list displays the analysis to be cloned.
When you clone an object and an object with the same name exists, you need to resolve the conflict. Refer to [this step](/docs/settings/workspace/cloning-objects/cloning-analyses-to-workspaces#cloning-an-object-that-exists-in-the-target-workspace), which explains how to clone an existing object in the target workspace.
3. Click **Apply**. ### Mapping events --- In our case, not all events and their parameters exist in the target workspace. That is why we need to create the missing event/parameter or select an existing event/parameter in the target workspace under which the values of the event/parameter from the source workspace will be saved in the cloned object. 1. In the **Mapping events** section, click **Solve issues**. 2. Next to the target workspace name, click the downward arrow icon. 3. On the dropdown list, perform one of the following action create the missing parameter in the target workspace by clicking **Create `[$totalAmount]`**.
Mapping event parameters that don't exist in the target workspace
Mapping event parameters that don't exist in the target workspace
4. Confirm the mapping settings by clicking **Apply**. ### Mapping parameters --- In our case, not all attributes exist in the target workspace, which is why we need to create the missing parameter or select an existing parameter in the target workspace under which the values of the parameter from the source workspace will be saved in the cloned object. 1. In the **Mapping parameters** section, click **Solve issues**. 2. Next to the target workspace name, click the downward arrow icon. 3. On the dropdown list, create the missing parameter in the target workspace by clicking **Create `[loyaltyCard]`**.
Mapping parameters that don't exist in the target workspace
Mapping parameters that don't exist in the target workspace
4. Confirm the mapping settings by clicking **Apply**. 5. Optionally, before cloning, you can also check the summary, where you can find detailed information about what analytics the segmentation consists of and what solution was applied to each of them, as well as what events and parameters were created.
Cloning summary
Cloning summary
Cloning summary
5. In the upper right corner, click **Clone**. After successful cloning, you can switch to the target workspace and work with the cloned segmentation and all nested analytics. ## What's next --- The cloning option can also be very useful in cases where you already have the same analytics created in different workspaces and want to make changes to them. In that case, all you need to do is make changes to the analytics from one workspace and then clone it to other workspaces where you want to implement that modification. When cloning, you will only need to update the cloned object in the target workspaces. This convenient solution streamlines the process and ensures that all nested objects and dependencies are taken into account. With just a few clicks, you can effortlessly update analytics across all workspaces.
Updating cloned objects
Updated cloned objects
Updated cloned objects
## Generated events This use case does not generate any events. ## Read more --- - [Cloning objects between workspaces](/docs/settings/workspace/cloning-objects/cloning-analyses-to-workspaces) - [RFM analysis](/use-cases/rfm-analysis) # Personalized prices for loyalty club members --- Adjusting product prices for customers with a loyalty card affects customer engagement and attachment to the brand. Loyalty programs provide not only motivation for customers to make a purchase but also help you to create meaningful connections. To **boost your member engagement**, you can use special discount policies. This is an effective way to create a unique customer experience. **Special prices only for members** can be a great value to your clients, proving that you want to provide better service to them. On the other side, your lower prices will seem more appealing and encourage your customers to make a purchase. ## Example of use - Retail industry **Challenge** A customer from the jewelry industry has a group of clients who belong to a loyalty club. For these users, product prices in the recommendation boxes **should be reduced by 10%. ** The value of products is the same for everyone until a specific user logs in to the client panel as a loyalty club member. When the system recognizes him, then the discount is added, and relevant information is sent to Synerise. After the customer visits the site, he will see recommended products with a better price, with a special discount for him. In addition, such products are marked with a special mini logo so that the customer is aware that this is not a standard discount, but a discount for club members. ![Screenshot presenting personalized price](/api/docs/image/f8a57079df9dd82ae8b22dc747691385d7d51d29/use-cases/all-cases/_gfx/personalized_price_for_members.png) ## Requirements --- 1. Basic elements of AI integration: - Synerise Tracker - Product feed, filled with appropriate custom attributes - Transactional events - OG tags 2. Additionally: - information in the product feed about the price after the discount, saved as a custom parameter, or providing a special rule by which we will calculate the price - information sent to dataLayer or a cookie with information about being a loyalty club member ## How to do it --- 1. Prepare AI campaign. Select the type of recommendation, for example personalized recommendations. 2. In the next step, you should modify the dynamic content campaign so that it will download information from dataLayer or cookies and modify the prices of products. To prepare the mechanism, both product prices should be downloaded **using jinjava**. This is necessary because downloading data from the feed is only possible when the user enters the website, and at this time we do not yet have information whether a given discount should be granted. It's best to keep both prices hidden in CSS. We check the information in Data Layer / cookies in JS and based on it we discover the price accordingly. Sample code below: - **HTML:**
<div class="normal-price snrs-hide">{{r.priceValue}}</div> 
  <div class="club-price snrs-hide">{{r.clubValue}}</div>
In this case we add two price values. - **CSS:**
.snrs-hide{ 
  display:none; 
  }
- **JS:**
var typePrice = 'club'; //
Here we collect information about the price from Data Layer or cookies.
if(typePrice ==='club'){ 
document.querySelector('.'+typePrice+'-price').classList.remove('snrs-hide'); 
}
Here the appropriate price variant is discovered. ## Generated events This use case generates approximately 5 events per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - Read more about [AI](/docs/ai-hub/recommendations-v2/recommendation-types#personalized) - Read more about [dynamic content](/docs/campaign/dynamiccontent) - Read more about [recommendation types](/docs/ai-hub/recommendations-v2) # Promote discounted items to customers at risk of churn If your customers are at risk of churn, you can increase the probability of discounted items appearing in their recommendations. Thanks to this, they are more likely to make a purchase. This can be done by using **recommendation boosting** to promote discounted items. Boosting rules are built using the same editor as the filters, but unlike filtering, boosting does not entirely exclude items that do not meet the conditions - it only tells the AI model to assign more weight to the discount value parameter when calculating the final recommendation score (relevance to a particular customer) of an item. ## Prerequisites --- 1. **Recommended**: Become familiar with [creating recommendations](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign) and [recommendation filters](/docs/ai-hub/recommendations-v2/recommendation-filters) (using the IQL query editor). This article does not explain every step of creating a recommendation in detail. 1. The item feed must contain information about discounts. In this example, the discount is defined as a percentage. 2. Predict churn for a group of customers. The [Predict churn](/use-cases/churn-prediction) use case includes detailed instructions. 3. Create a segmentation of customers for whom the `score-label` parameter in the `snr.prediction.score` event from the prediction was `high` or `very high`. This segment of customers will be needed to set up the boosting conditions. [Learn more about creating segmentations](/docs/analytics/segmentations/creating-segmentations). ## Creating the recommendation --- ### Choose source, type, and add slots 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. In the **Type & Items feed** section: 1. Select an item catalog. 2. Select a recommendation type.
Boosting can be used with all recommendation types.
3. Click **Apply**. 3. In the **Items** section, configure at least one slot and click **Apply**. ### Build the boosting rule in IQL query editor In this part of the process, you build the following rule: - If the customer is at risk of churn, filter the boosting to only apply to items that are discounted 10% or more. - If the customer is NOT at risk of churn, apply boosting to all items (so, effectively, no items are boosted). 1. In the **Boosting** section, click **Define**. 2. Click **Add rule**. 3. Click **Define rule** and select **IQL query**. **Result**: The IQL query editor opens. 4. Click **Select > Function**. 5. Click the added function and select **IF**. The IF function accepts three variables, from the left: the condition, the result if the condition evaluates to TRUE, and the result if the condition evaluates to FALSE. 6. Add the condition that customer must be at risk of churn: 1. Click the first **Select** node and select **Segmentation**. 2. To the right from **client.segmentations**, click the plus icon and select **Attribute**. 2. Click the **null** element that appeared. 4. From the **Property** drop-down list below the canvas, select **Segmentation**. 5. Click **Select value** and select the segmentation that includes customers at risk of churn. You can use the search field. 6. Click the plus icon between **client.segmentations** and the segmentation ID and select the **HAS** operator. 7. Add the `if TRUE` result: 1. Click the **Select** node and select **Attribute**. 2. Click the **null** element that appeared. 3. In the attribute selector below the canvas, click **Select value**. 4. Select the discount `special.price` attribute. You can use the search field. 5. To the right from the attribute node, click the plus icon and select **Number**. 6. Click the plus icon between the attribute and the number and select the **equal** operator. 7. In the input field enter `true`. 9. Click **Apply**. 10. In the **Promote/Demote** selector, select **Promote** (default value). 11. Use the slider to adjust how much you want the rule to affect the results.
Screenshot of the boosting strength slider
The boosting strength slider
12. Save the **Boosting** section settings by clicking **Apply**.
After applying the settings, you can use the **Preview** tab (available in the upper left part of the recommendation creator screen) to see how your rule changed the recommendation result. If necessary, you can return to the settings and adjust the boosting strength to meet your expectations.
Screenshot from the IQL editor: boosting rule for including items that are discounted 10% or more when the customer is at risk of churn
Boosting rule for including items that are discounted 10% or more when the customer is at risk of churn
### Additional settings and saving 1. Configure the **Additional settings** section and click **Apply**. 2. Save the recommendation. ## What's next --- You can use the ID of the recommendation and [inject it with a snippet](/docs/assets/snippets) in other types of communication, such as: - [dynamic content](/docs/campaign/dynamiccontent) - this way you can show the recommendations on your website. - [email](/docs/campaign/e-mail) - this way you can send out recommended items through emails. - mobile application - you can use [documents](/docs/assets/documents) to build your own mobile app and show the recommended items. - [mobile push](/docs/campaign/Mobile) - you can send recommendations through notifications in your mobile application. - [web push](/docs/campaign/Webpush) - this way you can send notifications to your customers through a web browser. - [SMS](/docs/campaign/SMS) - this way you can reach your customers with recommendations on their mobile. ## Check the use case set up on the Synerise Demo workspace --- You can find the analyses created in this use case in our Synerise Demo workspace at the following links: - [Propensity prediction](https://app.synerise.com/ai-v2/recommendations/W2JGxpllqirV) - [Segmentation](https://app.synerise.com/analytics-v2/segmentations/9ec901b4-2ea0-47dc-9285-023d2000e8cf) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Recommendations](/docs/ai-hub/recommendations-v2) # A/B test in AI Search By preparing A/B tests in AI Search, you can find out which configuration of the AI search brings better results in terms of conversion, revenue, and CTR in your business. This use case describes an implementation that compares the results of presenting search results promoting bestsellers against personalizing the results. The bestsellers are selected according to item popularity, whereas personalization uses the history of a customer's activity. ## Prerequisites --- - Import a product feed to Synerise. You can find instructions [here](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-search). - Implement the `item.search.click` event that is generated when an item shown in the search results is clicked. Use this [API method](https://hub.synerise.com/api-reference/data-management#tag/AI-Events/operation/publishAiCompatItemSearchClickUsingPOST). ## Process --- In this use case, you will go through the following steps: 1. [Prepare two search indexes](/use-cases/ai-search-ab-test#prepare-two-search-indexes). 2. [Prepare AB test](/use-cases/ai-search-ab-test#prepare-ab-test). 3. [Analyze results](/use-cases/ai-search-ab-test#analyze-results). ## Prepare two search indexes --- As the first part of the process, create two separate search indexes (personalization and bestseller) which will differ only in the settings of search results hierarchy. 1. Go to AI Hub icon **AI Hub > Indexes**. 2. Click **Add index**. 3. Follow the instructions on the interface until the configuration of Ranking (step 4). If you need more information, you can read instruction on configuring [AI Search index](/docs/ai-hub/ai-search/create-index). 4. Set the ranking for the personalization search index. You will create the besteller version later. - For the personalization search index: - Frequency of item page views to 70% - Frequency of item purchases to 0% - Personalization to 100% - For the bestseller search index: - Frequency of item page views to 20% - Frequency of item purchases to 80% - Personalization to 0% 5. Save the index. The index will be ready in several minutes.
View after saving the index
View after saving the index
6. Create the bestseller search index. Apply the same settings as with the personalization search index apart from the Ranking settings. ## Prepare AB test --- 1. Go to AI Hub icon **AI Hub > (AI Search) A/B/X Tests > New A/B test**. 2. Enter the name of the test. 3. In the **Variants and customer allocation** section, click **Define**. 4. Click the **Base variant** tab. 5. From the dropdown list, select one of the indices you created in [the previous part of the process](/use-cases/ai-search-ab-test#prepare-two-search-indexes). 6. Add the next variant by clicking Plus icon. 7. From the **Index** dropdown list, select the second index you created in the previous part of the process. You can rename the tab for better management of the versions. 8. In the **Customer allocation** section, assign the percentage of customers to each variant. 9. Confirm the settings by clicking **Apply**. 10. Click **Save&Run**. After some time you can [check the statistics of the A/B test](/use-cases/ai-search-ab-test#analyze-results). ## Analyze results --- When the A/B tests has been running for long enough, you can analyze the statistics for each variant. 1. Go to AI Hub icon **AI Hub > (AI Search) A/B/X Tests**. 2. From the list, select the test. 3. Choose the **Statistics** tab. You can find there the results for key performance indicators such as a conversion rate or revenue.
You can find more information about [A/B test statistics here](/docs/ai-hub/ai-search/ab-test-statistics).
4. Compare the statistics of the two indexes you created. 5. You can [export the settings of the winning variant](/docs/ai-hub/ai-search/configuring-ab-test#export-settings-of-the-winning-version) to your base index. ## Check the use case set up on the Synerise Demo workspace --- In the Synerise Demo workspace, you can check the: - [Index A](https://app.synerise.com/ai-v2/search/indices/5cd51abababc055a9c4a94984892949e1729770365/stats/global), - [Index B](https://app.synerise.com/ai-v2/search/indices/949f07ea19ad6450e351b9139781de701729770402/stats/global), - [A/B test](https://app.synerise.com/ai-v2/search/abtests/1087). If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`variant.assign`](/docs/assets/events/event-reference/search#variantassign) (~1), [`item.search`](/docs/assets/events/event-reference/search#itemsearch) (~1), [`item.search.click`](/docs/assets/events/event-reference/search#itemsearchclick) (~1). ## Read more --- - [AB tests](/docs/ai-hub/ai-search/configuring-ab-test) - [AI Search](/docs/ai-hub/ai-search) # Excluding category of recently purchased products in recommendations Personalized product recommendations are incredibly effective because they use your customers' search, browsing, and purchase history to recommend products that are tailored to their specific requirements and preferences. To create even better communication, you can exclude from recommendations the categories of items recently bought by a customer. In this use case, you will learn how to create a personalized recommendation campaign which uses an aggregate to exclude the categories of recently purchased products. ## Prerequisites --- - Configure an [item feed](/docs/ai-hub/recommendations-v2/item-feed-requirements). - [Configure an item catalog for recommendations](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). Enable the personalized recommendation model. - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). ## Process --- 1. [Create an aggregate](/use-cases/reco-excluding-recently-purchased-category#create-an-aggregate) of recently purchased products' categories to exclude them from personalized recommendation campaign. 2. [Create a recommendation](/use-cases/reco-excluding-recently-purchased-category#create-a-recommendation). ## Create an aggregate --- In this part of the process, create an aggregate that will return categories of products already bought by the customer. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last Multi**. 4. Select **Consider only distinct occurrences of the event parameter**. 5. In the **Size** field, enter the number of returned categories. 5. Select the **product.buy** event. 6. Select the **category** parameter. 7. Define the period from which the aggregate will return products from the event. This period will affect which purchases are included when checking for categories to exclude from the recommendation. 8. Save the aggregate.
Decision Hub Last Multi aggregate returning the distinct categories of recently purchased products
Configuration of the aggregate
## Create a recommendation --- 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 3. In the top left corner, enter the name of your recommendation. 4. In the **Type & Items feed** section, click **Define**. 5. From the **Items feed** dropdown menu, choose the provided feed. 6. Choose the **Personalized** recommendation type. 7. Click **Apply**.
AI Hub recommendation model Type and Items feed section with Personalized recommendation type selected
Configuraion of the catalog and recommendation type section
8. In the **Items** section, click **Define**. 1. Click **Add slot**. 2. Define the minimum and maximum number of items that will be recommended to the user in each slot. In our example, one slot returns 4 products. In the **Items** section, click the **Define** button. Click the plus button to add more slots. This will allow you to define new slots for your recommendation setup. In the slot settings, specify the minimum and maximum number of items to be recommended to the user within this slot. 3. Click **Static filter**.
Learn about the difference between [elastic, static](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#select-conditions-of-displaying-items), and [distinct](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#distinct-filter) filters.
4. From the dropdown list, choose **Visual Builder**. 2. Click **Select attribute**. 3. From the dropdown list, choose the **category** attribute. 4. Click **Operator**. 5. From the dropdown list, choose **Does not equal**. 6. Click the value type icon (Value icon) and choose the aggregate icon from the list. 7. From the dropdown list, choose [the aggregate you have created](/use-cases/reco-excluding-recently-purchased-category#create-an-aggregate). 8. In the **Level range** input area that appear, you can choose how you want to select your category level. Choose: **Whole category.**
If your products categories have a `X > Y > Z` structure, level 0 will be `X > Y > Z`. Level 1 will be `X > Y` and so on. Here, you define how granular the category recommendations will be. For example, if you are selling shoes, you will have an `Outdoor > Sport > Running` category and an `Outdoor > Sport > Football` category. If level 0 is selected, the two categories are excluded. If level 1 is provided, the `Outdoor > Sport` category and any of its subcategories will be excluded.
14. Click **Apply**.
Example of static filter conditions
Example of static filter conditions
9. In the **Items** section, click **Apply**. 10. Optionally, you can define the settings in the **Boosting** and **Additional settings** sections.
Learn more about [boosting](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#define-the-boosting-factors) and [additional settings](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#additional-settings).
11. Save the recommendation. ## What's next --- You can display the recommendation to customers in a number of ways. For example by using the [recommendation insert](/developers/inserts/recommendations-v2) in [dynamic content](/docs/campaign/dynamiccontent/creating-dynamic-content), or in mobile application with content widget, both on [Android](/developers/mobile-sdk/displaying-recommendations/content-widget/android) and [iOS](/developers/mobile-sdk/displaying-recommendations/content-widget/ios). ## Check the use case set up on the Synerise Demo workspace --- You can also check [the aggregate](https://app.synerise.com/analytics/aggregates/474a464f-175e-34e4-9890-ce922955390e) and [recommendation configuration](https://app.synerise.com/ai-v2/recommendations/wWmX7O8uxptZ) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Creating aggregates](/docs/crm/aggregates/creating-profile-aggregates) - [Creating recommendations](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign) - [Filters in recommendations](/docs/ai-hub/recommendations-v2/recommendation-filters) - [Requirements for item feed](/docs/ai-hub/recommendations-v2/item-feed-requirements) # Tiered loyalty program Tiered loyalty programs are a way to reward customers based on their level of interaction with your brand. We can help you create a structure that allows all members to enjoy benefits, but also ranks them into groups based on the total transaction value. This creates an environment of member engagement and loyalty that increases word-of-mouth recommendations and customer lifetime values. #### Use case assumptions - Loyalty program is created for customers who have created an account (online and/or in point of sales (POS)). - Customers will be assigned to one of the four levels (tiers) of the loyalty program based on the total balance value (transactions value minus the value of returns) from the last 365 days. 1. White (transactions under 300 PLN) 2. Green (transactions from 300 PLN to 999,99 PLN) 3. Silver (transactions from 1000 PLN to 1999,99 PLN) 4. Golden (transactions above 2000 PLN) - Making a transaction of a specific amount lets you go automatically to the higher level. - Being in the specific group makes it possible to use specific discounts for your shopping (it can be for example 5% for Green, 8% for Silver, and 10% for Golden). - The process involves creating an expression that returns the number of the tier to which a customer belongs: 1 for White, 2 for Green, 3 for Silver, 4 for Golden. Further on, we create a segmentation that is divided into four segments (White, Green, Silver, Golden); the customers are assigned to each segment based on the result of the expression. You can use these segments in your communication. ## Prerequisites --- - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). - Implement the [custom event](/developers/web/event-tracking#declarative-tracking-custom-events) which is sent to Synerise when a customer joins a loyalty program (for example, the `loyaltyStatus` event with a `status` parameter set to `active`). Such an event with the appropriate status must be sent each time the membership status changes (when the customer resigns from the program or joins again).
In this case, when a customer joins the loyalty program, a custom event is generated on their profile card. However, these conditions and the scenario can be adapted to your business needs, for example, you can count the customers who joined the loyalty program using the registration event in the mobile application or on the website.
- Implement the [custom event](/developers/web/event-tracking#declarative-tracking-custom-events) which is sent to Synerise when a customer returns products (for example, the `product.return` event with the `$totalAmount` parameter that contains the value of products which are returned). Such an event with the appropriate parameter must be sent each time the customer returns the products. ## Process --- The process of creating the tiered loyalty program based on the transactions value is divided into the following steps: 1. [Prepare an aggregate which returns the time of joining the loyalty program](/use-cases/loyalty-color-schemas#prepare-an-aggregate-which-returns-the-time-of-joining-the-loyalty-program). 2. [Prepare an aggregate that counts the total transaction value](/use-cases/loyalty-color-schemas#prepare-an-aggregate-that-counts-the-total-transaction-value). 3. [Prepare an aggregate that counts the value of returns](/use-cases/loyalty-color-schemas#prepare-an-aggregate-that-counts-the-value-of-returns). 4. [Prepare an expression counting the balance](/use-cases/loyalty-color-schemas#prepare-an-expression-counting-the-balance) of a customer (transaction value minus the value of returns). 5. [Prepare an expression that returns the tier number](/use-cases/loyalty-color-schemas#prepare-an-expression-that-returns-the-tier-number) to which a customer belongs to. 6. [Create a segmentation of customers in tiers ](/use-cases/loyalty-color-schemas#create-a-segmentation-of-customers-in-tiers) of customers based on their loyalty level, which you can use to analyze the number of customers in tiers. ## Prepare an aggregate which returns the time of joining the loyalty program --- Start with creating an aggregate that returns the time of the first occurrence of the `loyaltyStatus` event. We recommend setting the analyzed period to **Lifetime**. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **First**. 4. Select the event `loyaltyStatus`. 5. As a parameter, choose **Timestamp**. 6. Select **status**. 7. Use the **Equal (String)** operator and as the value, enter `active`. 8. Set the analyzed period to **Lifetime**. 9. Click **Save**.
Decision Hub First aggregate returning the timestamp of the first loyaltyStatus event with active status over a customer's lifetime
Configuration of the aggregate
## Prepare an aggregate that counts the total transaction value --- In this part of the process, create an aggregate which counts the total value of transactions for a particular customer. It will be counted from the date of joining the loyalty program, but no longer than 365 days backwards from the current date. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Sum**. 4. Select the **transaction.charge** event. 5. As the event parameter, select `$totalAmount`, then choose **TIMESTAMP**. 6. Use operator **More than (Date)** and as the value add the aggregate which you have created [in the previous step](#prepare-an-aggregate-which-returns-the-time-of-joining-the-loyalty-program). 7. Set the analyzed period to **Last 365 days**. 7. Save the aggregate.
Decision Hub Sum aggregate counting total transaction.charge value since joining the loyalty program over the last 365 days
Configuration of the aggregate
## Prepare an aggregate that counts the value of returns --- In this stage of the process, create an aggregate that counts the total value of returns made by a customer. It will be counted from the date of joining the loyalty program, but no longer than 365 days backwards from the current date. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Sum**. 4. Select the **product.return** event. 5. As the event parameter, select `$totalAmount`, then choose **TIMESTAMP**. 6. Use operator **More than (Date)** and as the value add the aggregate which you have created [in the previous step](#prepare-an-aggregate-which-returns-the-time-of-joining-the-loyalty-program). 7. Set the analyzed period to **Last 365 days**. 7. Save the aggregate.
Decision Hub Sum aggregate counting total product.return value since joining the loyalty program over the last 365 days
Configuration of the aggregate
## Prepare an expression counting the balance --- In this part of the process, prepare an expression which counts the account balance for a specific customer. The formula of the expression is a mathematical operation which deducts the [value of returns](/use-cases/loyalty-color-schemas#prepare-an-aggregate-that-counts-the-value-of-returns) from the [total value transactions](/use-cases/loyalty-color-schemas#prepare-an-aggregate-that-counts-the-total-transaction-value). 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. From the **Expressions for** dropdown list, select **Attribute**. 3. Build the following formula of the expression:
Behavioral Data Hub expression formula calculating loyalty account balance from transactions and returns
Formula of the expression
5. Save the expression. ## Prepare an expression that returns the tier number --- Prepare the expression which returns the numerical value (from 1 to 4) which signifies the tier to which a customer belongs to. If the expression returns: - `1` - the customer belongs to the `White` tier (transactions under 300 PLN) - `2` - the customer belongs to the `Green ` tier (transactions from 300 PLN to 999,99 PLN) - `3` - the customer belongs to the `Silver` tier (transactions from 1000 PLN to 1999,99 PLN) - `4` - the customer belongs to the `Golden` tier (transactions above 2000 PLN) The expression checks if the customer is part of a loyalty program, and then checks if they meet the conditions to join the highest level of the loyalty program. If not, conditions for the next level are checked, and so on until the lowest level. In the case of an error in the dat or when the customer is not assigned to any group, the expression returns `error`.
Expression - loyalty color schemas
Behavioral Data Hub expression formula returning loyalty tier number — first part
Formula of the expression - first part
Behavioral Data Hub expression formula returning loyalty tier number — second part
Formula of the expression - second part
## Create a segmentation of customers in tiers --- As the next step, you can prepare a segmentation of customers who belong to the loyalty program. The segmentation will consist of 4 segments (white, green, silver, golden) and the customers will be assigned to each segment based on the result of the [expression that returns the tier number](#prepare-an-expression-that-returns-the-tier-number) they received. 1. Go to Decision Hub icon **Decision Hub > Segmentations > New Segmentation**. 2. Enter the name of the segmentation. 3. Choose **Add condition**. 4. From the dropdown list, find the [expression that returns the tier number](/use-cases/loyalty-color-schemas#prepare-an-expression-that-returns-the-tier-number) you have created in the previous part of the process. 4. Select the **Equal** operator. 5. In the text field, enter the number that signifies a tier. In our case, enter `4` to include only customers from the `Golden` tier (total balance is equal or greater than 2000 PLN). 5. Set the name of the segment, for example `Golden`. 6. Hover a mouse cursor over the segment and click the **Duplicate** option. 6. Repeat steps 3-6 for the remaining 3 tiers. Enter the following values for the next segments: `3` (for the Silver tier segment), `2` (for the Green tier segment), `1` (for the White tier segment). 5. Save the segmentation.
Segmentation settings
Segmentation settings
You can later use those segments as an audience in your campaigns and send them personalized messages and promotions. To use the specific segment in the further communication, just create an audience where the result of this segment will be equal to the chosen value (for example `4` for the Golden tier).
## What's next --- This use case describes the basic assumptions of creating 4 tiers of loyalty. You can expand it by adding additional conditions, for example: - **Avoid abuse** - You can add a condition based on which the customers who have spent a certain amount can advance to a higher level and benefit from discounts only after the maximum return period has expired (for example, 30 days). - **Set up a billing cycle** - Suggested to be set to 12 months from achieving a particular level. During this time, a customer must make purchases for an amount specified in the terms and conditions to maintain the given level. - **Set up account validity** - Consider account validity, for example, 3 years from creating an account. During this time, a customer must confirm/update their data and meet other requirements such as making a certain number of transactions to maintain the account status. ## Check the use case set up on the Synerise Demo workspace --- You can check all the analytics directly in the Synerise Demo workspace: - aggregate returning [the time of joining the loyalty program](https://app.synerise.com/analytics/aggregates/67c86eda-4f75-35df-ad31-db88c8932b5c) - aggregate returning [the total value of transactions](https://app.synerise.com/analytics/aggregates/e5995d34-e567-3783-b8d0-cea447f60e58) for a specific customer - aggregate returning [the total value of returns](https://app.synerise.com/analytics/aggregates/f57db416-4f61-33ce-a220-d9b47a8e63e8) for a particular customer - expression returning [the balance](https://app.synerise.com/analytics/expressions/1edff9ca-66c5-415f-b35f-252ce50c96b2) for specific customer - expression which [returns the numerical value of a tier a customer belongs to](https://app.synerise.com/analytics/expressions/bbe376a4-9a92-434f-bdbb-5c588fcfe44d) - example [segmentation that divides customers](https://app.synerise.com/analytics-v2/segmentations/ebc292c1-6064-490d-a747-7a62567e81ee) into four tiers in the loyalty program. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case does not generate any events. ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Expressions](/docs/crm/expressions) Check our loyalty use cases: - [Award loyalty points for reaching a specific number of transactions](/use-cases/mechanism-of-stamps) - [Promotion for the first transaction after joining the loyalty program](/use-cases/discount-promotion-for-first-transaction) - [Promotion triggered by basket value](/use-cases/promotion-triggered-by-basket-value) - [Rewarding customers in loyalty program for custom activities](/use-cases/adding-points-for-custom-event) - [Send mobile push notifications with birthday promotion](/use-cases/mobile-push-birthday-promotion) - [Transfer loyalty points between customers](/use-cases/loyalty-points-transfer-with-push) # Adform integration Adform integration empowers businesses to extend their reach and connect with specific segments and similar audiences, capitalizing on Adform's extensive partner network. By seamlessly sending user segments from Synerise to Adform, you can reach not only users within your predefined segments but also individuals who share striking similarities with them. This can be a valuable tool for increasing advertising effectiveness, brand awareness, driving traffic to your website and boosting sales. In this use case, you will create dynamic content that assigns the adFormID attribute to customers and a workflow that sends segments of customers to Adform. ## Prerequisites --- - Have an Adform account. - Create API keys according to [this](/docs/settings/tool/api#adding-api-keys) instruction, and add appropriate permissions. Screenshot below shows all the required permissions:
The selection of permissions required for this use case
Permissions required for this use case
## Process --- In this use case, you will go through the following steps: 1. [Match ID Cookie on Web](#match-id-cookie-on-web), create Dynamic Content assigning AdformID value to site customers. 2. [Match ID Cookie on Mobile](#match-id-cookie-on-mobile), send a custom event assigning AdformID value to mobile customers. 3. [Save Adform ID as an attribute](#save-adform-id-as-an-attribute). 4. [Create a workflow to sends a group of customers to Adform](#create-a-workflow-to-share-segmentation). ## Match ID Cookie on Web --- In this part of the process, you match the Adform ID with your customer's profile in Synerise. In the browser, Adform issues an ID in a cookie named `uid` from the `adform.co.uk` domain. This cookie is unique within your browser and resets itself in the following cases: - Clearing cookies in the browser - Expiration of a cookie (60 days) - Mechanisms on the website that enforce the right of users to be forgotten (clearing cookies)
This value is not returned by calling `document.cookie`.
Since one customer can use multiple devices, it is necessary to store multiple Adform IDs per a customer in Synerise. The Adform ID is stored in the `adFormID` attribute, which will take values separated by `|` (the unique Adform ID collected from the browser or application), for example: `"adFormID": "2122903280729231000|2122903280729231001"` You can prepare a dynamic content with the code that matches the Adform ID with the UUID from Synerise by adding a value to the `adFormID` attribute. It is important that the value is added, not overwritten. 1. Go to Experience Hub icon **Experience Hub > Dynamic content > Create new**. 2. Enter the name of the dynamic content. 3. Choose the **Insert Object** type. 4. As the **Audience**, you can leave **Everyone** or specify to whom the attribute should be assigned according to your business needs. 5. In the **Content** section, click **Define**. 6. Leave **Simple message** as default. 7. In **CSS selector**: 1. Select **After (in div)** 2. In the field, enter `.snrs-modal-wrapper` 8. In the **Create your template** tab, click **Create message**. 1. Click **+ New template** in the upper rght corner. 2. Leave the **HTML** and **CSS** tabs blank, and in the **JavaScript** tab paste the following script:
(function () {

       function loadScript(src, callback) {

           let script = document.createElement('script');

           script.src = src;

           script.onload = function () {

               return callback(window.Adform);

           };

           document.head.append(script);

       }

       function checkAdform(instance) {

           if (!instance || !instance._uid) {

               console.log('no uid')

           } else {

               var oldUid = "{% if 'adFormID' in customer|string %}{{ customer['adFormID'] }}{% else %}brak{% endif %}";

               if (oldUid === 'brak' || oldUid.indexOf(instance._uid) === -1) {

                   SR.event.trackCustomEvent('adformid.save', {

                       newId: instance._uid.toString(),

                   });

                   console.log('adform uid sent -> ' + instance._uid);

               }

           }

       }

       loadScript('https://track.adform.net/serving/cookie/?adfaction=getjs;adfcookname=uid', checkAdform)

       })();
3. To continue the process of configuring the dynamic content campaign, click **Next**. 9. Click **Apply**. 10. In the **Schedule** section, click **Define**. 1. As the **Display time** choose **Display immediately**. 2. Click **Apply**. 2. In the **Display Settings** section, click **Define**. 1. Specify circumstances for dynamic content to be displayed and Advanced options, according to your business needs. 2. Click **Apply**. 3. Optionally, you can define the UTM parameters and additional parameters for your dynamic content campaign. 4. Click **Activate**. **Result:** `adformid.save` event is generated, it will contain the `adFormID` parameter with the ID value. ## Match ID Cookie on Mobile --- The cookie matching is based on the Adveritising ID, which is a fixed ID for a given device issued by Google. Currently, Advertising ID is not collected through our SDK. You must implement such tracking in the application. You can do this by sending a custom event.
{
  "label": "custom.event",
  "action": "adformid.save,
  "client": {
  "uuid": "xxx", // uuid from mobile app
  },
  "params": {
    "newId": "ADVERTISEMENT_ID"
    "source": "MOBILE_APP"                                   
    }
}
The event is recommended to be sent once per customer.
The custom event available on the activity list on the customer’s profile:
The output of custom event sent from mobile
The output of custom event sent from mobile
## Save Adform ID as an attribute --- In this part of the process you will create a workflow that is triggered by the `adformid.save` event and adds the ID it contains to the current value of the client attribute. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Profile Event trigger node --- 1. As the first node of the workflow, add **Profile Event**. In the configuration of the node: 1. From the **Choose event** dropdown menu, choose the **adformid.save** event. 2. Click the **+ where** button, from the **Choose parameter** dropdown menu, choose **newId**. 3. From the **Choose operator** dropdown, choose **Regular expression**. 4. In the next field, type the `.`, which means that all values are considered (except for `null`). 2. Click **Apply**.
The configuration of the Profile Event node
The configuration of the Profile Event node
### Define the Update Profile node --- 1. Add the **Update Profile** node. In the configuration of the node: 1. From the first dropdown list, select **adFormID**. 2. From the next dropdown list, select **Change**. 3. In the field enter the following formula:
{% set currentValue = customer['adFormID'] %}{% set newVal = event.params.newId|string %}{% set currentValues = currentValue|split('|') %}{% do currentValues.append(newVal) %}{% set finalValues = [] %}{% if currentValue|length > 255 %}{% for x in currentValues %}{% if loop.index0 > 0 %}{% do finalValues.append(x) %}{% endif %}{% endfor %}{% else %}{% if newVal in currentValue %}{% catalog.kill(it) %}{% else %}{% set finalValues = currentValues %}{% endif %}{% endif %}{{ finalValues|join('|') }}
The insert above checks: - If the customer doesn't have the `adformID` assigned, the attribute is assigned to them. - If the customer has the `adformID` assigned, the length of the ID is checked. If it exceeds 255 characters, old ID is deleted and new is added. If it doesn't, new ID is added.
2. Click **Apply**.
The configuration of the Update Profile node
The configuration of the Update Profile node
### Add the finishing node --- 1. Add the **End** node. 2. In the upper right corner, click **Save & Run**. **Results**:
Automation Hub workflow for saving the Adform ID as a profile attribute when the adformid.save event occurs
The workflow configuration
The view of the updated attribute in the customer's profile
Updated attribute in the customer's profile
## Create a workflow to share segmentation --- In this part of the process, you will prepare a workflow which sends a group of customers based on the adFormId to Adform. You will define the filters in the Audience node to include customers with assigned adFormId according to your business needs. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Audience trigger node --- 1. Start the workflow with the **Audience** node. 2. Click the node to configure it. 3. In the **Run trigger** section, specify whether you want the workflow to run cyclically or on a one-time basis. 4. In the **Define audience** section, choose **New audience**. 1. Click **Define conditions**. 2. From the **Choose filter** dropdown list, select the **adFormId** attribute. 5. From the **Choose operator** dropdown, choose **Is true**. 6. Optionally, you can add other filters to define the audience according to your business needs. 6. Click **Apply**
You can optionally add the Profile Filter node as the next step in your workflow. This node allows you to divide your segment into subgroups.
The view of the workflow with optional Profile Filter node
The workflow with optional Profile Filter node
### Configure the Outgoing Integration node --- You will use the Outgoing Integration node to upload segments from Synerise to Adform. 1. Add **Outgoing Integration**. In the configuration of the node: 1. In the upper right corner, choose **Custom**. 3. As the Webhook connection type, choose **API key**. 4. Click **Select connection**, select the API key you created as a part of [prerequisites](#prerequisites). 5. If the connection you want to use is in the list, select it and proceed. If the connection list is empty or you don’t see a connection, follow [this](/docs/automation/integration/outgoing-webhook#define-the-connection) instruction. 2. Name the webhook. 2. Select the **POST method**. 3. In the **Endpoint** field, enter the endpoint to which you will send the segment.
To obtain the endpoint, contact us at `synerise.com/support`. When contacting, provide: the link to the automation responsible for submitting the segment and the DMP ID, which you can find in your Adform panel.
4. Leave the **content-type** at the default value: `application / json`. 5. In the body of the request, paste the code below. The OwnerID value must be a combination of your workspace name and the name of the segmentation that it will be exported with to Adform, for example, SyneriseDemo_female where SyneriseDemo is the name of the workspace and female is the name of the segmentation
{% set ids = customer['adFormID']|split('|') %}
   [
   {% for x in ids %}
   {"adformID2": "{{ x }}" ,
   "OwnerID": "SyneriseDemo_female"
   }
   {% if loop.index != ids | count %},{% endif %}
   {% endfor %}
The configuration of the Outgoing Integration node
The configuration of the Outgoing Integration node
7. Click **Apply**. ### Add the finishing node --- 1. Add the **End** node. 2. In the upper right corner, click **Save & Run**. **Result**:
Automation Hub workflow for sending customer segments to Adform via Outgoing Integration
The workflow configuration
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of each step from this use case in our Synerise Demo workspace: - [Dynamic Content](https://app.synerise.com/campaigns/create/d7413af5-3e74-414d-8ff1-13d1b6bb5cb2) - [Workflow to save Adform ID as an attribute](https://app.synerise.com/automations/automation-diagram/ad437660-a793-44f2-bc58-90c5cebe633e) - [Workflow to share segmentation](https://app.synerise.com/automations/automation-diagram/5982f11b-00b8-49ac-8cbd-d9df8d8e72b1) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 10 events per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), `adformid.save` (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~2), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~2), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~2), [`profile.updated`](/docs/assets/events/event-reference/profiles#profileupdated) (~1), [`webhook.response`](/docs/assets/events/event-reference/integration#webhookresponse-and-custom-webhook-response-names) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Dynamic content](/docs/campaign/dynamiccontent) - [Integration](/docs/automation/integration) - [Segmentation](/docs/analytics/segmentations) # Promotion with basket trigger Basket trigger promotion applies to the entire contents of a shopper's basket and the customer is entitled to the promotion when the total value of the shopping cart exceeds a designated range. The decision to frame a promotion within a specific range of purchase values is strategic and purposeful. By setting a minimum threshold for eligibility, customers are motivated to explore additional products or services to reach the lower end of the range, often discovering new items of interest. On the other hand, those who are considering higher-value purchases find the incentive to maximize their savings by striving for the upper end of the range. This enables businesses to harmonize the promotion with their broader pricing strategy. In this use case, if a customer's total basket value is between 100-500 PLN, they become eligible for a generous 10% discount on their overall purchase. ## Prerequisites --- - POS must be integrated with Synerise promotion engine to calculate discounted values of basket items. - Apply [the Process basket method](https://hub.synerise.com/api-reference/loyalty-and-engagement#operation/processSale_POST) which sends information (basket value and purchased items) about the transaction made at the checkout to Synerise (in the case of applying promotions, also in offline stores). This way, we can determine whether the transaction qualifies for being included in this specific promotion. - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). - Implement promotions with [SDK mobile in your mobile application](/developers/mobile-sdk/loyalty) or through [API](https://hub.synerise.com/api-reference/loyalty-and-engagement#operation/profileLogin) in any channel.
This use case only works when Synerise is the [main source of promotion calculation](/docs/ai-hub/promotions/introduction-to-promotions#promotion-implementation-variants).
## Creating the promotion --- 1. Go to AI Hub icon **AI Hub > Regular Promotions > Add promotion**. 2. Select the **For entire cart** option. 3. In the **Audience** section, select a group of customers for whom the promotion will be activated. Confirm your selection, by clicking **Apply**. 4. In the **Content** section, define the name, description, and an image of the promotion. Confirm the settings by clicking **Apply**. 5. In **Type & limits** section: 1. As a discount type, choose **Percentage**. 2. In the **Value** field, enter the amount of discount, in our case it's `10`. 4. Define the minimum and maximum basket value trigger to apply promotion. In our case it will be `100` and `500`. 5. Apply changes.
The view of the configuration of the promotion
Configuration of the promotion
6. In the **Schedule** section, define the distribution period. 7. Optionally, in the **Stores** section, select the offline stores where the profiles can redeem the promotion. 8. In the **Items** section, select the catalog and items to be included in the promotion. 8. To apply all changes and run the promotion, click **Publish**.
As the next step, you can create a [document](/docs/assets/documents) within Synerise that includes this promotion, so that it [becomes visible](/docs/assets/documents/introduction-to-documents#exemplary-usages), for example, in the mobile application. Thanks to this, you can enhance the promotion's reach and effectiveness, potentially increasing customer engagement and sales.
## Check the use case set up on the Synerise Demo workspace --- You can check the [promotion configuration](https://app.synerise.com/campaigns/promotions/317404be-1da6-4fd0-95e2-a880ab99131c) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 4 events per profile that completes the flow: [`client.activatePromotion`](/docs/assets/events/event-reference/loyalty#clientactivatepromotion) (~1), [`transaction.charge`](/docs/assets/events/event-reference/items#transactioncharge) (~1), [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~2). ## Read more --- - [Promotions](/docs/ai-hub/promotions) # Recommend bestselling items in a WhatsApp message You can use WhatsApp to send personalized messages to potential customers who have viewed a product page and have high propenisty to buy, motivating them even more to return and purchase popular or beststelling products. Increase customer engagement and drive sales with communication that ensures customers receive customized and relevant messages with enticing incentives and exclusive deals. In this use case, you will create a workflow that sends a message on WhatsApp with the bestselling products. This workflow will be triggered by a visit to a page, however, the message will be sent only to customers with a high propensity to buy and who visited the product page and haven't made a purchase just to encourage them to come back and make a purchase.
Whatsapp bestseller message
## Prerequisites --- - Make sure you meet [all prerequisites](/docs/automation/integration/whats-app/send-template-message#prerequisites) to work with the **Send Template Message** node. - Implement a [tracking code](/developers/web/installation-and-configuration) into your website. - Implement the [transaction events](/developers/web/transactions-sdk) using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). - [Configure an item catalog for recommendations](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). Select the **Top items** model to train the feed. - Create a recommendation desribed in [this use case](/use-cases/recommendations-bestsellers#prepare-ai-recommendation). - Create a Propensity prediction described in [this use case](/use-cases/propensity-brand). ## Process --- In this use case, you will go through the following steps: 1. [Create a message template in the Meta portal](#create-a-message-template-in-the-meta-portal) 3. [Create a workflow to send message to customers on WhatsApp](#create-a-workflow-to-send-message-to-customers-on-whatsapp) ## Create a message template in the Meta portal --- Create a message template in the Meta portal that you will use in the next part of the process. In the body of the message, mark places where the dynamic elements will be added. The example message used in this use case: `*{{1}}* *{{2}} PLN* One of our best-sellers and an ABSOLUTE favorite among our customers! Hurry up because we only have a few units left.` Where `{{1}}` and `{{2}}` are markers that will be replaced with the dynamic values. This step will be done in Synerise. The screen below shows an example of template message creation in the Meta portal:
An example of body section configuration in the Meta platform
An example of body section configuration in the Meta platform
In the following screen, you can see how a button can be defined in the Meta portal:
An example of button section configuration in the Meta platform
An example of button section configuration in the Meta platform
## Create a workflow to send message to customers on WhatsApp --- The workflow will be triggered by the `Visited page` event for customers with high propenisty to buy. The delay is defined up to 1 day. If a customer does not make a transaction within one day, we will send a WhatsApp message encouraging customers to come back and buy a bestselling product. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the trigger node --- 1. As the first node, add the **Profile Event**. In the settings of the node, select the **Visited page** event. 2. Click **Apply**. ### Configure the Delay node --- 1. Add the **Delay** node. In the node settings: 1. In the **Delay** field, type `1`. 2. From the dropdown list, choose **Day**. 2. Click **Apply**. ### Define the Profile Filter node --- As the next node, choose **Profile Filter** to check if a customer with high propenisty to buy have made a transaction in the last 24 hours. 1. Add the **Profile Filter** node. In the node settings: 1. From the **Choose filter** dropdown, select the `transaction.charge` event. 2. Change **matching** to **not matching**. 3. Set the date range to the last 1440 minutes.
Use 1440 minutes instead of 1 day – use smaller granulation, as in this case 1 day would take the time from current hour till the midnight, so such an analysis will not take into consideration all necessary users.
4. From the **Choose filter** dropdown, select the `snr.propenisty.score` event. 5. Click **+ where**. 6. As the event parameter, select `score_label`. 7. As the logical operator, select **Equal**. 8. In the text field, enter `high`. 9. As the date range, select **Lifetime**. 2. Click **Apply**.
The view of Profile Filter node configuration
Configuration of the Profile Filter node
### Define the Send a template mesage node --- 1. To the **Not matched** path, add the WhatsApp **Send Template Message** node. 2. Click **Select connection**. 3. From the dropdown list, select the connection. - If no connections are available or you want to create a new one, see [Create a connection](/docs/automation/integration/whats-app/send-template-message#create-a-connection). - If you selected an existing connection, proceed to defining the integration settings. 4. In the **Sender ID** field, enter the phone number ID from which the message will be sent. [You can find more information about phone number ID here](https://developers.facebook.com/docs/whatsapp/cloud-api/get-started/add-a-phone-number). 5. In the **Receiver** field, enter the phone number of the customer who will receive this message. We recommend using the `{% customer phone %}` insert, which inserts the phone number of an individual customer who goes through this node. 6. In the **Message template** field, enter the name of the [message template](#create-a-message-template-in-the-meta-portal) you created earlier in the Meta portal. 7. From the **Language code** dropdown list, select the language used in the message. 8. In the **Message components** field, insert the object that contains the dynamic values in the order defined in the message template.   The example of object used in this use case:
The recommendation ID is used as examples for the purpose of this use case.
[
            {
                    "type": "body",
                    "parameters": [ 
                        {
                            "type": "text",
                            "text": "{% set products = [] %}{% recommendations3 campaignId=VrEXZm00A7CK %}{% for p in recommended_products3 %}{% do products.append(p) %}{% endfor %}{% endrecommendations3 %}{{ products[0].title }}" 
                        }, 
                        { 
                            "type": "text", "text": "{{ products[0].price }}" 
                        } 
                    ] 
                },
                { 
                    "type": "button", 
                    "index": "0",
                    "sub_type": "url",
                    "parameters": [ 
                        { 
                            "type": "url",
                            "text": "{{ products[0].title|replace('https://yourshop.com', '') }}" 
                        } 
                    ] 
                }, 
                { 
                    "type": "header", 
                    "parameters": [ 
                        { 
                            "type": "image", 
                            "image": { 
                                "link": "{{ products[0].image_link }}" 
                            } 
                        } 
                    ] 
                } 
            ]
9. Click **Apply**. The following table explains all the inserts used in the body, button and header sections shown above. | Section | Insert value | Insert explanation | |--------- |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | body | `{% set products = [] %}{% recommendations3 campaignId=VrEXZm00A7CK %}{% for p in recommended_products3 %}{% do products.append(p) %}{% endfor %}{% endrecommendations3 %}{{ products[0].title }}` | The value of this insert is used as the value of `{{1}}`, so the name of recommended product can be displayed in the message. | | body | `{{ products[0].price }}` | The value of this insert is used as the value of `{{2}} PLN`, to show the price of the item. | | button | `{{ products[0].title\|replace('https://yourshop.com', '') }}` | The value of this insert is used to return product url. Here we specify the URL omitting the domain, because we define the domain in the Meta platform, as you can see in the screenshot with the [button creation](#create-a-message-template-in-the-meta-portal). | | header | `{{ products[0].image_link }}` | The value of this insert is used to return the product image in the header. | ### Add the finishing node --- 1. Add the **End** node to the **Send Template Message** node. 2. To the **Matched** path, add the **End** node. 3. In the upper right corner, click **Save & Run**.
The view of Workflow configuration
Configuration of the Workflow
## Check the use case set up on the Synerise Demo workspace --- You can check the [recommendation](https://app.synerise.com/ai-v2/recommendations/4KW2iNyhE5nY) and [workflow](https://app.synerise.com/automations/automation-diagram/a958fb74-1280-4176-9041-22a8f43b463a) configuration directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 8 events per profile that completes the flow: [`page.visit`](/docs/assets/events/event-reference/web-and-app#pagevisit) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`whatsapp.sendTemplateMessage`](/docs/assets/events/event-reference/integration#whatsappsendtemplatemessage) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Jinjava inserts](/developers/inserts) - [Predictions](/docs/ai-hub/predictions) - [Recommendations](/docs/ai-hub/recommendations-v2) - [WhatsApp Send Template Message node](/docs/automation/integration/whats-app/send-template-message) # Abandoned cart with a control group and A/B tests Measuring the effectiveness of campaigns is crucial to evaluate their success and determine if they met their objectives. An important component of this measurement is the use of a control group, which allows for better analysis of campaign activities. By comparing the effects of campaigns targeted at the target group with those aimed at the control group (which doesn't receive any special campaigns), it becomes easier to assess the campaign's impact. A/B testing is a valuable technique that complements the control group approach and helps optimize campaign results. It involves testing different versions of a campaign to determine which one resonates best with the target audience. This use case presents a detailed scenario of an abandoned shopping cart. The scenario consists of two workflows, each with its own logic explained in the corresponding steps of the process. Here is a high-level overview of the process: - The process starts with adding a product to the shopping cart. - The process includes control and target groups. - Depending on which group customers are assigned to, they follow different workflow paths. - Customers in the target group receive email communication about the abandoned shopping cart, while customers in the control group don't receive any additional communication. Instead, we generate an event for the control group as a simulation for sending an email. This event is later used to analyze the effectiveness of communication targeted at the target audience. - A/B test are used to find the most effective approach that resonates with customers from the target group. - To ensure consistent email messaging, each customer is assigned an **email_group** attribute before receiving the first email. This attribute identifies the type of email the user should receive. - After sending the respective email or simulating it (for the control group), the automation checks if customers in both groups made a purchase within 25 hours of abandoning their cart. - If a transaction occurs, an event is generated with the main information about the transaction. Otherwise, a follow-up email is sent to customers. The detailed logic of each workflow along with the required analytics will be presented in the corresponding process steps. ## Prerequisites --- - [Implement a tracking code](/docs/settings/tool/tracking_codes) into your website. - Implement the [transaction events](/developers/web/transactions-sdk) using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). - [Implement the `cart.status` event](/developers/web/cart), which stores the current status of the basket in the form of an event on the customer's card. This event must to be sent to Synerise after every change in the cart status. - Collect [product.addToCart events](/docs/assets/events/event-definitions). - [Create a control group dispatcher](/use-cases/control-group-dispatcher).
See a short explanation of how the dispatcher works

The dispatcher is essentially a piece of software that intelligently manages content distribution. It uses the DC template, which is like sets of rules, to determine which content to display to different users.

Behind the scenes, this dispatcher employs JavaScript. JavaScript code within the template dynamically updates the webpage based on predefined user allocations. This means that when someone visits the webpage, the dispatcher instantly decides which version of content they should see, whether it's 'A' or 'B,' according to the rules set in the DC template.

Moreover, it attaches a special 'data-test-snrs' attribute to each user's experience. This attribute acts as a marker, helping us later identify which version of content each user was exposed to. This kind of tracking is valuable for understanding how different messages perform and for tailoring future interactions based on users' previous experiences.

- Create email templates that will be use in the abandoned cart communication. - [Create an email account](/docs/campaign/e-mail/configuring-email-account) which you will use to send emails. ## Process --- In this use case, you will go through the following steps: 1. [Create an aggregate](/use-cases/abandoned-cart-scenario#create-an-aggregate-that-returns-the-number-of-products-in-a-cart) that returns the last total quantity of items the shopping cart for each customer. 2. [Create the first workflow](/use-cases/abandoned-cart-scenario#create-the-first-workflow) which outlines the logic of an abandoned cart scenario involving the sending of emails to a target group and a control group. 3. [Create an aggregate](/use-cases/abandoned-cart-scenario#create-an-aggregate-that-returns-the-timestamp-of-the-first-message-sent-from-an-abandoned-cart-campaign) that returns the timestamp of the first message sent from an abandoned cart campaign. 4. [Create an aggregate](/use-cases/abandoned-cart-scenario#create-an-aggregate-that-returns-the-order-id-of-the-first-transaction-that-took-place-after-the-first-email-from-abandoned-cart-campaign-was-sent) that returns the order ID of the first transaction that took place after the first email from abandoned cart campaign was sent. 5. [Create a second workflow](/use-cases/abandoned-cart-scenario#create-the-second-workflow) designed to identify transactions within the abandoned cart scenario. ## Create an aggregate that returns the number of products in a cart --- This aggregate will be used in the first workflow to check if a customer has any products in the shopping cart. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last**. 5. From the **Choose event** dropdown list, select the `cart.status` event. 6. As the event parameter, select **totalQuantity**. 7. Set the period from which the aggregate will analyze the results to **Lifetime**. 12. Save the aggregate.
Decision Hub Last aggregate returning the totalQuantity parameter of the last cart.status event over a customer's lifetime
Configuration of the aggregate
## Create the first workflow --- This workflow outlines the logic of an abandoned cart scenario involving the sending of emails to a target group and a control group. The paths for both groups are very similar, with the only difference being that in the control group, an email isn't sent. Instead, sending the email is simulated by generating a special event. To understand the more detailed logic behind the first workflow, let's break it down into several parts: 1. **Trigger:** The workflow is initiated when a customer adds a product to the cart. 2. **Path Division:** In this step, we divide the path for customers assigned to the target group from those in the control group. We use a filter to determine the group assignment, resulting in two paths: one for the **control group** and one for the **target group**. Both paths further divide into two more paths based on whether the customer is entering the workflow for the first time. 3. **Target Group Path:** This path applies to customers assigned to the target group and is divided into two sub-paths: one for customers entering the workflow for the first time and another for subsequent entries. 1. **First-time entry:** For customers entering the workflow for the first time, an A/B test is conducted to assign them to either group A or group B. At this stage, each customer in the target group receives an **email_group** attribute to determine the type of emails they will receive. After assigning the email group, we check for three conditions: - The customer has products in their basket, - The customer has not completed a transaction in the past 60 minutes, - The customer has given consent for email communication. If all conditions are met, customers will receive an email specific to their email group. If not, the process ends. After sending the email, a **campaign.event** event is generated, triggering the second workflow. 2. **Reentry:** For customers who reenter the workflow, we first check which email group they were previously assigned to in order to provide them with a consistent email communication targeted to their group. After that, we check the same conditions mentioned in the first-entry path, and if all conditions are met, customers will receive an email with the abandoned cart communication. 4. **Control Group Path:** This path applies to customers assigned to the control group and is divided into two sub-paths: one for customers entering the workflow for the first time and another for subsequent entries. 1. **First-time entry:** Customers entering the workflow for the first time receive the **email_group** attribute with a value that will identify their assignment to the control group. After assigning the email group, we check for three conditions: - The customer has products in their basket, - The customer has not completed a transaction in the past 60 minutes, - The customer has given consent for email communication. If all conditions are met, we generate an event for the control group as a simulation for sending an email. If not, the process ends. After generating an event with the email send simulation, we generate a **campaign.event** event, which will be used as a trigger for the second workflow. 2. **Reentry:** For customers who reenter the workflow, we repeat all the steps described in the first-time entry, excluding the attribute assignment step (considering that customers are already assigned with the attribute when they enter the workflow for the first time). In further steps, we will describe each part of this process in detail.
The final view of the workflow
The final view of the workflow
### Define the workflow trigger --- At this stage, you should configure the conditions that trigger the workflow. In our case, the worflow is initiated when a customer adds a product to the cart and we use the `product.addToCart` event as a trigger. 1. As the first node of the workflow, add **Profile Event**. 2. From the **Choose event** dropdown menu, choose the `product.addToCart` event. 3. Confirm by clicking **Apply**. ### Create a path division --- In this part of the process, we will divide the path for customers assigned to the control group from the customers assigned to the target group. To do so, we use the **Profile Filter** node to check whether a customer was assigned to the **control group**. After checking the profile filter, the process splits into two paths: for customers who meet the filter condition (are assigned to the **control group**), and for customers who do not meet these conditions, which means that they are assigned to the **target group**. 1. Add the **Profile Filter** node. In the node settings: 1. Click **Choose filter** and select the **test-snrs** attribute form the drop-down list. 2. From the **Choose operator** drop-down, choose **Equal(String)**. 3. In the text field type `B`. 2. Click **Apply**.
Automation Hub Profile Filter node checking test-snrs attribute equals B
Profile Filter node configuration
The next step will cover the part of the process for the target group. ### Target group path This part of the process covers the path of the **target group**. In the following screenshot, we have highlighted this section. This path is further divided into two sub-paths: one for customers entering the workflow for the first time and another for customers re-entering the workflow. The division between these sub-paths is checking if customers have been assigned to any email group. Customers entering the workflow for the first time don't have the email group attribute assigned yet, so they follow the **not matched** path of the filter (and the assignment of the attribute occurs in their path). Customers re-entering the workflow have already been assigned to an email group, so they follow the **matched** path of the filter.
Target group path
Target group path
### Check if customers are assigned to an email group --- This filter is used to check whether the **email_group** attribute has been assigned to a customer profile. 1. Add the **Profile Filter** node to the **Not matched** path from the profile filter defined in ["Define the workflow trigger"](/use-cases/abandoned-cart-scenario#create-a-path-division). In the node settings: 1. Click **Choose filter** and select the **email_group** attribute form the drop-down list. 2. From the **Choose operator** drop-down, choose **Is true (Boolean)**. 2. Click **Apply**.
Automation Hub Profile Filter node checking if email_group attribute is assigned to the customer
Profile Filter node configuration
At this point, the path is divided into two sub-paths: 1. For customers who are not yet assigned to an email group: - These are customers who enter the workflow for the first time. - They will follow the **not matched** path. 2. For customers who are already assigned to an email group: - These are customers who re-enter the workflow. - They will follow the **matched** path. ### Customers from the target group who are entering the workflow for the first time --- This part of the process covers the path for customers entering the workflow for the first time. It's shown in the screenshot below.
AB test path
AB test path
The first step of this path is creating an A/B test to check which type of communication gets better reaction from the customers. #### Define the A/B test --- In this step, we set up an A/B test for the **not matched** path from the filter that checked the email group assignment. Customers will be assigned to **Group A** or **Group B**. When configuring the node, keep the allocation equal or change the proportion according to your business needs.
The view of the ABx Test node configuration
The view of the ABx Test node configuration
#### Assign an email_group attribute to customers profiles --- Depending on which group a customer is assigned to, we will add an **email_group** attribute with a value of **A** or **B** to their profile. The **ABx Test** node is divided into two paths: for **Group A** and **Group B**. For customers assigned to **Group A**, we will add an attribute with the value **A**, and for customers assigned to **Group B**, we will add an attribute with the value **B**. 1. For the path for **Group A** and **Group B** add the **Update Profile** node. 2. In the **Click to select** drop-down list, select the **email_group** attribute. If it doesn't exist, click **Add** and create it. 3. From the drop-down list on the right, select the **Change** option. 4. As the value: 1. In the path for **Group A**, enter `A` 2. In the path for **Group B**, enter `B`
The view of the Update Profile node for group A
The view of the Update Profile node for group A
#### Define the Delay node for customers from each group --- This node creates an hour's delay before moving to the next condition of the workflow. 1. Add the **Delay** node. In the node settings: 1. In the **Delay** field, type `1`. 2. From the dropdown list, choose **Hour**. 2. Click **Apply**.
Configuration of the Delay node`
Configuration of the Delay node
#### Check if the customer meets all the requirements before sending an email message --- Before sending an email message, we will check if the customer meets all requirements: - The customer has products in the basket, - The customer has not completed a transaction in the past 60 minutes, - The customer has given consent for email communication. 1. Add the **Profile Filter** node to both **Delay** nodes. In the node settings: 1. Click **Choose filter** and select the [aggregate](/use-cases/abandoned-cart-scenario#create-an-aggregate-that-returns-the-number-of-products-in-a-cart) you created earlier in the process. 2. From the **Choose operator** dropdown, choose **More than (Number)** and type `0` in the empty field. 3. From the **Choose filter** dropdown list select **transaction.charge** event. 4. Change the funnel type from **profiles matching** to **profiles not matching**. 5. To select a specific time range, click the calendar icon. In our case, it will be **Last 60 minutes**. 6. From the **Choose filter** dropdown list, select the **newsletter_agreement** attribute. 7. From the **Choose operator** dropdown, choose **Equal (String)** and type `enabled` in the empty field. 2. Click **Apply**.
Automation Hub Profile Filter node checking for non-empty basket, no recent transaction, and newsletter agreement
Profile Filter node configuration
If a customer does not meet these conditions, the workflow ends for them at this stage. Otherwise, the email message is sent. #### Send an email message to a customer --- In this step, select email templates (prepared earlier in the prerequisites) that will be sent to customers. 1. To the **Matched** path, add the **Send Email** node and open its settings. 2. In the **Sender details** section, choose the email account from which the email is sent. 3. In the **Content** section, select the template that you prepared as a part of the prerequisites. 4. **Optional**: In the **UTM & URL parameters** section, define the UTM parameters added to the links included in the email. 5. **Optional**: In the **Additional parameters** section, describe campaigns with [additional parameters](/docs/campaign/e-mail/creating-email-campaigns#adding-custom-parameters). 6. Click **Apply**. #### Generate an event that will trigger the second workflow --- In this part of the process, we will generate a custom event that will act as a trigger for the second workflow. This event's action is **campaign.event** and it includes the following details: - Campaign name, - Test group to which the customer was assigned, - Event type. 1. Add the **Generate Event** node to previous **Send Email** nodes. 2. In the **Event name** field, enter the name of the event that will be generated on the customer's profile. In this case, it is `campaign.event`. 4. In the **Body** section, define the parameters of this event: 1. Include a `campaign` parameter with the campaign name. 2. Include a `trigger` parameter with the value set to `trigger` 3. Include the `group` parameter: 1. For group A, set it to `A` 2. For group B, set it to `B` **Example content of **Body** section for Group A:** {{< highlight json >}} { "campaign": "abandoned cart - mail", "group": "A", "type": "trigger" } {{< /highlight >}} {{% note %}} The event body is an example. You can use a different campaign name and add more properties, if needed. {{% /note %}}
Configuration of the Generate Event node for Group A
Configuration of the Generate Event node for Group A
Add the **End** node to complete the path associated with the A/B test (with the path dedicated to the customers entering the workflow for the first time). In the next steps, we will address the second part of the path related to the target group - the path intended for customers who have reentered the workflow. ### Customers from the target group that reenter the workflow --- In this part of the process, we will go through the path designed for customers re-entering the workflow. The described part of the workflow is shown in the screenshot below.
Path for the customers from the target group that reeneter the workflow
Path for the customers from the target group who re-enter the workflow
At the start of this path, we check the assigned email group of the customer to determine the type of email to be sent. This ensures that we send an email specifically tailored to the email group the customer was assigned to upon their initial entry into the workflow. To do this, we will first check if the customer is assigned to the **A** email group. #### Check if the customer is assigned to the A email group --- This step checks if the returning customer was assigned to email group **A**. 1. Add the **Profile Filter** node to the **Matched** path from the [filter](/use-cases/abandoned-cart-scenario#create-a-path-division) that checks the customer assignment to any email group. In the node settings: 1. Click **Choose filter** and select the **email_group** attribute from the dropdown list. 2. From the **Choose operator** drop-down, select **Equal (String)**. 3. In the empty field, type `A` 2. Click **Apply**.
Automation Hub Profile Filter node checking if customer is assigned to email group A
Profile Filter node configuration
If the customer has not been assigned to email group **A**, we then check whether they are assigned to email group **B**. #### Check if the customer is assigned to the B email group --- The configuration of this node is the same as described in the previous step, except that this time we are checking the assignment to group B. 1. At the **not matched** path of the node that checks assignment to group A, add a **Profile Filter** node. In the node settings: 1. Click **Choose filter** and select the **email_group** attribute from the dropdown list. 2. From the **Choose operator** drop-down, choose **Equal (String)**. 3. In the empty field, type `B` 2. Click **Apply**. After creating both filters to check the assignment for email group A and B, there are two paths. One is for customers assigned to group A, and the other is for those assigned to group B. The steps following both paths will be the same, with the only difference being the mailing they will receive, as it is specific to their assigned email group. Additionally, the value of the group parameter in the trigger event generated at the end of the workflow will store the group to which the customer is assigned. For customers who have not been assigned to any group, the workflow ends after the filter checks the profiles for assignment to group B. #### Define the Delay node for customers from each group --- This node creates an hour's delay before moving to the next condition of the workflow. 1. Add the **Delay** node to both **Profile Filter** nodes. In the node settings: 1. In the **Delay** field, type `1`. 2. From the dropdown list, choose **Hour**. 2. Click **Apply**.
Configuration of the Delay node`
Configuration of the Delay node
#### Check if customers meet all the requirements before sending an email message --- Before sending the email, we will check if the customer meets all the conditions, which are the same conditions described [earlier in the process](/use-cases/abandoned-cart-scenario#check-if-the-customer-meets-all-the-requirements-before-sending-an-email-message). To simplify the configuration of the Profile Filters with these conditions, you can duplicate a previously created node and add it to both **Delay** nodes. For customers who do not meet the defined conditions, the workflow comes to an end. However, for those who do meet all conditions, the next step in the process is to send them an email. #### Send an email message to a customer --- In this part of the process, we will send an email to customers in both email groups. You need to create two **Send Email** nodes and use the dedicated template for each email group that you have already prepared in the prerequisites. The configuration of these nodes remain the same as described in [this part of the process](/use-cases/abandoned-cart-scenario#send-an-email-message-to-a-customer). To simplify the configuration of these nodes, you can duplicate a previously created node and add it to both paths. #### Generate an event that will trigger the second workflow --- In this part of the process, we will generate a custom event that will act as a trigger for the second workflow. The configuration of this event remain the same as described in [this part of the process](/use-cases/abandoned-cart-scenario#generate-an-event-that-will-trigger-the-second-workflow). To simplify the configuration of these node, you can duplicate a previously created node and add it to both paths. Add the **End** node to end the path associated with customers from the target group who reenter the workflow. That wraps up the workflow section related to customers from the target group. Next, we'll delve into the second part of the workflow, which focuses on the control group path. ### Control group path --- In this part of the process, we will focus on the path from the workflow that is dedicated to the **control group**. In the following screenshot, we have highlighted this section. This path is also further divided into two sub-paths: one for customers entering the workflow for the first time and another for customers reentering the workflow. The division between these sub-paths is determined by a filter that checks if customers have been assigned the email group **D**. Customers entering the workflow for the first time do not have the email group attribute assigned yet, so they follow the **not matched** path of the filter (and the assignment of the attribute occurs in their path). On the other hand, customers reentering the workflow have already been assigned an email group, so they follow the **matched** path of the filter.
Controlt group path
Control group path
### Check if customers are assigned to email group D --- This filter checks if the **email_group** attribute with the value `D` is assigned to a customer profile. 1. Add the **Profile Filter** node to the **Matched** path from the profile filter defined in [this part](/use-cases/abandoned-cart-scenario#create-a-path-division) of the process. In the node settings: 1. Click **Choose filter** and select the **email_group** attribute form the dropdown list. 2. From the **Choose operator** drop-down, choose **Equal (String)**. 3. In the empty field, type `D` 2. Click **Apply**.
Automation Hub Profile Filter node checking if customer is assigned to email group D
Profile Filter node configuration
At this point, the path is divided into two sub-paths: 1. For customers who are not yet assigned to the email group **D**: - These are customers who enter the workflow for the first time. - They will be redirected to the **not matched** path. 2. For customers who are already assigned to the email group **D**: - These are customers that reenter the workflow. - They will be redirected to the **matched** path. ### Customers from the control group who are entering the workflow for the first time --- In this part of the process, we will go through the path designed for customers entering the workflow for the first time. The described part of the workflow is shown in the screenshot below.
Path for the customers from the control group that enter the workflow for the first time
Path for the customers from the control group that enter the workflow for the first time
#### Assign an email_group attribute to customers profiles --- In this step we will assign customers from the control group who enter the workflow for the first time to email group **D**. 1. For the **Not Matched** path for the filter that checks the assignment to email group **D**, add the **Update Profile** node. 2. In the **Click to select** dropdown list, add the **email_group** attribute. 3. From the dropdown list on the right, select the **Change** option. 4. In the empty field, type `D`
Automation Hub Update Profile node assigning email group D to control group customers
Profile Filter node configuration
#### Define the Delay node ---- This node creates an hour's delay before moving to the next condition of the workflow. 1. Add the **Delay** node to both **Profile Filter** nodes. In the node settings: 1. In the **Delay** field, type `1`. 2. From the dropdown list, choose **Hour**. 2. Click **Apply**. #### Check if customers meet all the requirements before sending an email message --- Before sending the email, we will check if the customer meets all the conditions, which are the same conditions as described [earlier in the process](/use-cases/abandoned-cart-scenario#check-if-the-customer-meets-all-the-requirements-before-sending-an-email-message). To simplify the configuration of the Profile Filters with these conditions, you can duplicate a previously created node and add it to both **Delay** nodes. For customers who do not meet the conditions, the workflow comes to an end. However, for those who meet all conditions, the next step in the process is to generate an event as a simulation for sending an email. #### Generate an event to simulate sending an email --- In this part of the process, we generate a **campaign.event** event with parameters that indicate that this is a simulation of an email dispatch. This event is created for the purpose of further analysis of the effectiveness of the overall implemented actions. 1. Add **Generate Event** to previous **Send Email** nodes. 2. In the **Event name** field, enter the name of the event that will be generated on the customer's profile. In this case, it is `campaign.event`. 4. In the **Body** section, define the parameters of this event, and click **Apply**. **Example content of **Body** section for Group D:**
{
     "campaign": "abandoned cart - mail",
     "group": "D - Control group",
     "type": "simulation of sending an e-mail"
   }
#### Make sure that the event has been generated --- This filter serves as a security measure to ensure that the **campaign.event** event was generated in the previous step. 1. Add the **Event Filter** node. In the configuration of the node: 1. Set **Check** to **for period of time**. 2. Define the time range to **10 minute**. 3. From the **Choose event** dropdown list, select the **campaign.event** event. 4. As the event parameter, select **type**. 5. From the **Choose operator** dropdown list, select **Equal (String)**. 6. As the value, enter `simulation of sending an e-mail`. The provided value must be the same as the one defined in the event body. 2. Confirm by clicking **Apply**.
The view of the Event Filter node configuration
Event Filter node configuration
#### Generate an event that will trigger the second workflow --- In this part of the process, we will generate the **campaign.event** event, which will act as a trigger for the second workflow. The structure of the event body is similar to the previously created events for target group customers, with the only difference in the value of the **group** parameter, which is always specific to the featured group. 1. Add the **Generate Event** node to previous **Send Email** nodes. 2. In the **Event name** field, enter the name of the event that will be generated on the customer's profile. In this case, it is `campaign.event`. 4. In the **Body** section, define the parameters of this event: 1. Include a `campaign` parameter with the campaign name. 2. Include a `trigger` parameter with the value set to `trigger` 3. Include the `group` parameter with the value set to `D - Control group` **Example content of **Body** section for Group D:**
{
     "campaign": "abandoned cart - mail",
     "group": "D - Control group",
     "type": "trigger"
   }
Add the **End** node to complete the path related to the customers from the control group that enter the workflow for the first time. In the next steps, we will address the second part of the path related to the control group - the path intended for customers who have reentered the workflow. ### Customers from the control group who re-enter the workflow --- In this part of the process, we will go through the path designed for customers reentering the workflow. The described part of the workflow is shown in the screenshot below.
Path for the customers from the control group that reenter the workflow
Path for the customers from the control group that reenter the workflow
Customers following this path have already been assigned an email group. Their process begins with a 1 hour delay. After the Delay node, the remaining steps for these customers are identical to those described for [customers from the control group who enter the workflow for the first time](/use-cases/abandoned-cart-scenario#customers-from-the-control-group-who-are-entering-the-workflow-for-the-first-time). Therefore, you need to repeat all those steps in the same order: - [Check if customers meet all the requirements before sending an email message](/use-cases/abandoned-cart-scenario#check-if-customers-meet-all-the-requirements-before-sending-an-email-message-1) - [Generate an event to simulate sending an email](/use-cases/abandoned-cart-scenario#generate-an-event-to-simulate-sending-an-email) - [Make sure that the event has been generated](/use-cases/abandoned-cart-scenario#make-sure-that-the-event-has-been-generated) - [Generate an event that will trigger the second workflow](/use-cases/abandoned-cart-scenario#generate-an-event-that-will-trigger-the-second-workflow-2) Once this path is completed, add an **End** node to conclude the path associated with the customers from the control group that reenter the workflow. That wraps up the creation of the first workflow. ## Create an aggregate that returns the timestamp of the first message sent from an abandoned cart campaign --- This aggregate returns the timestamp of the first message sent from an abandoned cart campaign described in the first workflow. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **First**. 5. From the **Choose event** dropdown list, select the `message.send` event. 6. As the event parameter, select **TIMESTAMP**. 7. Click the **+ where** button and from the dropdown list, choose **campaignName**. 8. From the **Choose operator** dropdown, select **Contain (String)**. 9. In the text field, type the name of the abandoned cart campaign you used in the first workflow. In our case it's `Abandoned cart`. 10. Set the period from which the aggregate will analyze the results to **Last 1455 minutes** (this is 24 hours with a spare of 15 minutes). 11. Save the aggregate.
Decision Hub First aggregate returning the TIMESTAMP of the first message.send event matching the abandoned cart campaign name in the last 1455 minutes
Configuration of the aggregate
## Create an aggregate that returns the order ID of the first transaction that took place after the first email from abandoned cart campaign was sent --- The ID of this aggregate will be used as an insert in the event generated in the second workflow. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **First**. 5. From the **Choose event** dropdown list, select the `transaction.charge` event. 6. As the event parameter, select **$orderId**. 7. Click the **+ where** button and from the dropdown list, choose **TIMESTAMP**. 8. From the **Choose operator** dropdown, select **More than (Date)**. 9. Click Choose value icon (Choose value icon). 10. From the **Choose value** dropdown list, select the aggregate you created in the [previous step](/use-cases/abandoned-cart-scenario#create-an-aggregate-that-returns-the-timestamp-of-the-first-message-sent-from-an-abandoned-cart-campaign) of the process. 11. Set the period from which the aggregate will analyze the results to **Last 1455 minutes**. 12. Save the aggregate.
Decision Hub First aggregate returning the $orderId of the first transaction.charge event that occurred after the abandoned cart email was sent in the last 1455 minutes
Configuration of the aggregate
## Create the second workflow --- The purpose of the second workflow is to identify the transactions that occurred in the abandoned cart scenario. This helps us in future analyses to measure the quantity and value of transactions that occurred after the customer received the abandoned cart message. By doing this, we can assess the effectiveness of the performed actions. Let's dive into the detailed logic of the second workflow: - At the end of each email group's path (A, B, and D) in the first workflow, we generated a **campaign.event** event. This event serves as a trigger for the second workflow. Therefore, the second workflow now consists of three triggers, each dedicated to customers from a specific email group. By utilizing the parameters of each event, we create separate audiences for customers belonging to each email group. - The subsequent steps in the workflow are very similar for all three email groups. We will describe the process simultaneously, highlighting any differences that occur in certain steps. - After defining the triggers and creating audiences for each email group, we check (using the Profile Filter) if a customer has made a transaction within the last 25 hours. At this point, the path for customers from each email group splits into two: those who made a transaction and those who didn't. - **Customers who made a transaction:** For customers who completed a transaction, we generate a **campaign.event** event. This event has a similar structure to the previously generated events, but has a different `type` value. It also includes additional information about the order ID from the transaction the customer made during the abandoned cart process. This order ID allows us to identify the value of transactions made during the abandoned cart process, enabling the creation of useful metrics for campaign analysis. - **Customers who didn't make a transaction:** For customers in email groups A and B (target groups) who didn't make a transaction but have consented to email communication, we send a follow-up email. For customers in email group D (control group), we generate a simulated event indicating that an email was sent. - Finally, we merge all the created paths to conclude the process.
The final view of the workflow
The final view of the workflow
### Define the workflow triggers --- At this part of the process, configure three triggers of the workflow. Those triggers will be activated each hour for customers from each email group for whom a **campaign.event** event trigger was generated in the first workflow. 1. Start the workflow with the **Audience** node. 2. In the configuration of the node, set the **Run trigger** option to **repeatable**. 3. Set the interval to 1 hour. 4. Choose the day and time when the process starts. 5. Select the time zone. 6. In **Define audience**, choose **New Audience** and click **Define conditions**. 1. As the first condition, from **Choose filter** dropdown menu, choose the `campaign.event` event. 2. From the **Choose parameter** dropdown list, select **type**. 3. From the **Choose operator** dropdown list, select **Equal (String)**. 4. In the right field, enter the value of the **type** parameter that was generated in the event. In our case, we type `trigger`. 5. From the **Choose parameter** dropdown list, select **campaign**. 6. From the **Choose operator** dropdown list, select **Equal (String)**. 7. In the right field, enter the value of the **campaign** parameter that was generated in the event. In our case, we type `abandoned cart - mail`. 8. From the **Choose parameter** dropdown list, select **group**. 9. From the **Choose operator** dropdown list, select **Equal (String)**. 10. In the right field, enter the names of the groups for each email group you are creating the trigger for: 1. For group A, enter `A` 2. For group B, enter `B` 3. For group D, enter `D - control group` 11. Define the time range from which you want to analyze this event. In our case, it's **Last 60 minutes before 24 hours**.
Configuration of the Audience node for group A
Configuration of the Audience node for group A
### Check whether customers from each group have made a transaction in the last 25 hours --- 1. Add the **Profile Filter** node to the trigger from each group. 2. From the **Choose filter** dropdown list, select the **transaction.charge** event. 3. Set the period from which you want to analyze this event. In our case, we use **Last 1500 minutes**. 4. Apply all changes. After this **Profile Filter** path for customers from each email group splits into two: those who made a transaction and those who didn't. ### Path for customers that made a transaction --- When a customer completes a transaction after abandoning their cart, we generate a **campaign.event** event. This event contains information about the customer's **order ID** from the transaction. The order ID helps us identify the value of transactions made during the abandoned cart process, which is important for creating useful metrics for campaign analysis. The customers from different groups are differentiated by the value of the **group** parameter in the **campaign.event** event. 1. To the **Matched** path from the [profile filter](/use-cases/abandoned-cart-scenario#check-whether-customers-from-each-group-have-made-a-transaction-in-the-last-25-hours) for all email groups add the **Generate event** node. 2. In the **Event name** field, enter the name of the event that will be generated in the customer's profile. In this case, it's `campaign.event`. 4. In the **Body** section, define the parameters of this event and click **Apply**.
In the `orderID` section, place an [aggregate ID that returns the order ID of the first transaction](/use-cases/abandoned-cart-scenario#create-an-aggregate-that-returns-the-order-id-of-the-first-transaction-that-took-place-after-the-first-email-from-abandoned-cart-campaign-was-sent) created earlier in the process. AYou should also change the group value for the corresponding groups.
**Example content of "Body" section for Group A:**
{
     "campaign": "abandoned cart - mail",
     "group": "A",
     "orderID": "{% aggregate 4c1a5eff-edae-33e9-89c2-191bb460ef46 %} {{ aggregate_result[0] }} {% endaggregate %}",
     "type": "revenue prod"
   }
5. Confirm by clicking **Apply**.
Configuration of the Generate Event node for group A
Configuration of the Generate Event node for group A
This node will be then connected with the **Merge Paths** node that combines seperate path into one. ### Path for customers who have not completed the transaction --- Customers belonging to email groups A and B (target groups) who have not completed a transaction but have given consent for email communication receive a follow-up email. On the other hand, for customers in email group D (control group), we generate a simulated event to indicate that an email was sent. #### Check whether customers have given consent for email communication --- 1. To the **Not Matched** path from the [Profile Filter node which checks if the customer made a transaction](/use-cases/abandoned-cart-scenario#check-whether-customers-from-each-group-have-made-a-transaction-in-the-last-25-hours), for all email groups add the **Profile Filter** node. 1. Click **Choose filter** and select **newsletter_agreement** attribute form the dropdown list. 2. From the **Choose operator** drop-down, choose **Equal(String)**. 3. In the text field, type `enabled`. 2. Click **Apply**. For customers who have not provided consent, the workflow comes to an end. However, for customers from email groups A and B (target group) who meet the conditions of this filter, we proceed to the next step and send them a follow-up email. For customers from email group D (control group), we generate a simulated event to indicate that an email was sent. #### Send a follow-up email for customers from email group A and B --- 1. To the **Matched** path from the [profile filter](/use-cases/abandoned-cart-scenario#check-whether-customers-have-given-consent-for-email-communication), add the **Send Email** node and open its settings. 2. In the **Sender details** section, choose the email account from which the email is sent. 3. In the **Content** section, select the template that you prepared as part of the prerequisites. 4. **Optional**: In the **UTM & URL parameters** section, define the UTM parameters added to the links included in the email. 5. **Optional**: In the **Additional parameters** section, describe campaigns with [additional parameters](/docs/campaign/e-mail/creating-email-campaigns#adding-custom-parameters). 6. Click **Apply**. This node will be then connected with the **Merge Paths** node that combines seperate path into one. #### Generate an event to simulate sending a follow-up email --- 1. Add the **Generate Event** node to the **Matched** path from the [profile filter](/use-cases/abandoned-cart-scenario#check-whether-customers-have-given-consent-for-email-communication) checking email communication consent. 2. In the **Event name** field, enter the name of the event that will be generated on the customer's profile. In this case, it is `campaign.event`. 4. In the **Body** section, define the parameters of this event, and click **Apply**. **Example content of "Body" section for Group D:**
{
     "campaign": "abandoned cart - mail",
     "group": "D - Control group",
     "type": "simulation of sending an e-mail follow up"
   }
Configuration of the simulation event for group D
Configuration of the simulation event for group D
Merge all the final nodes from each email group path into a single path using the **Merge Paths** node and add an **End** node to complete the process. ## What's next --- Once both workflows are launched, you will obtain valuable information that can be utilized to measure the campaign's performance. This data can be collected and analyzed through a dashboard, which will present the achieved results in a breakdown for each group (control and target). Through the dashboard, you can assess the overall performance of your campaign, evaluate the results of the AB test conducted for the target group, and determine the number and value of transactions that occurred during the abandoned cart process. ## Generated events This use case generates approximately 26 events per profile that completes the flow: [`product.addToCart`](/docs/assets/events/event-reference/items#productaddtocart) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~2), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~11), [`automation.abTestVariantAssigned`](/docs/assets/events/event-reference/automation#automationabtestvariantassigned) (~1), [`profile.updated`](/docs/assets/events/event-reference/profiles#profileupdated) (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1), `campaign.event` (~2), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~2), [`transaction.charge`](/docs/assets/events/event-reference/items#transactioncharge) (~1), [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~2). ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of each step from this use case in our Synerise Demo workspace: - [Aggregate](https://app.synerise.com/analytics/aggregates/0d351702-fb43-356e-a90a-c405fa0a388c) that returns the sku of products in the shopping cart for each customer - [First workflow](https://app.synerise.com/automations/automation-diagram/1fcb7219-dbb3-4fc3-b51e-37ae8b738c20) - [An aggregate](https://app.synerise.com/analytics/aggregates/d49c2395-e7af-3cbe-83eb-5e69f4377c75) that returns the timestamp of the first message sent from an abandoned cart campaign - [An aggregate](https://app.synerise.com/analytics/aggregates/4c1a5eff-edae-33e9-89c2-191bb460ef46) that returns the order ID of the first transaction that took place after the first email from abandoned cart campaign was sent - [Second workflow](https://app.synerise.com/automations/automation-diagram/862cf91e-5e99-4fc4-86b1-cfe76a235e83) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. # Display Real-Time Purchase Counts for Social Proof on Product Pages Social proof effectively harnesses the power of the crowd, conveying the persuasive message that if many others have bought and are happy, a new customer is likely to experience the same satisfaction, further amplifying the impact of social proof in driving sales.
Screenshot presenting website with social proof dynamic content
Social proof campaign
In this particular use case contains instruction on implementing a dynamic social proof strategy on a website to drive sales and build brand credibility. The cornerstone of this strategy is the display of real-time data showing purchase trends. This approach taps into the psychological principle of social proof, where potential customers are more likely to make a purchase if they see that a product is popular and trusted by many others. ## Prerequisites --- - Implement a [tracking code](/docs/settings/tool/tracking_codes). - [Implement transactions](/developers/web/transactions-sdk). ## Process --- In this use case, you will go through the following steps: 1. [Create metrics with dynamic key](/use-cases/social-proof-trends#create-metrics-with-dynamic-key). 2. [Prepare a dynamic content](/use-cases/social-proof-trends#prepare-a-dynamic-content). ## Create metrics with dynamic key --- Implementation of social proof on a website involves creating a metric that counts occurrence of a specific event, such as product purchase in the context of a specific item. Then, the metric ID is used in the template of the [dynamic content](/docs/campaign/dynamiccontent) which will be displayed on product pages. The result of the metric will adapt to the currently viewed product thanks to the dynamic key used in the metric. In our case, we will create two metrics with the same conditions but analyzing different time ranges: - [Metric with the number of bought items in the last 30 days](/use-cases/social-proof-trends#metric-with-the-number-of-bought-items-in-the-last-30-days). - [Metric with the number of bought items in the last 30 days before 30 days](/use-cases/social-proof-trends#metric-with-the-number-of-bought-items-in-the-last-30-days-before-30-days). ### Metric with the number of bought items in the last 30 days In this part of the process, you will create a metric that counts the occurrences of the [product.buy event](/docs/assets/events/event-reference/items#productbuy) in the context of the specific item in the last 30 days. Instead of defining the exact value of the item, we will create a dynamic key that will take the values sent through the `sku` parameter of the `product.buy` event. This solution will let the metric results to adjust to the product page currently viewed by a customer. 1. Go to **Decision Hub > Metrics > New metric**. 2. Leave the **Type**, **Aggregator** and **Occurrence type** options at default (**Event**, **Count**, **all**). 3. From the **Choose events** dropdown list, select **product.buy**. 4. Click the **+ where button** and select a parameter that indicated a product ID (in this case its **$sku**). 5. From the **Choose operator** dropdown list, select **Contain**. 6. Click the icon next to the logic operator and keep clicking until you get Choose value icon. 6. In the left field, enter `sku`. 7. In the right field, enter a default value of the dynamic key (0 in our example). At this stage, the default value of the dynamic key is not important. 8. Define the analyzed period (last 30 days in our example).
Screenshot presenting Metric filter
Metric filter
### Metric with the number of bought items in the last 30 days before 30 days In this part of the process, you will create a metric that counts the occurrences of the [product.buy event](/docs/assets/events/event-reference/items#productbuy) in the context of the specific item in last 30 days before 30 days. Duplicate the [previous metric](/use-cases/social-proof-trends#metric-with-the-number-of-bought-items-in-the-last-30-days) and change the analyzed period to last 30 days before 30 days.
You can prepare metrics based on other events such as [`product.addToCart`](/docs/assets/events/event-reference/items#productaddtocart) or [`page.visit`](/docs/assets/events/event-reference/web-and-app#pagevisit). By preparing metrics for these or other events, it's important to keep their retention in mind while defining the analyzed period, if you select period longer than the event retention, you will receive inaccurate results.
## Prepare a dynamic content --- To show a social proof on your product pages, prepare a dynamic content. 1. Go to **Experience Hub > Dynamic content > Create communication**. 2. Choose **Insert Object** type. 3. In the **Audience** section, select **Everyone**. 4. In the **Content** section, select **Simple message** and by inserting CSS selector define where the social proof will display on your website. 5. In the **Content** tab, click **Create Message** and insert a code of the metrics which you prepared in the previous steps. The customer will receive information about how many times the product has been bought. You can use the following JavaScript:
Check the Javascript with a product image
(function () { const metricPrevious30 = +`{% metrics %} 2f11b5f7-ddc0-4ea1-a1c2-628dd2de0d29 {% endmetrics %}`; const metricLast30 = +`{% metrics %} d798b895-19ce-44b0-b54c-06996f7898e5 {% endmetrics %}`; const imageLink = `{{ metric_additional_params["og:image"] }}`; // For example metricPrevious30 is 100, and metricLast30 is 130. That gives 30% const percent = ((metricLast30 - metricPrevious30) / metricPrevious30) * 100; // if percent is below limit or one of metric gives 0 stop the script if (Number.isNaN(percent) || percent < +`#### type: "number", id: "Percent", defaultValue: "30" !####`) return; const wrapperEl = document.querySelector(".snr-sp__main-wrapper"); const counterEl = wrapperEl.querySelector(".snr-sp__counter"); const imgEl = document.querySelector(".snr-sp__image img"); const peopleEl = document.querySelector(".snr-sp__people"); const showLabel = () => wrapperEl.classList.remove("snr-sp__hidden"); const hideLabel = () => wrapperEl.classList.add("snr-sp__hidden"); const getPeople = (num) => (num > 1 || num == 0 ? "people" : "person"); wrapperEl.addEventListener("click", hideLabel); counterEl.innerText = metricLast30 + ""; imgEl.src = imageLink; peopleEl.innerText = getPeople(metricLast30); setTimeout(() => { showLabel(); setTimeout(hideLabel, +`#### type: "number", id: "Display time in ms", defaultValue: "5000" !####`); }, +`#### type: "number", id: "Delay time in ms", defaultValue: "2000" !####`); })();
6. Schedule when the dynamic content will be active.
Screenshot presenting display settings
Set up display settings
7. In the **Display settings** section, define the circumstances the dynamic content will be shown: - Always on landing, on All pages if **in CSS selector** is unique selector for a product page. - Always on landing, **on a specific URL** which indicates a product page (for example, if a URL contains product), if CSS selector is not unique for a product page.
For the purposes of this example, all necessary settings have been completed in accordance with the example in the graphic; depending on the scenario of our dynamic content, the settings may be different. You can read more about [dynamic content](/docs/campaign/dynamiccontent/creating-dynamic-content/creating-dynamic-content#define-url-targeting) in our article.
## Check the use case set up on the Synerise Demo workspace --- Check all items (metrics and dynamic content) created in this use case in our Synerise Demo workspace: - [Metric with the number of bought items in the last 30 days](https://app.synerise.com/analytics/metrics/d798b895-19ce-44b0-b54c-06996f7898e5), - [Metric with the number of bought items in the last 30 days before 30 days](https://app.synerise.com/analytics/metrics/2f11b5f7-ddc0-4ea1-a1c2-628dd2de0d29), - [Dynamic content settings](https://app.synerise.com/campaigns/dynamic-content/create/bc84f31a-e9a5-4101-a451-93bd810dce6f). If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 2 events per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1). ## Read more --- - [Dynamic content](/docs/campaign/dynamiccontent) - [Dynamic key](/docs/analytics/i_events-parameter-value#dynamic-key) - [Metrics](/docs/analytics/metrics/introduction-to-metrics) # Apply synonyms in the search engine With Synerise AI search, you can effectively control how your search engine processes queries. By using synonyms, you can increase the reach of your products and make sure that customers always find what they are looking for. This use case describes the process of creating synonyms for a headphones query. ## Prerequisites --- - An item feed must be provided. - Enable [The Search Engine](/docs/ai-hub/ai-search/introduction-to-ai-search) for your workspace and create an [index](/docs/ai-hub/ai-search/create-index). - [Implement AI search](https://hub.synerise.com/api-reference/ai-search) in any of your channels (mobile app, website etc.) ## Add synonyms --- In this use case, you add synonyms to a set of words: **headphones, headsets, earphones** so that when a user types any of these words into a search engine, they are all treated as synonyms of each other and will produce relevant search results. 1. Go to AI Hub icon **AI Hub > Indexes**. 2. Select an index from the list. 3. Click the **Synonyms** tab. 4. Click **Add synonym > Add synonym**. 5. From the dropdown list, select **Two ways**. 5. In the **Synonyms** field, enter: `headphones, headsets, earphones` In this configuration, each word in the list a synonym of the other words. 6. Confirm by clicking **Add**.
Example of synonym conditions
Example of synonym conditions
You can also import synonyms from a CSV file, follow instructions in the ["Add synonyms"](/docs/ai-hub/ai-search/add-synonyms#procedure) article.
## Check the use case set up on the Synerise Demo workspace --- You can check the synonyms in [AI Search configuration](https://app.synerise.com/ai-v2/search/indices/bf68c73a3c0adae495e3dc67c8eb9b9a1657485148/synonyms) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 2 events per profile that completes the flow: [`item.search`](/docs/assets/events/event-reference/search#itemsearch) (~1), [`item.search.click`](/docs/assets/events/event-reference/search#itemsearchclick) (~1). ## Read more --- - [Configuring AI Search](/docs/ai-hub/ai-search/introduction-to-ai-search#configuring-ai-search). # Collecting newsletter submissions from users without cookie tracking Privacy regulations may require that users who decline cookie consent still have the ability to subscribe to communications such as a newsletter. In this use case, we’ll show you how to collect newsletter signups **without using tracking mechanisms**, and still create a compliant user profile in Synerise. This setup ensures you're not violating privacy preferences while still growing your subscriber base. ## Prerequisites --- A privacy-compliant form on your website that works independently of the SDK. ## Process --- In this use case, you’ll go through the following steps: 1. [Create an incoming integration](/use-cases/do-not-track#create-an-incoming-integration) (webhook) to receive form data. 2. [Create a workflow](/use-cases/do-not-track#create-a-workflow) that listens to incoming events. ## Create an incoming integration --- In this part of the process, you will create an incoming integration to securely receive form submissions from the newsletter form, from users who have opted out of cookies or tracking. 1. Go to Automation Hub icon **Automation Hub > Incoming > New integration**. 2. On the pop-up, select **without authentication**, **JWT authentication** or **Webhook from Meta** based on your business needs. 3. Enter the name of the webhook. 3. In the **Endpoint** section, click **Define**.
The URL field is already is filled in with the endpoint to which the data will be sent.
1. Optionally, you can add an icon to this integration. 3. Confirm by clicking **Apply**. 4. In the **Incoming data** section, click **Define**. 5. Click **Retrieve data**. Right after you click the button, send a request to the endpoint in the **Endpoint** section with the sample of data that will be sent through forms. Example request:
{"firstname": "test",
       "lastname": "test",
       "email": "user@example.com",
       "newsletterAgreement": "true"
       }
You can retrieve the data and parameters you need for your business. An example is shown above.
6. When the endpoint receives data from the request, verify the list of variables available in the **Incoming data** section. If the variables include those which are in the payload click **Apply**. If not, click **Start again** re-send request, and wait for the results. 7. Click **Save & publish**.
The full documentation of the incoming integration feature is available in the [Incoming Integration](/docs/automation/integration/incoming-webhook-node) article.
## Create a workflow --- In this part of the process, you will build a workflow that triggers automatically each time new user data is received through the webhook. Make sure the email field is present and valid (in our case, it contains an `@` symbol). The workflow sends the email address through the Outgoing Integration node to the endpoint that creates or updates a user profile in Synerise. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Business Event node 3. As the trigger, select **Business Event**. In the configuration of the node: 1. Select the [incoming integration for customer's data](#create-an-incoming-integration) you created as the first part of the process. 2. Add the condition which checks the email address is provided and correct: 1. From the **Add condition** dropdown list, select the **body.email**. 2. As the logical operator, select **Contains**. 3. In the text field, enter `@` 4. Confirm by clicking **Apply**.
Business Event node configuration
Business Event node configuration
### Define the Outgoing Integration node In this step, you’ll make an API call to create or update a Synerise profile using just the provided email address—no tracking needed. Call the endpoint that handles creating or updating user profiles in Synerise. 5. From the dropdown list, select the **Outgoing Integration** node. 6. Click the node. In the configuration of the node: 1. Select the **Custom webhook**. 2. Enter the name of the webhook. 3. Choose webhook connection type - select **By API key**.
You can read more about API keys [here](/docs/settings/tool/api) and you can find more information about the endpoint and required API key permissions [here](https://hub.synerise.com/api-reference/profile-management#operation/CreateAClientInCrm).
1. In the **Webhook name** field, enter the value that will be displayed in the `name` parameter of the event which will contain the request response. 2. Optionally, in the **Event name** field, choose an action name for the event that contains the request response from the endpoint. If you leave the field blank, the action defaults to `webhook.response`. 3. Select the **POST** method. 3. In the URL address, enter `https://api.synerise.com/v4/clients/batch`. Read more about the [Batch add ord update clients method](https://hub.synerise.com/api-reference/data-management#tag/Profile-management/operation/BatchAddOrUpdateClients) 4. Enter the following headers: - set the `Content-Type` header to `application/json` (default), - set the `Api-Version` header to `4.4` 5. Enter the request body. For the scenario described in this use case, the body is as follows:
[
       {
            "email": "{{ request.body.email }}",
            "agreements": {
               "email": {{ request.body.newsletterAgreement }}
            }
            }
       ]
This is just an example, you can create JSON according to your business needs.

6. Confirm by clicking **Apply**.
This operation is safe to repeat — if the profile exists (matched by email or ID), it will be updated; if not, a new one will be created.
### Add final setting to your workflow --- 1. Add the **End** node. 2. Launch the workflow by clicking **Save & Run**.
Final view of the workflow configuration
Final view of the workflow configuration
**Process logic:** - For users who did not give consent to tracking – use the webhook + automation method described above. - For users who gave tracking consent – submit form data as per usual. For implementation details of form tracking, see the [documentation](/developers/web/tracking-form-data).
Learn more about the process from the [Do Not Track documentation](/developers/web/do-not-track). ## Generated events This use case generates approximately 6 events per profile that completes the flow: `incoming webhook event` (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`webhook.response`](/docs/assets/events/event-reference/integration#webhookresponse-and-custom-webhook-response-names) (~1), [`client.add`](/docs/assets/events/event-reference/profiles#clientadd) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Business Event node](/docs/automation/triggers/businees-event-trigger) - [Do Not Track documentation](/developers/web/do-not-track) - [Incoming integration](/docs/automation/integration/incoming-webhook-node) - [Outgoing Integration](/docs/automation/actions/webhook-node) - [Outgoing integration node](/docs/automation/actions/webhook-node) # Extra loyalty points for buying a product from a specific brand Loyalty programs have emerged as a crucial factor in determining the success and performance of companies across various industries. These programs provide a means for businesses to establish and nurture stronger connections and relationships with customers. By offering incentives and rewards to loyal customers, companies can effectively encourage repeat purchases and foster a sense of loyalty and affinity towards their brand. This use case demonstrates a specific loyalty activity in which customers receive 100 loyalty points for each product bought from specific brand within a certain time period. This strategy effectively stimulates sales of the brand's products while fostering customer loyalty by encouraging additional purchases and the accumulation of loyalty points. ## Prerequisites --- - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). - Implement basic [loyalty program](/use-cases/loyalty-programs-basics) based on which you granted customers with 1 point for every 1 PLN spent. ## Security configuration --- Before you start working with this hub, if you are a Synerise customer or partner, consider reading [the section about denylisting events](/docs/settings/tool/api#denylist). This natively accessible configuration will allow you to manage the restrictions in points management that may help you prevent fraud. ## Create a workflow --- Create a workflow that awards 100 loyalty points for each product bought from a specific brand. ### Define the Profile Event trigger node Configure the conditions that launch the workflow. As a trigger, we will use the `product.buy` event. 1. As the first node of the workflow, add **Profile Event**. 2. From **Choose event** dropdown menu, choose the `product.buy` event. 3. Click the **+ where** button and from the dropdown list, choose **brand**. 4. From the **Choose operator** dropdown, select **Equal**. 5. In the text field, type the name of the brand. In our case it will be `XYZ`. 6. Click the **+ where** button and from the dropdown list, choose **TIMESTAMP**. 7. From the **Choose operator** dropdown, choose **Custom (Date)**. 8. Click **Select date range**. 9. Set the time range in which your promotion is active. In this use case, it will be one week. 6. Confirm by clicking **Apply**.
Profile
Profile Event trigger node
### Configure the Generate Event node In this part of the process, you will create a node which generates a `points.loyalty` event which adds extra loyalty points. This event is created in addition to the regular `points.loyalty` event. In result, the customer receives points for a purchase from specified brand twice: - Points based on the [loyalty points schema](/use-cases/loyalty-programs-basics#prepare-the-points-schema) described as a part of prerequisites. - Extra points through this workflow. The body of the additional event will contain the `points` parameter calculated by multiplying the `$quantity` parameter from the `product.buy` event by the constant value of `100`. 1. As the second node of the workflow, add **Generate Event**. 2. In the **Event name** field, enter `points.loyalty`. 4. In the **Body** section, define the parameters of this event, and click **Apply**. **Example content of **Body** section:**
{
     "points": "{{ event.params['$quantity']*100}}",
     "promo": "BrandPromo"
   }
The event body is an example. You can add more parameters or change the point calculation, perform any mathematical formula according to your business needs.
Generate Event node configuration
Generate Event node configuration
### Add the End node 1. On the **Generate Event** node, click the plus icon. 2. From the dropdown list, select **End**. 3. In the upper right corner, click **Save & Run**.
Automation Hub workflow for awarding loyalty points for brand-specific product purchases
The final configuration of the workflow
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of the [workflow](https://app.synerise.com/automations/automation-diagram/edbdd32f-34d7-4b1d-a7ba-8c0890ce687f) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 5 events per profile that completes the flow: [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`points.loyalty`](/docs/assets/events/event-reference/loyalty#pointsloyalty) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Jinjava inserts](/developers/inserts) - [Loyalty programs basics](/use-cases/loyalty-programs-basics) # Creating event parameters out of event expressions In the realm of marketing automation, Synerise stands out as a platform that empowers users with advanced capabilities, allowing for dynamic and efficient campaign management. One notable feature that enhances the flexibility of Synerise is its support for **multi-parameter expressions.** This functionality becomes particularly valuable in scenarios where obtaining multiple pieces of information from a single aggregate operation is crucial. Consider a use case in which a marketing campaign revolves around a price drop strategy. The challenge in this use case is combining both the SKU (Stock Keeping Unit) and corresponding price from a [`page.visit` event](/docs/assets/events/event-reference/web-and-app#pagevisit) within a single analysis in Synerise. Synerise [aggregates](/docs/crm/aggregates) let you produce results concerning one particular parameter at a time. This means that obtaining a combination of SKU and price information would require creating two separate aggregates - one for SKU and another for price. However, using expressions enables you to analyze more than one parameter of a selected event. You can then use the result of this expression as a special parameter of that event in other types of analyses. This approach simplifies the implementation of a price drop strategy. In this use case, we will create an event expression that combines SKU of a product and its price into one string from a page visit event. Later on, we will create an aggregate that returns SKUs and prices of 10 last visited products and the aggregate will reuse the event expression created in the first part of the process. ## Prerequisites --- - Implement [tracking code](/developers/web/installation-and-configuration#creating-a-tracking-code) on your website with [OG:tags](/developers/web/og-tags). - Implement [product feed](/developers/product-feed). - Implement [product catalog](/docs/assets/catalogs). - [Implement transaction events](/developers/web/transactions-sdk). - [Implement tracking cart status](/developers/web/cart). ## Process --- In this use case, you will go through the following steps: 1. [Prepare an expression](/use-cases/multi-params-expression#prepare-an-expression) that retrieves the values of `product:retailer_part_no` and `product:price` parameters from a page visit event and joins them by separating it with semicolon (`;`). 2. [Prepare an aggregate](/use-cases/multi-params-expression#prepare-an-aggregate) that returns SKUs of 10 last visited items with their prices. ### Prepare an expression --- In this part of the process, create an expression that will retrieve values of the SKU (Stock Keeping Unit) and the corresponding price from a `page.visit` event and join them in one string which is separated by semicolon (`;`). 1. Go to **Behavioral Data Hub > Expressions > New expression**. 2. Enter a meaningful name of the expression. 3. Set the **Expression for** option to **Event**. 4. From the **Choose event** dropdown list, select **page.visit** event. 4. In the **Formula definition** section of the page, click **Select**. **Result**: A dropdown list appears. 6. From the dropdown list, select **Function**, and form the list select **Concat**. This function joins two or more strings together and returns the joint string as the result. 5. Click the first **Select** element that appeared. From the dropdown list, select **Function**, and form the list select **Concat**. 5. Click the left **Select** element. From the dropdown list, select **Event attribute**. 9. Open the settings of the event attribute by clicking the **unnamed** expression element that appeared. 10. From the **Choose parameter** dropdown, select `product:retailer_part_no`. 15. Click the middle **Select** element, from the dropdown list select **Constant** and set its value to `;`. 16. Click the right **Select** element, and from the dropdown list, select **Event attribute**. 9. Open the settings of the event attribute by clicking the **unnamed** expression element that appeared. 10. From the **Choose parameter** dropdown, select `product:price`. 10. From the **Choose parameter** dropdown, select `product:price`.
The view of the configuration of the expression
Configuration of the expression
. 16. Save the expression. ### Prepare an aggregate --- In this part of the process, create an aggregate that returns SKUs and prices of 10 last visited items. In this aggregate, the expression from the previous part of the process will be used. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last Multi** and as the size, set `10`. 4. Click **Choose event** and from the dropdown list, select **page.visit**. 5. From the **Choose parameter** dropdown list, select the [expression created in the previous step](/use-cases/multi-params-expression#prepare-an-expression). 5. Click **+ where**. 6. From the **Choose parameter** dropdown list, select **product:retailer_part_no** 7. From the **Choose operator** dropdown list, as the value, select **Is true (Boolean)**. 8. Set the analyzed period to **Lifetime**.
Decision Hub Last Multi aggregate returning the last 10 page.visit events using a combined SKU and price expression parameter over a customer's lifetime
Configuration of the aggregate
9. Click **Save**. **Result**:
Decision Hub aggregate result showing SKU and price pairs for the last 10 visited products
Configuration of the aggregate
## What's next --- As a next step, you can use this solution in many use cases in which you can simplify multiple operations by creating an event expression and use it in the parts of the process where it is necessary. This will make the process of gathering data easier. A one example in which you can use this solution to make it easier might be [price drop](/use-cases/price-drop-alert). ## Check the use case set up on the Synerise Demo workspace --- Check the prepared [expression](https://app.synerise.com/analytics/expressions/a9434d9b-f465-45b0-851c-a81586e52e7a) and [aggregate](https://app.synerise.com/analytics/aggregates/f53dfb1a-71ea-34b1-ac47-8a8081f367dd) directly in the Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case does not generate any events. ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Expressions](/docs/crm/expressions) - [Functions in expressions](/docs/crm/expressions/functions-in-expressions) # Import Custom Events from CSV Files You can use the Synerise Imports feature to import custom events of your customers. You can upload any custom events to Synerise, such as cart status, adding product to wishlist or any offline events. Example of offline event can be contact with customer support call center. Import events that signify customer's contact with your call center, in order to have them historically assigned to customers and include them in your marketing efforts. Once imported, our platform empowers you to gain valuable insights from these custom events, enabling data-driven decision-making and personalized customer experiences. In this use case, you will import custom event data (`support.contact`) of customers who contacted your customer support. You will use a `.csv` file with these data and you will import them with the Simple Import feature. ## Prerequisites --- Add [custom event](https://hub.synerise.com/api-reference/data-management#operation/CustomEvent) and its [parameters](/docs/assets/events/adding-event-parameters) to save data to customers' profiles when they perform an activity. In this particular use case: - `support.contact`. ## Process --- In this use case, you will go through the following steps: 1. [Create a `.csv` file](#create-a-csv-file) with data about custom event to import to Synerise. You can use our example file, which can be downloaded using the **Get Sample File** button while uploading the file. The sample file shows the recommended column names and the recommended formatting of the values in those columns. 2. [Import the file](#import-the-file). ## Create a .csv file --- In this part of the process, prepare a `.csv` file that contains one of the following profile identifiers: (the list contains recommended column names, if you use different names you will be able to map data during the process): - `email`, - `uuid`, - `clientID`, - or `customID`. This is a required column, the rest is optional, should contain the custom event's parameters.
If you choose an email as an identifier, pay attention to the correct format of emails. Otherwise, your import will fail.
`.csv` files must be UTF-8 encoded, spaces, and special characters in the column headers are not allowed. Check [tips for preparing a CSV file]. **Example CSV file might look like this:** ```csv email,contactPurpose,duration,resolved johndoe@example.com,complaint,200s,true jnowak@example.com,ordercancellation,320s,false jperez@example.com,complaint,150s,false ``` ## Import the file --- In this part of the process, you will upload a file from your device. 1. Go to **Data Modeling Hub > Imports> New import**. 2. As the data type for import, select **Custom events**. ### Select the file for import --- 1. As the import method, to import a single `.csv` file to Synerise, select **Import a local file**. 4. To upload the `.csv` file you [created in the previous step](#create-a-csv-file), click **+ Upload file or drag one here field**. 5. Optionally, you can customize the file metacharacters by clicking the arrow down icon next to **Customize file markup**. 1. From the **Delimiter** dropdown, select the character that marks the end of a column. 2. From the **Quotation mark** dropdown list, select the characters that contain the text. 3. From the **Escape character** dropdown lists, select the character which changes the default interpretation of a character or a string followed by the escape character. 6. You can preview the data output by clicking **Preview data**. 7. Click the **Next** button to upload the file. 8. When the file is uploaded click **Next** to proceed.
The view of the Import Events configuration
Import Events configuration
### Select the target event --- In this part of the process, you will select the event which you want to import. Thanks to that, during the mapping process the system will prompt the parameters for mapping based on the event type.
You can import one type of event at a time.
1. Click **Select target event** and from the dropdown list, select `support.contact`. 2. Click **Next**.
The view of the Target event configuration
Target event configuration
### Mapping the columns with parameters in Synerise --- In this part, you will map parameters based on the event type [selected in the previous step](#select-the-target-event). You can exclude parameters from the import. On the user interface, you will be presented with two columns - the left column displays the names of the columns from the imported file, the other contains dropdown lists with the parameters available in Synerise. The dropdown lists indicate the required parameters for a an import. If you skip mapping the non-required parameters, the name of these parameters will be the same as the names from the imported file. If parameters don't exist in Synerise, they will be imported as new parameters. 1. Next to the file column name, from the dropdown list, select the corresponding parameter in Synerise. Perform this step for all columns in your file. 2. To exclude a parameter from import, next to the column name, click this icon: Exclude paramater icon
The view of the mapping process
Mapping
3. To proceed to the summary of the import, click **Next**. **Result:** The summary of the import is displayed.
The view of the Import summary
Import summary/figcaption>
4. After checking the import summary, to start the import, click **Run import**. 5. You can monitor the status of your import and potential errors due to incorrect data in the **Imports List**. ## Generated events This use case generates 1 event per profile that completes the flow: `support.contact` (~1). ## Read more --- - [Custom events](https://hub.synerise.com/api-reference/data-management#operation/CustomEvent) - [Imports](/docs/assets/imports/introduction-to-imports) # Loyalty program points balance reminder in in-app message Loyalty programs are an important part of any business as they help companies build strong relationships with their customers. Every brand knows that the key to building a successful brand is building long-lasting relationships with customers. The strategies used by companies may vary, but most are based on earn&burn programs. This program is quite popular with both customers and companies, although it can sometimes lead to unforeseen consequences for the business. The most common problem companies face is that customers are not spending their loyalty points. This raises the need to encourage customers to unlock this unredeemed value. To do this, you can remind customers when their points expire to encourage them to "burn" their points, while personalizing this message to the individual customer. This use case describes the process of creating a reminder to customers about the balance of loyalty points they have in their account and the time left until points expire using an in-app message. The created in-app will be displayed on the trigger of adding the product to the shopping cart once a day. This is an effective form of communication with customers that allows for additional outreach in the mobile channel. In this case, we assume that the redemption of points takes place on a specific day each year. In this use case, we provide you with ready-to-use campaign code that you can use 1:1 in your business scenario.
In-app message example
## Prerequisites --- - [Implement Synerise SDK in your mobile app](/developers/mobile-sdk). - [Integrate mechanism for awarding loyalty points](/use-cases/loyalty-programs-basics). For example, you can award loyalty points after a transaction. In such case, create an [expression that counts how many loyalty points](/docs/crm/expressions/loyalty-point-count) are assigned to a customer for a transaction. Once you prepare the expression, please contact [Support Team](https://synerise.com/support) to configure materialization of loyalty points. After such configuration, every time loyalty points are assigned to a customer, the `points.loyalty` event will be generated in a customer’s profile with information about the number of loyalty points they received after a transaction (the `points` parameter).
Learn more about events [here](/docs/assets/events/event-definitions).
- Collect the [custom event](/developers/mobile-sdk/event-tracking) which sends information to Synerise about joining a loyalty program (for example `account.status` with parameter `accountStatus` equal to `active`). Such an event with the appropriate status should be sent each time the membership status changes (when the customer resigns from the program or joins again). - [Implement point expiration logic](https://www.synerise.com/blog/manage-the-expiration-of-points-in-your-loyalty-program-with-synerise) - Collect [add to cart event](/docs/assets/events/event-definitions). ## Security configuration --- Before you start working with this hub, if you are a Synerise customer or partner, consider reading [the section about denylisting events](/docs/settings/tool/api#denylist). This natively accessible configuration will allow you to manage the restrictions in points management that may help you prevent fraud. ## Process --- 1. [Create an aggregate](/use-cases/in-app-point-balance-reminder#create-an-aggregate) that returns the sum of loyalty points for an individual customer 2. [Create an expression with points balance](/use-cases/in-app-point-balance-reminder#create-an-expression-with-points-balance) 3. [Current status of the membership](/use-cases/in-app-point-balance-reminder#current-status-of-the-membership) 4. [Create an In-app message](/use-cases/in-app-point-balance-reminder#create-an-in-app-message) ## Create an aggregate --- Create an aggregate that returns the sum of loyalty points for an individual customer. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter a meaningful name of the aggregate. 3. Click **Analyze profiles by** and select **Sum**. 4. Click the **Choose event** dropdown list. 5. From the dropdown list, select the `points.loyalty` event. 6. From the **+ where** dropdown list, select `points` parameter. 7. Using the date picker in the lower-right corner, set the time range to **Lifetime**. 8. Save the aggregate.
The aggregate that sums points from the points.loyalty event
The aggregate that sums points from the points.loyalty event
## Create an expression with points balance --- In this part of the process, create an [expression](/docs/crm/expressions) which will be used to calculate points balance for the customer. In our case, the expression is built based on the `points.loyalty` event that is sent every time the customer is awarded with loyalty points.
The described expression configuration is just an example. You can define additional conditions according to your business specifications and requirements. Such additional conditions can be, for example, taking into account points burned or considering points added additionally for completing some other extra activity. It all depends on how your loyalty program is implemented. For more advanced scenarios with loyalty points, check out [this use case](/use-cases/loyalty-points-transfer-with-push) describing the process of configuring the transfer of loyalty points between customers.
1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. Enter a meaningful name of the expression. 3. Leave the expression type at default (**Attribute**). 4. Build the formula of the expression. 1. Click the **Select** node. 2. From the dropdown list, select **Profile**. 3. Click the **unnamed** node that appeared on the canvas. 4. Scroll down the page and click **Choose attribute**. 5. On the dropdown list select the aggegate for `points.loyalty` that you created [earlier](/use-cases/in-app-point-balance-reminder#create-an-aggregate). 6. Save the expression.
Behavioral Data Hub expression formula returning the points.loyalty aggregate value from a customer profile
The configuration of the expression
## Current status of the membership --- Create an aggregate that analyzes a customer's current membership status. This aggregate will later be used in in-app messaging to define customers who are active participants in the loyalty program. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last**. 4. From the **Choose event** dropdown list, select the **account.status** event. 5. As the event parameter, choose **accountStatus**. 6. Using the date picker in the lower-right corner, set the time range to **Lifetime**. 7. To save the aggregate, click **Save**.
Decision Hub Last aggregate returning the last accountStatus parameter of account.status events in a customer's lifetime
Configuration of the aggregate
## Create an in-app message --- In this part of the process, configure an in-app campaign that displays the appropriate message to the user on the mobile app. 1. Go to **Experience Hub > In-app messages > Create in app**. 2. In the **Audience** section, click **Define**. 3. In the **New Audience** section, click **Define conditions**. In this step, you define the group of customers who are currently active members of the loyalty program. 4. Choose **Add condition** and find the [aggregate analyzing the status of the customer's membership](/use-cases/in-app-point-balance-reminder#current-status-of-the-membership), created earlier in the process. 5. As an operator, choose **Equal** and add the value `active`. 6. Click **Apply** to save the aggregate.
The audience settings
The audience settings
7. In the **Content** section, click **Define**. 8. Click **Create Message** and select **Code Editor** to create the code for your in-app message. 9. Style the message according to your design preferences using HTML, CSS and JS sections. Below you can find sample code that you can use to create an in-app message.
The CSS and JS code snippets shown below can be directly copied into your in-app campaign. In the HTML code snippet, you need to replace the expression ID with the expression you created for your campaign.
HTML
<div class="in-app-wrapper"> <div class="in-app-wrapper-inner"> <div class="in-app__upper"> <div class="in-app-close"></div> <p class="in-app-title"> Hello {% customer firstname %}</p> <p class="in-app__upper--text">Your current loyalty <br> points balance is <br><strong>{% expression %} 2d4c0862-31ac-43c7-a991-97a1e5455e8a {% endexpression %} points.</strong></p> </div> <div class="in-app__lower"> <p class="in-app__lower--text changeDate"></p> <p class="in-app__lower--text">Enjoy your shopping!</p> </div> </div> </div>
CSS
.in-app-wrapper * { font-family: sans-serif; } .in-app-wrapper { text-align: center; position: relative; background: #00000045; box-shadow: 0 30px 80px 0 rgba(35, 41, 54, 0.2); width: auto; height: 100vh; display: flex; flex-direction: column; flex-wrap: nowrap; align-content: center; justify-content: center; align-items: center; } .in-app-title { font-size: 20px; font-weight: normal; font-stretch: normal; font-style: normal; line-height: 1.5; letter-spacing: -0.67px; text-align: center; color: white; margin: 0; padding-top: 20px; } .in-app-subtitle { font-size: 16px; font-weight: normal; font-stretch: normal; font-style: normal; line-height: 1.43; letter-spacing: -0.47px; text-align: center; color: #13171e; } .in-app-close { position: absolute; z-index: 1; width: 50px; height: 50px; border: 0; top: 10px; right: 10px; cursor: pointer; background-color: transparent; } .in-app-close:after, .in-app-close:before { content: ''; position: absolute; height: 2px; width: 50%; top: 50%; left: 12px; margin-top: -1px; background: white; } .in-app-close:after { -webkit-transform: rotate(-45deg); -moz-transform: rotate(-45deg); -ms-transform: rotate(-45deg); -o-transform: rotate(-45deg); transform: rotate(-45deg); height: 2px; margin-top: -2px; } .in-app-close:before { -webkit-transform: rotate(45deg); -moz-transform: rotate(45deg); -ms-transform: rotate(45deg); -o-transform: rotate(45deg); transform: rotate(45deg); height: 2px; margin-top: -2px; } .in-app-wrapper-inner { background: #fff; border-radius: 6px; position: relative; border-radius: 20px; margin-left: 20px; margin-right: 20px; height: 300px; width: -webkit-fill-available } .in-app__upper { background-color: #0b68ff; border-radius: 4% 4% 50% 50% / 4% 4% 10% 10%; height: 170px; } .in-app__lower { height: 200px; } .in-app__upper--text { font-size: 20px; color: white; word-spacing: 2px; } .in-app__lower--text { font-size: 17px; color: black; word-spacing: 2px; }
JS
(function () { var closeButton = document.querySelector(".in-app-close"); closeButton.addEventListener("click", function () { SRInApp.close(); SRInApp.trackCustomEvent( "inapp.custom", { action: "close", }, "Custom event from In-App message" ); }); var modalBackground = document.querySelector(".in-app-wrapper"); modalBackground.addEventListener("click", function (event) { if (event.target.getAttribute("class") == "in-app-wrapper") { SRInApp.close(); SRInApp.trackCustomEvent( "inapp.custom", { action: "click outside modal", }, "Custom event from In-App message" ); } }); var oneDay = 24 * 60 * 60 * 1000; var firstDate = new Date(); var endOfYear = new Date(2022, 12, 31); var diffDays = Math.round(Math.abs((firstDate - endOfYear) / oneDay)); var insertDate = document.querySelector(".changeDate"); if (diffDays > 30) { insertDate.innerHTML = "You still have <strong>" + diffDays + " days</strong> to <br> use your points before <br> they expire."; } else { insertDate.innerHTML = "You have only <strong>" + diffDays + " days</strong> to <br> use your points before <br> they expire!"; } })();
10. Click **Next**. 11. Confirm by clicking **Apply**. 12. In the **Trigger events** section, click **Define**. 13. Select **Add event** and find the **product.addToCart** event the mobile application generates. 14. From the **Parameter** dropdown list select **sku**. 15. From the **Choose operator** dropdown list, select **Regular expression**. 16. As the value, enter `.` 12. Confirm by clicking **Apply**.
The trigger events settings
The audience settings
13. In the **Schedule** section, click **Define** and set the time when the campaign will be active. 14. In the **Display Settings** section, click **Change**. 15. Define the **Priority index** and enable the **Frequency limit** toggle to manage the frequency of in-app message display in the application. In our case, we want to display the massage to the customer a maximum of 1 time in period of 1 day.
You can additionaly enable the **Capping limit** toggle to limit the amount of time the in-app message can be displayed to user in general.
The display settings
The audience settings
16. Confirm by clicking **Apply**. 17. Optionally, you can define the **UTM parameters** and **Additional parameters** for your in-app campaign. 18. Activate the campaign. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of each step directly in the Synerise Demo workspace: - [Aggregate](https://app.synerise.com/analytics/aggregates/174ba14c-b0d7-372d-acb2-8f1365af3083) - [Expression with the points balance](https://app.synerise.com/analytics/expressions/2d4c0862-31ac-43c7-a991-97a1e5455e8a) - [Aggregate with the current status of the membership](https://app.synerise.com/analytics/aggregates/4538a92b-b5e7-338e-a7f0-a4c690b63272) - [In-app message configuration](https://app.synerise.com/communications/in-app/3e9721c6-ff3b-4124-9fe6-fb8799ca5a02) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 4 events per profile that completes the flow: [`product.addToCart`](/docs/assets/events/event-reference/items#productaddtocart) (~1), [`inApp.show`](/docs/assets/events/event-reference/inapp#inappshow) (~1), [`inApp.click`](/docs/assets/events/event-reference/inapp#inappclick) (~1), `inapp.custom` (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Expressions](/docs/crm/expressions) - [In-app messages](/docs/campaign/in-app-messages) - [Loyalty points transfer between customers](/use-cases/loyalty-points-transfer-with-push) # Transfer loyalty points between customers This section introduces the concept of using rewards and loyalty points to foster customer loyalty and attract new clients to your product or service. By allowing customers to transfer loyalty points, your mobile application becomes more user-friendly and can also serve as a tool for customer acquisition. The provided use case will help you integrate a loyalty point transfer mechanism into your mobile app. This will enrich the user experience by adding mobile push notifications for the recipients of these points. The goal is to enhance customer engagement and satisfaction, ultimately contributing to the growth of your business. ## Prerequisites --- - Integrate mechanism for awarding loyalty points. **For example**, you can award loyalty points after transaction. In such case, create an [expression that counts how many loyalty points](/docs/crm/expressions/loyalty-point-count) are assigned to a customer for a transaction. Once you prepare the expression, please contact [Support Team](https://synerise.com/support) to configure materialization of loyalty points. After such configuration, every time loyalty points are assigned to a customer, the `points.loyalty` event will be generated in a customer’s profile with information about the number of loyalty points they received after a transaction (the `points` parameter).
Learn more about events [here](/docs/assets/events/event-definitions).
- Implement mobile pushes in your mobile application: [iOS](/developers/mobile-sdk/configuring-push-notifications/ios), [Android](/developers/mobile-sdk/configuring-push-notifications/android). ## Security configuration --- Before you start working with this hub, if you are a Synerise customer or partner, consider reading [the section about denylisting events](/docs/settings/tool/api#denylist). This natively accessible configuration will allow you to manage the restrictions in points management that may help you prevent fraud. ## Process --- In this use case, you will go through the following steps: 1. [Configure loyalty points transfer](/use-cases/loyalty-points-transfer-with-push#configure-loyalty-points-transfer). 1. [Define segmentations of senders](/use-cases/loyalty-points-transfer-with-push#define-segmentations-of-senders) to group customers who are allowed to make a transfer. 2. [Define segmentations of recipients](/use-cases/loyalty-points-transfer-with-push#define-segmentations-of-recipients) to group customers who are allowed to receive a transfer. 3. [Define an expression with points balance](/use-cases/loyalty-points-transfer-with-push#define-an-expression-with-points-balance) to calculate how many loyalty points the customer currently owns. 4. [Complete configuration](/use-cases/loyalty-points-transfer-with-push#complete-configuration). 2. [Implement loyalty points transfer module in the mobile app](/use-cases/loyalty-points-transfer-with-push#implement-loyalty-points-transfer-module-in-the-mobile-app). 3. [Create a mobile push template](/use-cases/loyalty-points-transfer-with-push#create-a-mobile-push-template). 4. [Create a workflow](/use-cases/loyalty-points-transfer-with-push#create-a-workflow). ## Configure loyalty points transfer --- ### Define segmentations of senders In this part of the process, create a segmentation or segmentations of people who can transfer loyalty points. In our case, we select people who made at least one transaction. 1. Go to Behavioral Data Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of segmentation. 3. From the **Add condition** dropdown list, select the **transaction.charge** event. 4. Using the date picker in the lower-right corner, set the time range to **Lifetime**. 5. Confirm the settings by clicking **Save**.
The conditions used in the segmentation may vary depending on your business needs and loyalty program assumptions.
An example of a customer segmentation of senders
An example of a customer segmentation of senders
### Define segmentations of recipients In this process, create a segmentation or segmentations of people who can receive loyalty points from other customers. In our case, we select people who received less than 2 transfers during last 24 hours. 1. Go to Behavioral Data Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of segmentation. 3. From the **Add condition** dropdown list, select the **points.received** event. 4. Click **and then**. 5. From the **Add condition** dropdown list, select the **points.received** event once again. 6. Using the date picker in the lower-right corner, set the time range to **Last 24 hours**. 7. Change the **Contacts matching funnel** expression to **Contacts not matching funnel** by clicking the **matching** word.
The conditions used in the segmentation may vary depending on your business needs and loyalty program assumptions.
An example of a customer segmentation of recipients
An example of a customer segmentation of recipients
### Define an expression with points balance In this part of the process, create an [expression](/docs/crm/expressions) which will be used to calculate points balance for the customer. First, we will create the aggregates based on the following events: - `points.loyalty` (event that is sent every time the customer is awarded with loyalty points), - `points.received` (it is sent when a customer receives points from someone), - `points.sent` (it is sent when the customer sends points to someone). Based on the aggregates, we will create the expression that calculates the loyalty points for every customer. 1. Define 3 aggregates that sum points from the events mentioned above. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter a meaningful name of the aggregate. 3. Set the **Analyze profiles by** option to **Sum**. 4. Click the **Choose event** dropdown list. 5. From the dropdown list, select the `points.loyalty` event. 6. From the second dropdown list, select `points` parameter. 7. Using the date picker in the lower-right corner, set the time range to **Lifetime**.
The aggregate that sums points from event points.loyalty
The aggregate that sums points from event points.loyalty
8. Save the aggregate. 9. Repeat steps 1-8 for `points.received` and `points.sent` event. 2. Create an expression using the aggregates created in step 1. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. Enter a meaningful name of the expression. 3. Leave the expression type at default (**Attribute**). 4. Build the formula of the expression. 1. Click the **Select** node. 2. From the dropdown list, select **Profile**. 3. Click the **unnamed** node that appeared on the canvas. 4. Scroll down the page and click **Choose attribute**. 5. On the dropdown list select the aggegate for `points.loyalty` that you created in step 1. 6. Next to the aggregate added to the canvas, click the plus button. 7. Repeat steps from 1 to 6 for the aggregates with `points.received` and `points.sent`. 8. Click the mathematical operator between **points.loyalty** and **points.received** node and select the brackets icon. 7. Click the mathematical operator between **points.received** and **points.sent** node and select the subtraction icon.
Behavioral Data Hub expression formula combining points.loyalty, points.received, and points.sent aggregates for point transfer calculation
The configuration of the expression
5. Save the expression. ### Complete configuration In this part of the process, you must complete the points transfer settings by executing [configuration method](https://hub.synerise.com/api-reference/loyalty-and-engagement#operation/endpointSettingsUpdateSettingsPUT). To define `transferSettings`, use analysis created in the following steps: - [Define segmentations of senders](/use-cases/loyalty-points-transfer-with-push#define-segmentations-of-senders), - [Define segmentations of recipients](/use-cases/loyalty-points-transfer-with-push#define-segmentations-of-recipients) and - [Create an expression that calculates loyalty points](/use-cases/loyalty-points-transfer-with-push#define-an-expression-with-points-balance). In order to execute request, you can use Postman or similar tool. ## Implement loyalty points transfer module in the mobile app --- In this part of the process, implement the loyalty points module in your mobile app that enables a user to transfer their points. Use the [points transfer method](https://hub.synerise.com/api-reference/loyalty-and-engagement#operation/PointsTransfer) when the transfer is sent. This method automatically generates the `points.received` event on the profile of customer who received points and the `points.sent` event on the profile of customer who sent points. ## Create a mobile push template --- In this part of the process, create a mobile push template that will be used later in a [workflow](/use-cases/loyalty-points-transfer-with-push#create-a-workflow). It should inform a mobile app user that they just received points transfer from someone. 1. Go to **Experience Hub > Mobile Push > Templates**. 2. You can use the template from the folder or create your own one using the mobile push code editor. Click **New Template > Simple Push**. 3. Create your mobile push in the code editor. For more information on creating a simple mobile push, visit our [User Guide](/docs/campaign/Mobile/creating-mobile-push).
Example of a mobile push notification
Example of a mobile push notification
## Create a workflow --- In this part of the process, prepare a workflow that will be triggered by receiving points transfer from someone and will send push notification for the customer who received them. 1. Go to **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. 3. As the first node of the workflow, add **Profile Event**. In the node settings: 1. From the **Choose event** dropdown menu, select `points.received` event. 2. Confirm by clicking **Apply**. 4. As the next node, add **Send Mobile Push**. In the configuration of the node: 1. From the **Template type** dropdown list, select **Simple Push**. 2. Select the **Push template** created in [this step](/use-cases/loyalty-points-transfer-with-push#create-a-mobile-push-template) of the process. 3. Confirm by clicking **Apply**. 7. Add the **End** node to finish the workflow. 8. Click **Save & Run**.
Final configuration of a workflow that is triggered by receiving points transfer from someone and sends push notification for the customer
Final configuration of a workflow that is triggered by receiving points transfer from someone and sends push notification for the customer
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of use case in Synerise Demo workspace: - [Segmentation of senders](https://app.synerise.com/analytics-v2/segmentations/4275cb6c-39f6-42ad-838c-ba400ae4140e) - [Segmentation of recipients](https://app.synerise.com/analytics-v2/segmentations/389c90a2-d7b8-439c-90a3-4b58f712102c) - [Aggregate1](https://app.synerise.com/analytics/aggregates/7f6e7c7e-ea20-3227-89b6-0241ab18cff7) - [Aggregate2](https://app.synerise.com/analytics/aggregates/595910c2-9a94-341e-97dd-0b90b585b2ec) - [Aggregate 3](https://app.synerise.com/analytics/aggregates/58e98322-6f5a-333a-ba3e-e1ef06b987b9) - [Expression](https://app.synerise.com/analytics/expressions/0efafdb2-57f4-4180-b993-8ba1b89679f1) - [Mobile push template](https://app.synerise.com/campaigns/mobile-push/content-manager/template/153968) - [Workflow](https://app.synerise.com/automations/workflows/automation-diagram/f20bfd4d-be5b-4587-9e20-c2ea1b597b13) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 8 events per profile that completes the flow: [`points.sent`](/docs/assets/events/event-reference/loyalty#pointssent) (~1), [`points.received`](/docs/assets/events/event-reference/loyalty#pointsreceived) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`push.send`](/docs/assets/events/event-reference/mobile-push#pushsend) (~1), [`push.view`](/docs/assets/events/event-reference/mobile-push#pushview) (~1), [`push.click`](/docs/assets/events/event-reference/mobile-push#pushclick) (~1). ## Read more --- - [Inserts](/developers/inserts/automation) - [Mobile campaigns](/docs/campaign/Mobile) - [Workflow](/docs/automation/creating-automation) # Send RFM score to Google Analytics You can power your Google Analytics data with information collected in Synerise. You can do it by sending an event to Google Analytics with the data extracted from Synerise such as the customer attributes, customer activities, results of analyses, predictions, and so on. In this particular use case, we use Automation Hub to send each visitor's result of an [RFM analysis](/use-cases/rfm-analysis) to Google Analytics. The workflow is triggered every week for visitors from the last 7 days and sends the RFM analysis results of each customer to Google Analytics as an `rfm.score` event. The event contains two parameters: - `score` contains numeric information about the customer's score, - `rfmSegmentName` contains the name of the RFM segment the customer belongs to. ## Prerequisites --- - Get the measurement ID associated with a stream in your Google Analytics panel. Navigate to **Admin > Data Streams > {stream name} > Measurement ID**. - Create an API secret in your Google Analytics panel. To create a new secret, navigate to **Admin > Data Streams > {stream name} > Measurement Protocol > Create**. - Implement [Synerise JS SDK](/developers/web/installation-and-configuration) on your website. - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). - [Enable saving Google Analytics ID in profiles](/docs/automation/integration/google-analytics/send-events-to-ga#getting-the-customer-id-from-google-analytics). - [Create an RFM analysis](/use-cases/rfm-analysis). - [Establish a connection between Synerise and Google Analytics](/docs/automation/integration/google-analytics/send-events-to-ga#create-a-connection). ## Process --- In this use case, you will go through the following steps: 1. [Create an expression that returns the name of the RFM segment a customer belongs to](/use-cases/google-analytics-integration#create-an-expression-that-returns-rfm-segment-name). 2. [Create a workflow that sends events to Google Analytics](#create-a-workflow). ## Create an expression that returns RFM segment name --- In this part of the process, you will create an expression that retrieves a segment name from an [RFM segmentation to which a customer belongs](/use-cases/rfm-analysis#create-a-rfm-segmentation). 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. Enter a meaningful name of the expression. 3. Leave the **Expression for** at default (**Attribute**). 4. Click the **Select** node. 5. From the dropdown list, select **Profile**. 6. Click the **unnamed** node. 7. On the bottom of the page, click **Choose attribute**. 8. From the dropdown list, select **Segmentations**. 9. Find [the RFM segmentation](/use-cases/rfm-analysis#create-a-rfm-segmentation) and select it.
The configuration of the expression that returns RFM segment name
The configuration of the expression that returns RFM segment name
10. Save the expression. ## Create a workflow --- Create a workflow that is triggered for the customers who visited your website during the last 7 days. The system will send an `rfm.score` event with the score a customer received in the RFM analysis and with the name of the segment they belong to. The RFM result will be saved in Google Analytics for each customer, using the customer's Google Analytics ID saved as a profile attribute in Synerise. This workflow will be triggered once a week, for the group of customers who were active on the website during the last 7 days. 1. In Synerise, go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the audience of the workflow The workflow is triggered for customers who visited a website during the last 7 days. Define the conditions in the following way: 3. As the first node, add **Audience**. In the configuration of the node: 1. Set the **Run trigger** option to **repeatable**. 2. Set the interval to 1 week. 3. In the **Begin at** field, select the first launch of the trigger. 4. From the **Timezone** dropdown list, select the time zone consistent with the time zone selected for your workspace. 5. In the **Define audience** section, click the **New audience** tab. 6. From the **Choose filter** dropdown list, select **page.visit**. 7. In the right bottom corner, set the date to **Last 7 days**. 4. Confirm by clicking **Apply**. ### Configure the Google Analytics node In this step, you will configure the settings of the Google Analytics integration in the **Send Event** node. This includes: - Selecting the connection (for authorization purposes) - Defining the customer identifier - you will use an insert that retrieves the value of the `cid` attribute that stores the Google Analytics ID - Defining the event and event parameters to be sent to Google Analytics You can find the detailed instructions for each action below.
If you want to learn more about **Send Event** node, click [here](/docs/automation/integration/google-analytics/send-events-to-ga).
4. On the **Audience** node, click **THEN**. 5. From the node list, select **Google Analytics > Send Event**. 6. In the configuration of the node: 1. Select the connection. If you haven’t established a connection yet, see [Create a connection](/docs/automation/integration/google-analytics/send-events-to-ga#create-a-connection). 2. In the **Customer ID** field, enter `{{ customer['cid'] }}` This way, you will retrieve the value of the `cid` attribute. 3. In the **Event name** field, enter `rfm.score` 4. In the **Event parameters** field, enter the parameters of the event in the form of the JSON object. The object uses the `{% expression %}` insert to refer to the value of the RFM-related expressions. For example:
{
           "score": "{% expression %} rfm-score-expression {% endexpression %}",
           "rfmSegmentName": "{% expression %} rfm-segment-name-expression {% endexpression %}"
       }
- Replace `rfm-score-expression` with the ID of [the expression that calculates the RFM score](/use-cases/rfm-analysis#create-an-expression). - Replace `rfm-segment-name-expression` with ID of the expression you created in [this part of the process](/use-cases/google-analytics-integration#create-an-expression-that-returns-rfm-segment-name). 7. Confirm by clicking **Apply**.
The configuration of the Send Event node
The configuration of the Send Event node
### Add the finishing node 8. On the **Send Event**, click **THEN**. 9. Add the **End** node.
Final configuration of workflow
Final configuration of the workflow
9. Activate the workflow by clicking **Save & Run**. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of: - [The expression that retrieves the name of the RFM segment](https://app.synerise.com/analytics/expressions/6b15f344-94b1-49c3-85f3-e375bae7af7d) - [The expression that calculates RFM](https://app.synerise.com/analytics/expressions/70716383-93cf-479c-99f0-15ad4c826472) - [The workflow that sends events to Google Analytics with RFM results](https://app.synerise.com/automations/automation-diagram/d2b5a05c-aaae-431b-88b5-e1f285a39e09) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 4 events per profile that completes the flow: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), `googleAnalytics.sendEvent` (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Dynamic content](/docs/campaign/dynamiccontent) - [Integration](/docs/automation/integration) - [Send Event node](/docs/automation/integration/google-analytics/send-events-to-ga) # Send Personalized Emails with Last Seen Product Recommendations Boost your sales and strengthen customer relationships by providing personalized product recommendations based on customers' browsing history. By suggesting last seen items, you can enhance the shopping experience and drive engagement with a simple email. This example explains **how to create a set of product recommendations with recently seen items for customers who have visited a page and have not made a purchase within the last 48 hours and send these recommendations through email.** In this use case, we will use a ready-made email template and show you how to use HTML block in this template to make the whole process of creation easier. Scenario described in this use case refers only to WEB integration. It's worth noting that in this use case, the aggregate returns recently viewed products, but it can also be any other interactions, such as recently added to the cart, recently purchased, and so on. This predefined HTML block will work well regardless of the logic of the aggregate. Thanks to the HTML block, you can benefit from both the drag-and-drop builder, which allows you to create a creative and personalized email layout from scratch. At the same time, it simplifies the process of enriching such an email with dynamic elements, such as ready-to-use product frames, which already have built-in logic for how and what should be displayed. All you need to configure here is the aggregate responsible for selecting products for the customer. Everything is designed so that you can fully customize the email and display products according to your business needs.
Last seen products in email message
## Prerequisites --- - Implement [Synerise tracking code](/developers/web/installation-and-configuration#creating-a-tracking-code) on your website. - Add [product Feed](/developers/product-feed). - Implement the [transaction events](/developers/web/transactions-sdk) using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). ## Process --- In this use case, you will go through the following steps: 1. [Create an aggregate](/use-cases/last-seen-html#create-an-aggregate) returning the ID of the last visited product, it will be used in the template configuration. 2. [Prepare an email template](/use-cases/last-seen-html#prepare-an-email-template) with the usage of the predefined template and predefined HTML block. 3. [Create an aggregate](/use-cases/last-seen-html#create-an-aggregate-1) which counts the number of products visited by customer. 3. [Prepare a workflow](/use-cases/last-seen-html#prepare-a-workflow) which sends an email to users. ## Create an aggregate --- In this part of the process, create an aggregate that returns the IDs of the last 3 product a customer has visited. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last Multi**. 4. Select the **Consider only distinct occurrences of the event parameter** radio button. 4. From the **Choose event** dropdown list, select the **Visited page** event. 5. As the event parameter, select **product:retailer_part_no**. 6. Click the **+ where** button. 7. From the **Choose parameter** dropdown list, select the **product:retailer_part_no** parameter. 8. From the **Choose operator** dropdown list, select **Is true (Boolean)**. 9. Using the date picker in the lower-right corner, set the time range to **Last 52 hours**. Confirm your choice with the **Apply** button. 7. Click **Save**.
Decision Hub Last Multi aggregate returning the distinct product IDs of the last 3 visited pages in the past 52 hours
Configuration of the aggregate returing the ID of the last seen product
## Prepare an email template --- In this part of the process, create an email template. You can use a predefined template or create your own template from scratch. In this case, we will use a predefined template. You will also use a specific HTML block which will let you configure the section with context recommendations in an easy way. In the configuration, we will use the [aggregate](#create-an-aggregate) created in the previous steps. 1. Go to Experience Hub icon **Experience Hub > Email**. 2. On the left pane, click **Templates** and from the list of template folders, select **Predefined simple templates**. 3. Select any template that mostly fits the campaign assumptions. **Result:** You are redirected to the code editor. 4. Edit the template according to your needs. ### Add the HTML block --- 1. From the **Content** section, click **HTML block** and add pull it to the chosen place in your template.
Email context preview
Email context preview
2. Click the **Configure** button. 3. Choose the **Predefined blocks** folder where you will find the list of all predefined templates. In this case choose **Recently interacted products 1**.
You can edit the template in two ways, by editing the code of the template in the **HTML** tab and/or by filling out the form in the Config tab. In this use case, we will use the capabilities of the predefined Config tab.
#### Edit the form in the Config tab --- The form in the **Config** tab is already filled in with default values. You can keep them or change them to fit your business needs. 1. In the **Aggregate ID with recently interacted products**, add the Aggregate that returns SKUs of recently interacted products. Use the [aggregate](#create-an-aggregate) created in the previous step. You can find it by typing its name or ID in the search box. 2. In the **Catalog name** add the name of the main catalog with your product feed.
If the catalog you're using has a custom structure, you'll need to change the attribute names in the code.
3. Change the **Mail width** or leave it at default values. 4. Change **Number of product in row** or leave it at default values (recommended amount is 3 or less). 5. Define the style settings if you need (**Product title font color**, **Button background color**, **Button font color** and **Button border radius**). 6. In the **Button text** field, enter the text that will be displayed on the button. 7. Optionally, you can add more options to your block using HTML tab. 8. After you make changes to the template, you can check the preview. 1. On the upper left side, click the **Preview Contexts** button. 2. Enter the ID of a customer and define the product context. 3. Click **Apply**. 7. If the template is ready, in the upper right corner, click the arrow next to **Next**, and from the dropdown select **Save as**. 8. On the pop-up: 1. In the **Template name field**, enter the name of the template. 2. From the **Template folder** dropdown list, select the folder where the template will be saved. 3. Confirm by clicking **Save**. Below you can find an example of the preview for the HTML block with the last seen products.
Email context preview
Email context preview
### Final settings --- 6. Add final elements to your email template. 7. After you make changes to the template, you can check the preview of the whole template. 1. On the upper left side, click the **Preview Contexts** button. 2. Enter the ID of a customer. 3. Click **Apply**. 7. If the template is ready, in the upper right corner, click the arrow next to **Next**, and from the dropdown select **Save as**. 8. On the pop-up: 1. In the **Template name field**, enter the name of the template. 2. From the **Template folder** dropdown list, select the folder where the template will be saved. 3. Confirm by clicking **Save**. ## Create an aggregate --- In this step you will create an aggregate which counts the number of products visited by customer. It will be used later in the workflow. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Count**. 4. From the **Choose event** dropdown list, select the **page.visit** event. 5. As the event parameter, select **product:retailer_part_no**. 4. From the **Choose operator** dropdown list, select **Is true (Boolean)**. 5. Using the date picker in the lower-right corner, set the time range to **last 52 hours**. Confirm your choice with the **Apply** button. 7. Click **Save**.
The view of the configuration of the metric returning the number of all page visits
Configuration of the metric returning the number of all page visits
## Prepare a workflow --- The workflow will be triggered by the `session.end` event. The delay is set to 48 hours, after this time customer will receive an email with 3 last seen products. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the trigger node --- 1. As the first node, add the **Profile Event**. In the settings of the node, select the **session.end** event. 2. Click **Apply**. ### Configure the Delay node --- 1. Add the **Delay** node. In the node settings: 1. In the **Delay** field, type `48`. 2. From the **Unit** dropdown list, choose **Hour**. 2. Click **Apply**. ### Configure the Profile Filter node --- As this step, add the **Profile Filter** node, to check two conditions: - if the customer competed a transaction within the last 48 hours, - if the customer has browsed at least three different products. Only customers who fulfill both criteria will be sent an email featuring the last products they looked at. Customers with fewer product views will not receive tailored recommendations because of the lack of data. 1. Add **Profile Filter** node. 2. In the settings of the node select `transaction.charge` event. 3. Set the time range as the `last 30 days`. 4. Change the condition to "Profiles `not matching` funnel". 5. From the **Choose filter** dropdown list select the aggregate created in [this part of the process](/use-cases/last-seen-html#create-an-aggregate-1). 6. From the **Choose operator** dropdown list, select **More or equal to**. 7. On the input field type `3`. 5. Click **Apply**.
Automation Hub Profile Filter node filtering customers not matching purchase funnel and with aggregate count of 3 or more in the last 30 days
The Profile Filter node configuration
5. To the **Matched** path, add a **Send Email** node. ### Configure the Send Email node --- 1. Add the **Send Email** node. In the node settings: 1. In the **Sender details** section, choose the email account from which the email will be sent. 2. In the **Content** section, in the **Subject** field, enter the subject of the email and from the **Template** dropdown, select [the template you have prepared in the previous step](/use-cases/last-seen-html#prepare-an-email-template). 3. In the **UTM & URL parameters** section, you can define the UTM parameters added to the links included in the email. 4. In the **Additional parameters** section, you can optionally assign [parameters](/docs/campaign/e-mail/creating-email-campaigns#adding-custom-parameters). which will be added to every event generated by this communication. 2. Click **Apply**. ### Add the finishing nodes and set capping 1. Add the **End** nodes after **Send Email** node and to the **Not matched** path after the **Profile Filter** node. 2. In the upper right corner, click **Set Capping** and define the limit of workflows a profile can start. 4. Confirm by clicking **Apply**.
Automation Hub workflow for sending emails with last seen HTML product blocks
Workflow configuration
## Check the use case set up on the Synerise Demo workspace --- On Synerise Demo workspace, you can check: - [aggregate](https://app.synerise.com/analytics/aggregates/245aa662-d642-352e-acef-18198604ac13), - [email template](https://app.synerise.com/campaigns/create/898632d5-a9d1-40b6-9b6e-a1a396e17019) - [aggregate](https://app.synerise.com/analytics/aggregates/79acbdbb-1462-3d6a-b428-262575bca4a5) - [workflow](https://app.synerise.com/automations/automation-diagram/24cab624-aaa3-4d5a-a60f-6b0c4e963920) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 9 events per profile that completes the flow: [`session.end`](/docs/assets/events/event-reference/web-and-app#sessionend) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Automation Hub](/docs/automation) - [Email template builder](/docs/campaign/e-mail/creating-email-templates/creating-custom-html-block-basic-builder) # Social proof A lot of purchases are made due to the recommendation heard from friends or people with similar preferences. People generally choose products that regularly sell out and get positive feedback. That is why it is worth putting social proof on the product page to authenticate the fact that customers like a new product. Then the visitors to your website are more likely to buy a product that other customers are happy with. Social proof can shape our decisions and increase the sales. We encourage you to add different types of social proof to the product page: - number of products already purchased during a specific range of time, - number of people who have viewed this product during specific range of time, - number of downloaded materials, - stock availability. ## Example of use - Electronics industry **Challenge** Our client from Electronics industry decided to inform customers how many users were interested in a particular item to convince them to make a purchase. The client did it in 2 ways: - If a product was visited by more than 1 person, customers get the notification how many users were watching the product in the last 1 hour. - Additionally, if a product was bought in last 24 hours, the social proof was enriched with information how many customers bought this product.
Screenshot presenting website with social proof dynamic content
Social proof campaign
**Results** 4% higher coversion than in group without Social proof ## Prerequisites --- - Implement a [tracking code](/docs/settings/tool/tracking_codes). - Manage [transaction events section](/developers/web/transactions-sdk). ## Process --- To prepare social proof, you have to create dynamic content with a metric, which will dynamically count particular event occurrence for each product. Perform the steps in the following order: 1. [Create metric with dynamic key](/use-cases/social-proof-particular-product#create-metric-with-dynamic-key). 2. [Prepare a dynamic content](/use-cases/social-proof-particular-product#prepare-a-dynamic-content). ## Create metric with dynamic key --- Social proof is a metric with a dynamic key, thanks to which the statistics on a product page will be displayed in real time and they will adjust to the product that is being currently viewed. In our case, we will follow two scenarios for the implementation of social proof: - [Metric with a page visit](/use-cases/social-proof-particular-product#metric-with-a-page-visit). - [Metric with the number of bought items](/use-cases/social-proof-particular-product#metric-with-the-number-of-bought-items). ### Metric with a page visit If you want to display a message that X users watched the product in the last X hours, you have to prepare a metric for **page.visit event**. 1. Go to **Decision Hub > Metrics > New metric**. 2. Leave the **type**, **aggregator** and **occurrence** to default. 3. From the **Choose events** dropdown list, select **page.visit** (product:**retailer_part_no** in our example). 4. Click the **+ where button** and select a parameter that indicated a product ID - in this case its **$sku**. 5. From the **Choose operator** select **Contain**(product id in our example). 6. Click the icon next to the logic operator and keep clicking until you get Choose value icon. 6. In the left field, enter `sku`. 7. In the right field, enter the value of the SKU (0 in our example). 8. Define time from which metric counts the page visit, for example last 24 hours (60 minutes in our example)
Screenshot presenting Metric with page visit
Metric for page visit
### Metric with the number of bought items If you want to display a message that X users bought the product in the last x hours, you have to prepare a metric for **product.buy**. 1. Go to **Decision Hub > Metrics > New metric**. 2. Leave the **type**, **aggregator** and **occurrence** to default. 3. From the **Choose events** dropdown list, select **product.buy**. 4. Click the **+ where button** and select a parameter that indicated a product ID (in this case its **$sku**). 5. From the **Choose operator** select **Contain** (product id. in our example). 6. Click the icon next to the logic operator and keep clicking until you get Choose value icon. 6. In the left field, enter `sku`. 7. In the right field, enter the value of the SKU (0 in our example). 8. Define time from which metric counts the page visit (24 hours in our example).
Screenshot presenting Metric Filter
Metric Filter
In the same way you can prepare metric for **addToCart** event
## Prepare a dynamic content --- To show a social prooof on your website, prepare a dynamic content. 1. Go to **Experience Hub > Dynamic content > Create communication**. 2. Choose **Insert Object** type. 3. In the **Audience** section, select **Everyone**. 4. In the **Content** section, select **Simple message** and by inserting CSS selector define where the social proof will display on your website. 5. In the **Content** tab, click **Create Message** and insert a code of the metrics which you prepared in the previous steps. - The customer will receive information about the number of visits to a given page and then how many times the product has been bought.
Check the Javascript with gif
(function(){ var availableMetrics = []; //Adding metric prepared in point 1.1 var firstMetricsVal = "{% socialproof %} xxx {% endsocialproof %}"; //Adding metric prepared in point 1.2 var secondMetricsVal = "{% socialproof %} xxx {% endsocialproof %}"; //Adding variant text for 1st metric one for person var textFirstMetricOnePerson = 'person is watching this product now.'; //Adding variant text for 1st metric for few people var textFirstMetricPeople = 'people are watching this product now.'; //Adding variant text for 2nd metric for person var textSecondMetricOnePerson = 'sold in the last 1 hour.'; //Adding variant text for 2nd metric for few people var textSecondMetricPeople = 'sold in the last 1 hour.'; function handleCounterText(val, variantA, variantB) { if (val.length === 1) { let finalVariant = getWordVariant(+val, variantA, variantB); return `${val} ${finalVariant}`; } else { let lastNumber = val.slice(-1); let finalVariant = getWordVariant(+lastNumber, variantA, variantB); return `${val} ${finalVariant}`; } } function getWordVariant(num, variantA, variantB) { if (num == 1) { return variantA; } else { return variantB; } } var firstMetrics = `
            

${handleCounterText(firstMetricsVal, textFirstMetricOnePerson,textFirstMetricPeople )}

`; var secondMetrics = `

${handleCounterText(secondMetricsVal, textSecondMetricOnePerson, textSecondMetricPeople)}

`; if (firstMetricsVal >= 1) { availableMetrics.push(firstMetrics); } if (secondMetricsVal >= 1) { availableMetrics.push(secondMetrics); } var wrapper = document.querySelector('#synerise-social-proof-place'); wrapper.style.position = "fixed"; var availableMetricsCounter = 0; setInterval(function() { if (document.querySelector('#synerise-social-proof') !== null&&document.querySelector('#synerise-social-proof>p')){ wrapper.removeChild(document.querySelector('#synerise-social-proof')); }; wrapper.insertAdjacentHTML('beforeend', availableMetrics[availableMetricsCounter]); if (availableMetrics.length === 1) { return; } if (availableMetricsCounter >= availableMetrics.length - 1) { availableMetricsCounter = 0; } else { availableMetricsCounter++; } }, 3000); })()
- The customer will get a graphic that will contain information about the number of visits and purchases of the product.
Check the Javascript with graphic
(function(){ //Adding metric prepared in point 1.1 var firstMetricsVal = "{% socialproof %} xxx {% endsocialproof %}"; //Adding metric prepared in point 1.2 var secondMetricsVal = "{% socialproof %} xxx {% endsocialproof %}"; //Adding variant text for 1st metric one for person var textFirstMetricOnePerson = 'person is watching this product now.'; //Adding variant text for 1st metric for few people var textFirstMetricPeople = 'people are watching this product now.'; //Adding variant text for 2nd metric for person var textSecondMetricOnePerson = 'sold in the last 1 hour.'; //Adding variant text for 2nd metric for few people var textSecondMetricPeople = 'sold in the last 1 hour.'; function handleCounterText(val, variantA, variantB) { if (val.length === 1) { let finalVariant = getWordVariant(+val, variantA, variantB); return `${val} ${finalVariant}`; } else { let lastNumber = val.slice(-1); let finalVariant = getWordVariant(+lastNumber, variantA, variantB); return `${val} ${finalVariant}`; } } function getWordVariant(num, variantA, variantB) { if (num == 1) { return variantA; } else { return variantB; } } var firstMetrics = `
                
${firstMetricsVal >= 1?('

'+handleCounterText(firstMetricsVal, textFirstMetricOnePerson,textFirstMetricPeople)+"

"):''} ${secondMetricsVal >=1?('

'+handleCounterText(secondMetricsVal, textSecondMetricOnePerson, textSecondMetricPeople)+'

'):''}
`; var wrapper = document.querySelector('#synerise-social-proof-place'); wrapper.style.position = "fixed"; if(firstMetricsVal >=1||secondMetricsVal >= 1){ if (document.querySelector('#synerise-social-proof') !== null){ wrapper.removeChild(document.querySelector('#synerise-social-proof')); }; wrapper.insertAdjacentHTML('beforeend',firstMetrics ); } })()
6. Schedule when the dynamic content has to be active
Screenshot presenting display settings
Set up display settings
1. Schedule when the dynamic content has to be active. 2. In the **Display settings**, define the circumstances the dynamic content will be shown: - **Always on landing**, on All pages if in CSS selector is unique selector for a product page. - Always on landing, **on a specific URL** which indicates a product page (for example, if a URL contains product), if CSS selector is not unique for a product page. ## Check the use case set up on the Synerise Demo workspace --- Check all items (metrics and dynamic content) created in this use case in our Synerise Demo workspace: - [Metric that returns the number of visits in last 60 minutes](https://app.synerise.com/analytics/metrics/623eaf91-2203-4974-aa1a-4226574d0ff7), -[Metric that returns the number of items sold in last 24 hours](https://app.synerise.com/analytics/metrics/bcf165b4-200b-4efb-8842-dff13d7df829), - [Dynamic content settings](https://app.synerise.com/campaigns/create/88c84fe3-db25-45c9-aef0-17bd1acbf861). If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates 1 event per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1). ## Read more --- - [Dynamic content](/docs/campaign/dynamiccontent) - [Dynamic key](/docs/analytics/i_events-parameter-value#dynamic-key) - [Metrics](/docs/analytics/metrics/introduction-to-metrics) # AI-Powered Personalized Brand Recommendations on Category Pages Recommending items is not the only approach that you can take. Another way to engage the customer is to provide brand recommendations, which placed on the category page. These recommendations are personalized, which means that for each customer the AI model will recommend brands that fit the customers' preferences. This method raises the customer conversion rates. In this example, we will create a recommendation that consists of 3 recommended brands at minimum and 5 at maximum, that will be placed on the category page. This is different from the [Promote a brand in recommendations](/use-cases/boost-brand) use case, in which the selected brands are promoted to appear in the recommendations more often, but the other brands are not completely excluded from the results. ## Prerequisites --- - The [items feed](/docs/ai-hub/recommendations-v2/item-feed-requirements) must be provided. - The attribute recommendation type must be enabled in [AI Engine Configuration](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). Optionally, you can provide [metadata catalog](/docs/ai-hub/recommendations-v2/item-feed-requirements). ## Create a recommendation --- 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 3. In the top left corner, enter the name of your recommendation. 4. In the **Type & Items feed** section, click **Define**. 5. From the **Items feed** dropdown menu, choose the provided feed. 6. Choose the **Attribute** recommendation type. 7. From the dropdown menu that appears at the bottom, choose your **Metadata catalog**. 8. Click **Apply**. 9. In the **Items** section, click **Define**. 10. Click **Add slot**. 11. Define the minimum and maximum number of brands that will be recommended to the user. In our example, it is from 3 (minimum) to 5 (maximum). 12. From the **Items attribute** dropdown menu, choose the `brand` attribute. 13. Click **Apply**. 14. In the top right corner, click **Save**. ## What's next --- You can display the recommendation on a category page by using [dynamic content](/docs/campaign/dynamiccontent). 1. Go to **Experience Hub > Dynamic content > New dynamic content**. 2. In the body of the dynamic content, use the recommendation insert.
Read more about how to use recommendation in inserts [here](/developers/inserts/recommendations-v2).
3. Add CSS and/or HTML to the dynamic content. 4. [Define the rest of the settings](/docs/campaign/dynamiccontent/creating-dynamic-content). ## Check the use case set up on the Synerise Demo workspace --- You can check the [recommendation settings](https://app.synerise.com/ai-v2/recommendations/EHdHrqiT9tTE) in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 5 events per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Recommendations](/docs/ai-hub/recommendations-v2) # Labeling Best-Selling Products Automatically in Synerise Catalog Automating the extraction of sales data and updating product catalogs with accurate information is vital for businesses aiming to streamline operations and improve customer experiences. In this specific scenario, the objective is to achieve precisely that by utilizing automation to identify best-selling products in the Synerise catalog and label them on the website. Implementing this scenario offers several key advantages. Firstly, it enables the efficient transmission of sales data for frequently purchased products within a specific category directly to the catalog. By eliminating manual data extraction, this automated approach reduces human errors and saves valuable time and resources. The goal of this use case is to - using automation - send the sales for a particular product category (in this instance: smartphones) and upload it to the Synerise catalog through automation. The data corresponds to the best-selling items from the last 30 days. The process involves generating a JSON report via an API, manipulating the response using Jinja, and sending a request to the Synerise catalog to add the sales data with sequential numbers. Additionally, a dynamic content script is utilized to verify if the Stock Keeping Unit (SKU) exists in the top 100 product catalog and apply a "Bestseller" label to the corresponding elements on a webpage daily, based on the most recent data. ## Prerequisites --- - Create a catalog, that consists of two columns: `no` (number) and `sku`. This catalog will serve as the foundation for importing data automatically. The objective is to import data of the top 100 bestselling products in the `smartphones` category from the last 30 days. - Create a [Workspace API key](/docs/settings/tool/api) that has the following permissions: `ANALYTICS_BACKEND_REPORT_READ` and `CATALOGS_ITEM_BATCH_CATALOG_CREATE` - In order for the bestseller label to be added to an element, the SKU (Stock Keeping Unit) needs to be included as an attribute called `data-sku.` On the webpage, there should be an element, preferably an `` tag, with the `data-sku` attribute whose value corresponds to the SKU from the list of bestsellers in the catalog. ## Process --- In this use case, you will go through the following steps: 1. [Create a metric](/use-cases/bestsellers-in-catalog#create-a-metric) that calculates the number of purchases within the `smartphones` category over the last 30 days. 2. [Create a report](/use-cases/bestsellers-in-catalog#create-a-report) that presents the top 100 bestselling products based on the metric created in the previous step. 3. [Retrieve request body of the report](/use-cases/bestsellers-in-catalog#retrieve-request-body-of-the-report) and use it in the next step during creating a workflow (in the Outgoing Integration node). 3. [Create a workflow](/use-cases/bestsellers-in-catalog#create-a-workflow) that facilitates the transmission of transaction data to the catalog, ensuring accurate and up-to-date information. 2. [Create a dynamic content campaign](/use-cases/bestsellers-in-catalog#create-a-dynamic-content-campaign) that adds labels to the bestselling products, enhancing their visibility and recognition. ## Create a metric --- To create a metric that counts the number of frequently purchased products in a specific category (in this case: `smartphones`) within the last 30 days, follow the steps below: 1. Go to Behavioral Data Hub icon **Decision Hub > Metrics > New mertic**. 2. Enter a name of the metric. 3. As a metric kind, select **Simple metric**. 4. As the aggregator, set **Count**. 5. As the occurrence type, set **All**. 6. From the **Choose event*** dropdown list, select **product.buy** event. 7. Click on the **Where** button. Result: The **Choose parameter** button will appear. 8. Click the **Choose parameter** button. Result: A pop-up window will appear. 9. Choose the `category` parameter. 12. Click the **Choose parameter** button. 13. From the dropdown, select **Contain**. 14. In the text field, enter the name of the chosen category. In our case `smartphones`. 15. To specify the analyzed period, click on the **calendar** icon. 15. Choose the last 30 days. 16. Confirm your selection by clicking the **Apply** button. 17. Save the metric.
Metric
Metric
## Create a report --- To create a report that presents the top 100 bestselling products from the last 30 days, follow the steps below: 1. Go to Behavioral Data Hub icon **Decision Hub > Report > New report**. 2. Enter a name of the report. 3. Select the metric you created in [the previous part](/use-cases/bestsellers-in-catalog#create-a-metric) of the process. 4. From the **Range** dropdown list, choose **100 top** to display the most frequently bought products in the report preview. 5. In the **Dimension** section, select the parameter from the **product.buy** event and as the parameter, select **$sku** to display the SKU of each product. 6. For the date range, select the time period you want to analyze. In this case, choose 30 days.
Make sure to select the same date range as you previously selected for the metric.
7. Save the report. 8. Click on **Preview** to view the results.
The configuration of the report
The configuration of the report
## Retrieve request body of the report --- Download the request body of the report you created. You will use it in the next step during creating a workflow (in the Outgoing Integration node). 1. Go to the [report](/use-cases/bestsellers-in-catalog#create-a-report) created in the previous step. 2. Right-click and choose the option **Inspect**. 3. In the Developer Tools window that opens, navigate to the **Network** tab. 4. Click on the **Preview** tab within your report. 5. In the **Network** section locate the **Preview** element related to your report. 6. Click on the element to display its details. 7. Within the details, find the **Payload** section. 7. Click on the **Payload** element and select the option to copy the object. 6. Paste the copied object into the body of your request.
Download the request body
Request body - download
## Create a workflow --- In this part of the process, create a workflow that updated the catalog with 100 bestselling items during last 30 days. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter a name of the workflow. ### Define the trigger node --- Set up the repetitive launch of the trigger to 9:00 A.M on a daily basis.
In the triggering node, the audience is not a priority - you may include only yourself as audience, as an outcome, the workflow related events will be generated on the profile card. This node is necessary to: facilitate repetitive launching, using the customer-related nodes (such as Event Filter) and using customer context.
1. Start the workflow with the **Audience** node. 2. In the configuration of the node, set the **Run trigger** option to **repeatable**. 3. Set the interval to `1 per day`. 4. Choose the day and time when the process starts. Select 9 A.M. 5. Select the appropriate time zone. 6. Click **Apply**.
Trigger node
Audience node
### Configure the Outgoing Integration node You will use the Outgoing Integration node to make a request to preview the report with 100 bestselling items in the last 30 days you created in the previous part of the process. 1. Add **Outgoing Integration**. In the configuration of the node: 1. Choose **Custom webhook**. 2. Name the webhook. In our case `bestsellersMobileReport`. 3. In **Webhook event name**, click **Create event** and create a new event: 1. As **Name**, enter `report.mobilebestsellers` 2. As **Display name**, enter `Mobile bestsellers report generated` 3. Select the **POST method**. 4. In the **Endpoint** field, enter `https://api.synerise.com/analytics/analytics/v4/reports/preview` 4. Leave the **content-type** at the default value: `application / json`. 5. In the body of the request, paste the code you have retrieved in [the previous step](#retrieve-request-body-of-the-report). Below, you can find an example code:
Check the example code
{ "analysis": { "title": "bestsellers [\"mobiles_tablets > mobiles\"] 30D", "description": "", "filter": { "matching": true, "expressions": [], "expression": { "name": "", "type": "EMPTY" } }, "reportMetrics": [ { "metricId": "8e03bdb3-408a-4a3b-bc96-4e5392a08735", "dateFilter": { "type": "RELATIVE", "duration": { "type": "DAYS", "value": 30 }, "offset": { "type": "DAYS", "value": 0 } }, "comparison": { "dateFilter": { "type": "ABSOLUTE" } }, "action": { "id": 71248, "name": "product.buy" }, "format": { "dataFormat": "numeric", "useSeparator": true, "compactNumbers": false, "fixedLength": 1 }, "grouping": { "type": "TOP", "top": 100 }, "groups": [ { "title": "$sku", "type": "EVENT", "format": { "dataFormat": "numeric", "useSeparator": true, "compactNumbers": false, "fixedLength": 1 }, "attribute": { "type": "PARAM", "param": "$sku", "id": "parameters:551610043" } } ], "eventName": "product.buy" } ] }, "allowNull": true }
9. In the **Authorization** section, select **By API key**. 10. Select the API key you created as a part of [prerequisites](#prerequisites). 11. Confirm the settings by clicking **Apply**.
Outgoing Integration
Outgoing Integration
### Configure the Event Filter node Configure the Event Filter node that will wait for a webhook response with the report preview of the top 100 bestsellers. 1. As the next node, add **Event Filter**. In the configuration of the node: 1. In the **Check** field, from the dropdown menu choose **without limits**. 3. In the **Define conditions** field, from the **Choose event** dropdown menu, choose the `report.mobilebestsellers` event. 4. Click **+ where** button and select the **name** parameter from the list. 5. From the **Choose operator** dropdown list, select **Equal (String)**. 6. In the text field, enter `bestsellersMobileReport`. 2. Confirm your settings by clicking **Apply**.
Event Filter node
Event Filter node
### Configure the Outgoing Integration node Use the Outgoing Integration node to make a request to update a catalog you created as a part of prerequisites. As a result of the update, the `sku` column will be updated with the SKU of bestselling items in the last 30 days. The configuration of this workflow ensures overwriting the catalog with 100 bestselling items on a daily basis - the list will always have 100 and won't be extended due to updates. The `no` column contains the ordinal numbers occupied by the items in the report and the values in this column are treated as keys. 1. Add **Outgoing Integration**. In the configuration of the node: 1. Choose **Custom webhook**. 2. Name the webhook. In our case `bestsellersMobileCatalogue`. 3. In **Webhook event name**, click **Create event** and create a new event: 1. As **Name**, enter `report.updatebestsellercatalogue` 2. As **Display name**, enter `Bestseller catalogue updated` 3. Select **POST method**. 4. In the **Endpoint** field, enter `https://api.synerise.com/catalogs/bags/{YOUR_CATALOG_ID}/items/batch`. Change the `{YOUR_CATALOG_ID}` for the ID of your catalog, created in the prerequisites (you can copy it from the URL which is available when you open the catalog). 4. Leave the **content-type** at the default value: `application / json`. 5. In the body of the request, use the following code:
Check the example code
{% set id = 0 %} {% set batch = [] %} {% for entry in event.params['body.data[0].values[0]'] %} {% set id = id|add(1) %} {% set item = {"itemKey":id|string,"value":{"no":id|string,"sku":entry.name[0], "transactions":entry.value}} %} {% do batch.append(item) %} {% endfor %} {{batch|tojson}}
9. In the **Authorization** section, select **By API key**. 10. Select the API key you created as a part of [prerequisites](#prerequisites). 11. Confirm the settings by clicking **Apply**.
Outgoing Integration
Outgoing Integration
### Prepare the final settings --- To finalize the settings of your workflow, follow these steps: 1. Add the **End** node. This node marks the end of the automation process. 2. Optionally, you can define capping for the workflow if desired. Capping allows you to set limits on how many times the workflow can be triggered within a specific time frame. 3. Add titles to each node to make the workflow more understandable to your colleagues and the code in the automation. Titles can provide descriptive information about the purpose of each node. 4. Once you have configured all the nodes and made any desired optional settings, activate the workflow by clicking **Save & Run**. **Result:** The actual catalog will be generated with the list of the top 100 bestsellers from the last 30 days, including the column with sequential numbers. This catalog reflects the updated and accurate information of the bestselling products, ensuring efficient and streamlined operations for your business.
Final catalog with subsequential numbers
Final catalog with subsequential numbers
The order of rows in the catalog is presented in the alphabetical order.
Automation
Automation
## Create a dynamic content campaign --- During this part of the process, create a dynamic content to assign the "Bestseller" label to the items from the catalog displayed on a webpage. In the settings of the dynamic content, use Jinjava (you can find it in the procedure below) to retrieve data from the catalog. Verify the presence of each SKU in the catalog and designate the corresponding elements on the webpage as "Bestsellers." Additionally, you can assign a position value ranging from 1 to 100 for each record and cross-check the SKUs against the existing catalog to identify the top 100 best-selling products. 1. Go to Experience Hub icon **Experience Hub > Dynamic Content > Create new**. 2. Enter the name of the campaign. 1. Choose the **Insert Object** type. 2. Select your **Audience**. You can either target your communication to everyone or choose a specific user segment. For this example, we will target the communication to every visitor to the website. 3. In the **Content** section, click **Simple message**, then in the CSS selector field, specify the location where you want to insert the content. In our case, it is **After (in div)** `.snrs-modal-wrapper` 4. In the **Content** tab section, click **Create message**. 5. In the **JavaScript** tab, paste the following code:
Check the JavaScript code
{% set positions = range(1,101) %} {% set bestsellersMobileList = [] %} {% for position in positions %} {% catalogitem.bestsellersMobile(position) %} {% do bestsellersMobileList.append(catalog_result.sku) %} {% endcatalogitem %} {% endfor %} var bestsellersMobileSKUs = {{bestsellersMobileList|tojson}}; var bestsellersMobileHTML = `

Bestseller

`; let bestsellersMobileURL = location.href; document.body.addEventListener('click', () => { requestAnimationFrame(() => { setTimeout(() => { bestsellersMobileURL !== location.href && showBestsellersMobile(); bestsellersMobileURL = location.href; }, 1000) }); }, true); function showBestsellersMobile() { var elements = document.querySelectorAll("a[data-sku]"); for (var i = 0; i < elements.length; i++) { if (bestsellersMobileSKUs.includes(elements[i].getAttribute("data-sku"))) { elements[i].insertAdjacentHTML('afterend', bestsellersMobileHTML); elements[i].addEventListener("click", function() { SR.event.trackCustomEvent( "dynamicContent.click", { "eventLabel": "Dynamic content click", "campaignName": "Label", "sku": this.getAttribute("data-sku"), "title": this.getAttribute("title"), "category": this.getAttribute("data-category") }, "Dynamic content click" ); }); } } } showBestsellersMobile();
7. In **Display Settings**, specify where the dynamic content should be displayed: **Always**, **On landing**, or on **All pages**. 6. Skip the **UTM&URL parameters** section. 8. In the **Schedule** section, click **Define**. Select the period when the dynamic content will be active. 9. To initiate your dynamic content campaign, click **Activate**. ## Check the use case set up on the Synerise Demo workspace --- In the Synerise Demo workspace, you can check the configuration of: - [metric](https://app.synerise.com/analytics/metrics/ee61ac48-5d48-4d4a-b2ab-a1106915d7b7), - [report](https://app.synerise.com/analytics/reports/55a37627-ba32-463e-b6c1-d15d53243f5c), - [workflow](https://app.synerise.com/automations/automation-diagram/fb814748-b7df-4ee8-9911-347ef8cc964d), - [dynamic content](https://app.synerise.com/campaigns/create/f302f1d1-6196-4ef5-8e72-5e2303d81668), If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 9 events per workflow execution: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), `report.mobilebestsellers` (~1), `report.updatebestsellercatalogue` (~1), [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Catalogs](/docs/assets/catalogs/introduction-to-catalogs) - [Dynamic content](/docs/campaign/dynamiccontent) - [Event context from preceding nodes](/developers/inserts/automation) - [Metrics](/docs/analytics/metrics) - [Reports](/docs/analytics/reports) # Update the value of discounts in communication If you offer your customers a discount with a fixed value in response to their actions, you can use an expression as a variable in the templates of your messages (email, SMS, mobile push, web push) and other types of communication (dynamic content on websites) to display the discount value. The main advantage of this solution is quick modification of the value of discount - when you modify the expression, its result is automatically updated in all templates the expression is used. ## Prerequisites --- Implement [tracking code](/developers/web/installation-and-configuration#creating-a-tracking-code) on your website. ## Process --- 1. Create an [expression](/use-cases/update-dynamic-discount-value#use-the-expression-insert-in-templates). 2. Use the [expression insert](/use-cases/update-dynamic-discount-value#use-the-expression-insert-in-templates) in templates. 3. [Modify the expression](/use-cases/update-dynamic-discount-value#modify-the-expression). ## Create an expression --- In this part of the process, you create an expression with a discount value, which will be used as a variable in the template of the message further in the process.
Expression with a discount value
1. Go to **Behavioral Data Hub > Expressions > New expression**. 2. Enter the name of the expression. 3. Leave the **Expression for** option at default (**Attribute**). 4. Build the formula of the expression. 1. Click **Select**. 2. From the dropdown list, select **Constant**. 3. Click the field that appeared on the dashboard. 4. Enter the value of discount. 5. Click **Save**.
Behavioral Data Hub expression formula for setting a constant dynamic discount value
Formula of the expression
## Use the expression insert in templates --- In this part of the process, you use the expression as a variable in the message template. 1. Go to **Experience Hub** and select the type of message. 2. Go to the code editor. 3. On the upper right side of the screen, click **+ Inserts**.
Selecting the expression on the list of inserts
Selecting the expression on the list of inserts
4. From the dropdown list, select **Expressions**. 5. Find the expression you created in the first part of the process. 6. Click the name of the expression. 7. Copy the Jinjava code of the expression. 8. Paste it in the template. 9. Style the template according to your preferences.
Preview of the template that contains the expression variable
Preview of the template that contains the expression variable
## Modify the expression --- If you need to change the value of the discount, edit the expression you created in the beginning of the process. As a result, the expression will return the new value in all templates in which the expression is used as a variable. To edit the expression: 1. Go to **Behavioral Data Hub > Expressions**. 2. Find the expression on the list. 3. Click the expression. 4. Make the changes to the formula of the expression. 5. Click **Publish**. ## Check the use case set up on the Synerise Demo workspace --- In the Synerise Demo workspace, you can check the configuration of: - the [expression](https://app.synerise.com/analytics/expressions/9caa08a3-2428-4eaa-81da-8ce86facd5f2) - the [email template](https://app.synerise.com/campaigns/create/c562dfbc-d6bf-4331-9df4-4a9e2e34c67f) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case does not generate any events. ## Read more --- - [Expressions](/docs/crm/expressions) - [Inserts](/developers/inserts/insert-usage#expressions) # Making smart alerts about deviation problems IoT is a solution that allows you to connect different devices and transfer data between them. Synerise gives you the ability to connect to any device, so you will be able to easily monitor the accuracy of its operation. ## Example of use - Food Industry **Challenge** Our use case is based on a project that shows that **IOT integration with the food industry** works well and provides a competitive advantage. Our client has a food parcel lockers network, which are devices that allow you to order food and store it until you pick it up. They usually consist of three temperature settings, one for frozen products where the temperature should be at most minus 10 degrees, another for products requiring a storage temperature of one to five degrees and a third setting of about 15 degrees. Increasing or decreasing the temperature for some products can cause damage. **Solution** This means that the temperature inside must be constantly monitored, and any deviation must be immediately notified. For this purpose, each of these food parcel lockers has a terminal which constantly monitors the temperature and has the ability to share this data. We created several alert scenarios for him that created notifications about: - temperature (general report) - temperature deviations (too low/too high temperature) - when devices go offline ![Screenshot presenting iot](/api/docs/image/f8a57079df9dd82ae8b22dc747691385d7d51d29/use-cases/all-cases/_gfx/iot_main.png) ## Prerequisites --- **General:** - Devices with the ability to connect to the internet via GSM or Wi-fi module. - Basic knowledge about API/webhooks and the Synerise platform. **Optional** - Configured email and SMS provider in your Synerise workspace. - Knowledge about API of communicators that you are using. ## Create automation --- 1. Go to **Automation Hub > Incoming**. Here we can configure the endpoint. We will receive a URL to which we will be able to send data. At the beginning you have to set up your device. Synerise allows you to create an endpoint to which you can send external data and as the result of such an action, you will receive a URL to which you can send the data in JSON format. Below you will see an example of a data frame.
{ 
         "time": "x", 
         "label": "x", 
         "action": "x", 
         "client": { 
               "uuid": "xxx-xxx-xxx" 
         }, 
         "params": { 
               "temp1": "x", 
               "temp2": "x", 
               "temp3": "x", 
               "temp4": "x" 
               } 
         }
2. When our devices are configured and they are sending data to this URL we can start to create an automation. 3. Automations allow us to convert received data into events on our device cards. - We use business events as a trigger, which means that our automation will be triggered every time our end point receives some data. So, when one of our devices sends any data, our automation will be triggered. - Then it will send outgoing webhooks. And here in the body of our outgoing webhook, we use Jinjava in order to get information about the values of these particular parameters. #### Case 1: Making smart alerts about temperature deviation problems 1. Go to **Automation Hub > Workflow > New workflow.** 2. Start with the **Profile Event** trigger and in the settings of the node, select the **custom.temp** event. This automation is triggered every time this event appears on the profile card. 3. Choose **Update Profile** action. Update the device status to online because when the device is sending data, that means it's online. 4. Choose **Profile Filter**. In this step we check if the average of the last 4 measurements was between 10 and 15 degrees. Because let's assume that this is the temperature that we want to have. 5. If **Profile Filter** is **matched** add **Update Profile** node. In settings define that it should updating a temperature status into “in scale” and then the automation is ending with **End node**. 6. But when our average temperature falls below 10 degrees or moves above 15 degrees, our automation will go with a different path. If **Profile Filter** is **not matched** add some **Delay node**. 7. Next, add another **Profile Filter** in which we check if the last temperature status was “in scale”. We do it for the purpose of capping.
Let's say that we want to receive only one notification per day. But in this particular way I assume that I wanted to get one notification when my fridge is broken and another one only when it’s been fixed but it’s broken again. So, of course, this is a very flexible and this is just one way of doing this automation if you want you can receive as many alerts as you want but this is just an example.
8. If conditions are **not matched** add **End node**. 9. If conditions are **matched** add **Alerts**. In this way you can send a bunch of email alerts and SMS alerts and some Slack notifications. We also update the hourly temperature status into out of scale. Based on that automation we are sure that a broken device would not send us and annotification until we fixed the fridge. ![Screenshot presenting iot](/api/docs/image/f8a57079df9dd82ae8b22dc747691385d7d51d29/use-cases/all-cases/_gfx/iot1.png) #### Case 2: Making smart alerts about device connection problems 1. Go to **Automation Hub > Workflow > New workflow.** 2. As a trigger add **Audience** node. Set up **Run trigger** as repeatable, and send interval as one hour. In this way, this automation will be triggered, every hour. 3. Add **Profile Filter.** It checks if we have any devices in our segment that didn't respond for one hour. 4. If **Profile Filter** is not matched, add **End node**. 5. If **Profile Filter** is matched, add **Update Profile** node. If it finds such devices, it will update its status to offline. 6. Add **Outgoing Integration** node, which send us a notification. 7. Add **Profile Filter**. We'll check if we have any devices that didn't respond for at least 12 hours. 8. If **Profile Filter** is not matched, add **End node**. 9. If **Profile Filter** is matched, add **Update Profile** node. If there are any such devices it will update the device status to offline. 10. Add **Outgoing Integration.** It will send a notification that our device is offline for at least 12 hours. In this scenario we will only get two emails when one of our devices is offline. 11. Finish the workflow adding **End** node. ![Screenshot presenting iot](/api/docs/image/f8a57079df9dd82ae8b22dc747691385d7d51d29/use-cases/all-cases/_gfx/iot2.png) ## Generated events This use case generates approximately 16 events per profile that completes the flow: `custom.temp` (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~8), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`profile.updated`](/docs/assets/events/event-reference/profiles#profileupdated) (~2), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`sms.send`](/docs/assets/events/event-reference/sms#smssend) (~1), [`slack.sendChannelMessage`](/docs/assets/events/event-reference/integration#slacksendchannelmessage) (~1). ## Read more --- - [Webhooks](/docs/automation/integration) - [Workflow](/docs/automation) # Personalized promotions in a mobile application Personalized promotions play a crucial role in enhancing customer engagement and driving sales. By offering tailored discounts and exclusive deals, businesses can create a sense of value and build stronger relationships with their customers. Leveraging advanced automation and AI ensures that customers receive offers that are most relevant to their preferences, driving higher engagement and conversion rates. This use case focuses on delivering personalized promotions directly through a mobile application. The AI-powered system assigns six tailored promotions to each customer every seven days, ensuring fresh and relevant offers. Customers can view, activate, and redeem these **mobile promotions** during their visit in the store, with the system automatically tracking their usage and marking them as redeemed. Additionally, it is possible to print personalised promotions directly on the receipt using **Check-out**, enhancing the shopping experience in the physical channel and improving customer engagement through multiple touchpoints. In this use case, we address scenarios where a Synerise user want to import promotions from a CSV file rather than create them using the Synerise portal. However, this does not exclude cases where the user wishes to manually create promotions in the system. For such cases, the [Promotion feature](/docs/ai-hub/promotions) can be used to add promotions individually. ## Prerequisites --- ### Basic requirements - Integrate Synerise [promotions](/docs/ai-hub/promotions). - Implement promotions in your mobile application using Synerise [mobile SDK](/developers/mobile-sdk/loyalty) or [API](https://hub.synerise.com/api-reference/loyalty-and-engagement#operation/profileLogin). - [Import your product feed to a catalog](/use-cases/import-product-feed-to-catalog). - Apply [this method](https://hub.synerise.com/api-reference/loyalty-and-engagement#operation/getHandbillForClient_GET) to assign personalized promotion to a Profile. - Implement those custom events in your [mobile application](/developers/mobile-sdk/event-tracking).: - `handbill.assign`: Assigns a set of personalized promotions to a customer, refreshed every seven days. Apply [this method](https://hub.synerise.com/api-reference/loyalty-and-engagement#operation/getHandbillForClient_GET) to assign personalized promotion to a Profile. - `client.activatePromotion`: Tracks when a customer activates a specific promotion in the mobile app. - `client.removePoints`: event is generated through the `/promotion/redeem` method, after the coupon is redeemed. - `sale.processed`: Updates the system with redeemed promotions and finalized basket values. This event is generated in Synerise with details about the products purchased using Synerise promotions. ### Integrate with the checkout Implement transactions in checkout registers using the [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction).
We recommend implementation of transactional events so that the hash of the card can become an identifier for the customer when they are paying by card. Thanks to this, a customer who will come to the store and pay with the same card can get personalized offer (even if they are not recognized, for example does not scan the mobile application at checkout), because we will be able to properly collect their transaction history.
For this promotion to work you need to implement the personalized promotion in stores. Personalization of promotions on check out works for any customer, even for the anonymous ones.
Read more about implementing Check-out promotions [here.](/use-cases/personalized-promotions-on-checkout)
Create promotions and assign tags to them for use later as a filter when creating a personalized promotion. You can do it manually, but in case of having more promotions we recommend to prepare them as a CSV file and import them to Synerise using Automation Hub. More about the integration we will discuss later as a 1st step of the process. ## Process --- In this use case, you will: 1. [Import promotions](/use-cases/personalized-promotions#import-promotions). 1. [Create a workflow](/use-cases/personalized-promotions#create-a-workflow) to import the data about promotions to Synerise. 2. [Create a personalized promotion](#create-a-personalized-promotion) to launch an AI campaign which will choose 6 personalized promotions for each user. ## Import promotions --- In case of having more promotions we recommend to prepare them as a CSV file and import them to Synerise using Automation Hub. The example file with the list of promotions for specific products can be prepared based on our example, described below.
Check required column names:
  • catalogIndexItems

  • storeItemType

  • storeIds

  • visibilityStatus

  • name

  • redeemQuantityPerActivation

  • discountValue

  • expireAt

  • description

  • catalogItemType

  • priority

  • discountTypediscountType

  • displayTo

  • displayFrom

  • redeemLimitPerClient

  • type

  • headline

  • startAt

  • storeCatalog

  • catalog

  • headerName

  • redeemType

    If these are personalized promotions, you can set the type parameter to Personalized promotion permanently for this use case.

Read more about those parameters here.

If you wish to generate promotions across different channels, such as on receipts in addition to the app, you can configure this within the campaign using tags. For example: Promotions marked with tag CHECKOUT will display on receipts. Promotions marked with MOBILE will appear in the app. Ensure these tags are already defined in the csv file during the preparation process as `tags.0.name`. Important: The tag must first be created in Data Modeling Hub -> Tags.

If custom information for promotions, such as unique store icons, descriptions, or additional details, is required, an appropriately structured CSV file must be prepared in advance. Read more about additional columns and their requirements [here.](https://hub.synerise.com/api-reference/loyalty-and-engagement#operation/CreateAPromotion) - If you collect promotion data in a different way, and it is organized differently, you can easily transform column names and the format of their values using [data transformation](/docs/automation/data-transformation-and-imports) in Synerise. - Data transformations during the import of promotions may require additional configuration and testing, as this depends on your implementation of the promotions. ## Create a workflow --- In this part, you will create a workflow which imports a local file to add promotions to Synerise. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Scheduled Run trigger node --- At this stage, we will configure launching the workflow. 1. As the trigger node, add **Scheduled Run**. 2. In the configuration of the node: 1. Leave the **Run trigger** option at default (**one time**) and choose the **Immediately** option. 4. Confirm by clicking **Apply**.
Automation Hub Scheduled Run node configuration for triggering personalized promotions
The configuration of the Scheduled Run node
### Add local file with sample data This node allows you to add a data sample. In our case use the csv file prepared as a part of [prerequisites](#prerequisites) 1. On the pop-up, click **Add example**. 2. Upload the CSV file from the [prerequisites](#prerequisites) as the sample data. 3. Set **Delimiter** to the delimiter that you used in your CSV file. The delimiter is usually a comma or a semicolon, depending on the application you used to create the file and the regional settings of your system. 3. Click **Generate**.
Data Transformation Data input node showing CSV sample data upload for handbill promotions import
The configuration of the Data input node
### Add import promotions node and finishing node --- In this part of the process, you will import the transformed file with customers to Synerise. 1. Add the **Import Promotions** node. 2. Add the **End** node. 3. In the upper right corner, click **Save & Run**.
Automation Hub workflow for sending personalized promotions
The workflow configuration
**Results**: After import, all the promotions from the file will be created in Promotions in Synerise. ## Create a personalized promotion --- This part involves generating personalized promotions, tailored to each user based on the pool of available promotions. Synerise dynamically assigns these promotions, ensuring relevant offers for every customer. 1. Go to AI Hub icon **AI Hub > Personalized Promotions > New personalized promotion**. 2. Select the type of promotion - **Mobile**. 3. In **A/B test settings**, click **Define**. 4. Click the plus button to create the first variant (at least one variant must exist). 5. If you want to add more variants, click the plus button again. 5. If you want to use a control group, select **Enable a control group**. 6. If you want to change the distribution of variants, use the slider. 7. In **Advanced options**, leave the default option - **AI Engine** (the AI engine chooses the items to be included in the promotion). 8. Confirm by clicking **Apply**. 4. In the **Filters and limits** section: - Enable the **avoid overlapping promotions** option. Thanks to that, if an item is already part of an assigned promotion, a new promotion for that item won't be generated from this campaign. - Define the filter using the tags added to the promotions to determine the channel where the promotions appear, in our case we can display 3 promotions with the tag "MOBILE". - the number of items that match a filter, - optionally - the order of the items in the promotion (from top to the bottom).
Filters and Limits configuration
Filters and Limits configuration
5. In the **Activity** section, define the activity of the personalized promotion as **Relative** and set the time to 7 days.
You can find more detailed information on all Activity types [here](/docs/ai-hub/personalized-promotions/creating-ai-promotions#defining-promotion-schedule).
6. Optionally, define the AI Engine boosting settings. You can find the instruction on how to do that [here](/docs/ai-hub/personalized-promotions/creating-ai-promotions#ai-engine-boosting-settings). 7. After configuring all settings, publish the promotion.
If you want to additionally activate promotions displayed on receipts, create the same personalized promotion as described above, but **change the type to Check-out and update the** **tag to CHECKOUT**. If you require specific personalized settings based on your business needs, feel free to configure them accordingly. Read more about implementing Check-out promotions [here.](/use-cases/personalized-promotions-on-checkout)
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration directly in Synerise Demo workspace: - [Workflow](https://app.synerise.com/automations/workflows/automation-diagram/66f44f33-4b74-4dde-a47b-6e7e72ad2e09) -[Personalized promotion](https://app.synerise.com/campaigns/handbills/db010e47-cc9a-4126-9125-e56b19bbc25f) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 11 events per profile that completes the flow: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~2), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`handbill.assign`](/docs/assets/events/event-reference/loyalty#handbillassign) (~1), [`client.activatePromotion`](/docs/assets/events/event-reference/loyalty#clientactivatepromotion) (~1), [`client.removePoints`](/docs/assets/events/event-reference/loyalty#clientremovepoints) (~1), `sale.processed` (~1), [`transaction.charge`](/docs/assets/events/event-reference/items#transactioncharge) (~1), [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~2). ## Read more --- - [Automation Hub](/docs/automation) - [Promotions](/docs/ai-hub/promotions) # Similar vs cross-sell recommendations with Variant optimizer Similar and cross-sell item recommendations are both powerful tools for online retailers, helping guide customers toward products that align with their interests or complement their intended purchases. But which approach performs better in a specific context? With Variant optimizer, you can run real-time tests to compare dynamic content variations and automatically prioritize the version that drives the most engagement. This use case explores the scenario of creating a dynamic content (DC) campaign featuring two types of product recommendations to users who have added items to their favorites. One variant shows similar product recommendations and the other features cross-sell ones. By running both variants in a single Dynamic Content campaign with a goal set to maximize performance based on a metric, AI engine allocates the best preforming content variant to more customers. ## Prerequisites --- - [Implement SDK to a website](/developers/web/installation-and-configuration) - [Configure the feed for recommendations](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). Enable Similar and Cross-sell recommendations. - Implement a custom event for adding a product to favorites, which will be available in the customer profile. In this example, the event is called `product.addToFavorite`. Implement custom events in your [mobile application](/developers/mobile-sdk/event-tracking#product-added-to-favorites) or [website](/developers/web/event-tracking#declarative-tracking-custom-events). ## Process --- In this use case, you will go through the following steps: 1. [Create an aggregate](#create-an-aggregate) that returns products added to favorites. 1. [Prepare similar AI recommendations](#prepare-similar-ai-recommendations). 2. [Prepare cross-sell AI recommendations](#prepare-cross-sell-ai-recommendations). 2. [Create two variants of the dynamic content campaign](#create-two-variants-of-the-dynamic-content-campaign) with two item recommendation variants (similar and cross-sell) using the predefined dynamic content web layer template. ## Create an aggregate --- In this part of the process, create an aggregate that will return the products customers added to favorites. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last**. 4. Select the **product.addToFavorite** event. 5. Select the **sku** parameter. 6. Define the period from which the aggregate will return products from the event. 7. Save the aggregate.
Decision Hub Last aggregate returning the SKU of the last product added to favorites
Configuration of the aggregate
## Prepare similar AI recommendations --- In this part of the process, you will configure a similar items recommendation with context of items that customers added to their favorites. This recommendation will be later used in the dynamic content. 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. Enter the name of the recommendation (it is only visible on the list of recommendation). 3. In the **Type & Items feed** section, click **Define**. 4. From the **Items feed** dropdown list, select an item feed. 5. In the **Type** section, choose the **Similar items** recommendation type. 6. Confirm the settings by clicking **Apply**. 7. In the **Items** section, click **Define**. 1. Click **Add slot**. 2. Define the minimum and maximum number of items that will be recommended to the customer in each slot. 3. Optionally, define [Static filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#static-filters), [Elastic filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#elastic-filters) and [Distinct filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#distinct-filter) 4. Confirm by clicking **Apply**. 8. Optionally, you can define settings in the **Slots and items ordering** and **Boosting** sections. 9. In the **Additional settings** section click **Define**. 1. Enable the **Item context from analytics (aggregate, expression)** switch. 2. From the dropdown list, select the aggregate you created [in this part of the process](#create-an-aggregate). 3. Click **Apply**. 9. In the right upper corner, click **Save**. 10. Copy the recommendation ID from its URL and save it in the notepad. It will be needed in the further part of the process. ## Prepare cross-sell AI recommendations --- In this part of the process, you will configure a cros-sell recommendation with context of items that customers added to their favorites. This recommendation will be later used in the dynamic content. 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. Enter the name of the recommendation (it is only visible on the list of recommendation). 3. In the **Type & Items feed** section, click **Define**. 4. From the **Items feed** dropdown list, select an item feed. 5. In the **Type** section, choose the **Cross-sell** recommendation type. 6. Confirm the settings by clicking **Apply**. 7. In the **Items** section, click **Define**. 1. Click **Add slot**. 2. Define the minimum and maximum number of items that will be recommended to the customer in each slot. 3. Optionally, define [Static filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#static-filters), [Elastic filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#elastic-filters) and [Distinct filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#distinct-filter) 4. Confirm by clicking **Apply**. 8. Optionally, you can define settings in the **Slots and items ordering** and **Boosting** sections. 9. In the **Additional settings** section click **Define**. 1. Enable the **Item context from analytics (aggregate, expression)** switch. 2. From the dropdown list, select the aggregate you created [in this part of the process](#create-an-aggregate). 3. Click **Apply**. 9. In the right upper corner, click **Save**. 10. Copy the recommendation ID from its URL and save it in the notepad. It will be needed in the further part of the process. ## Create two variants of the dynamic content campaign --- Create two variants of a dynamic content campaign (each must be a web layer type). Every variant must reference a recommendation generated earlier in the process. The dynamic content campaigns will be displayed as a pop-up on your site for the customers who have added products to their favorites. 1. Go to Experience Hub icon **Experience Hub > Dynamic content > Create new**. 2. Enter the name of the dynamic content. 3. Choose the **Web layer** type. 4. In the **Audience** section, click **Define**. 1. In the **New Audience** section, click **Define conditions**. 2. From **Choose filter** dropdown menu, choose **product.addToFavorite** event. 3. Define the period from which the segmentation will return customers. 4. Confirm the settings by clicking **Apply**. 5. Confirm the settings by clicking **Apply**. ### Define the first variant content 5. In the **Content** section, click **Define**. 6. In the **Content** tab, click **Create Message**. 7. From the list of template folders, select a folder with the predefined **Web layer templates**. **Result**: You are redirected to the list of predefined templates.
Web layer templates folder
Web layer templates folder
8. Select the **Recommendations** template. **Result**: You are redirected to the template builder.
You can edit the template in two ways, by editing the code of the template ([add inserts](/docs/campaign/dynamiccontent/creating-dynamic-content-templates/dynamic-content-template-builder#adding-a-snippet-to-the-template-code), [add variables](/docs/campaign/dynamiccontent/creating-dynamic-content-templates/dynamic-content-template-builder#adding-a-variable)) and/or by [filling out the form in the Config tab](/use-cases/dynamic-content-item-context-recommendation#edit-the-form-in-the-config-tab). In this use case, we will use the capabilities of the predefined Config tab.
#### Edit the form in the Config tab The form in the **Config** tab is already filled in with default values. You can keep them or change them to fit your business needs. 1. From the **Recommendation campaign** dropdown list, select the ID of the similar recommendation campaign you created [in the previous step](#prepare-similar-ai-recommendations). You can find it by typing its name or ID in the search box. 2. In the **Header text** field, define the header text to appear in the pop-up. 3. In the **Currency** field, specify the currency in which you want to display the prices of the recommended products. 4. In the **Bottom text** field, define the copy you want to appear in this section. 5. In the **Font** field, define the font of all text displayed in the dynamic content. 6. Define the colors in the **Bottom bar background** and **Bottom bar text color** fields. 7. Choose the most suitable carousel scrolling method for you by enabling one or all toggles at the same time: - **Carousel autoplay**: activation of this toggle allows automatic scrolling of items in the carousel; - **Carousel loop**: activation of this toggle allows users to navigate to the first item in the carousel by clicking the arrow after the last item displayed in the carousel; - Enabling these two options at the same time will combine these functionalities. In this case, the recommendation carousel will scroll automatically and return to the first item automatically after displaying the last one. - If you don't activate any of the toggles, users will have to scroll through the carousel on their own, and when they get to the last item, it won't automatically redirect them to the beginning of the carousel. 8. In the following fields, define the item amount that you would like to display in small, medium, large and extra large screens. 7. After you make changes to the template, you can check the preview. 1. Click the **Preview Contexts** button on the upper left side. 2. Enter the ID of a customer and define the product context. 3. Click **Apply**.
If you are using custom attributes in your product feed, you need to replace the names of the standard attributes used in the template code with the names of the attributes used in your feed. In our case, we changed the names of following attributes (according to the custom attribute names used in our product feed): - `link` -> `productUrl` - `imageLing` -> `image` - `title` -> `name` - `item.price.value`-> `item.price` - `item.salePrice.value` -> `item.salePrice`
4. If the template is ready, in the upper right corner click **Save this template > Save as**. 5. On the popup: 1. In the **Template name field**, enter the name of the template. 2. From the **Template folder** dropdown list, select the folder where the template will be saved. 3. Confirm by clicking **Apply**. 6. To continue the process of configuring the dynamic content campaign, click **Next**. 7. To save your content changes, click **Apply**. ### Define the second variant content 5. In the **Content** section, duplicate the **Variant A** tile. 6. On the template preview, click **Edit content**. #### Edit the form in the Config tab 1. From the **Recommendation campaign** dropdown list, select the ID of the cross-sell recommendation campaign you created [in the previous step](#prepare-cross-sell-ai-recommendations). You can find it by typing its name or ID in the search box. 2. Make changes to the template according to your needs. 4. If the template is ready, in the upper right corner click **Save this template > Save as**. 5. On the popup: 1. In the **Template name field**, enter the name of the template. 2. From the **Template folder** dropdown list, select the folder where the template will be saved. 3. Confirm by clicking **Apply**. 6. To continue the process of configuring the dynamic content campaign, click **Next**. 7. To save your content changes, click **Apply**. #### Configure the content variants AI engine allocation 1. Enable the **Make allocation automatically** toggle to let the AI engine allocate the content variants to customers. 2. In the **Optimization goal** section that appears, define the goal of dynamic content to **Maximize**. 3. To define the metrics of the goal, click **Define goal**. 1. To select an event, click **Choose event**. In our case we want the AI engine to consider the **Clicked dynamic content** event. 2. Confirm the settings by clicking **Apply**. 4. Click **Apply**.
You can find more information about AI-driven variant allocation and how to check its performance in [the "Enabling AI-driven variant allocation" section](/docs/campaign/dynamiccontent/creating-dynamic-content/creating-dynamic-content#enabling-ai-driven-variant-allocation).
The view of how the traffic is divided among campaign variants and how those variants perform
Example of how the traffic is divided among campaign variants and how those variants perform
### Define schedule and display settings 1. In the **Schedule** section, click **Define** and set the time when the message will be active. 2. In the **Display Settings** section, click **Define**. 3. Specify circumstances for dynamic content to be displayed. Optionally, you can also define the Advanced options. 4. Click **Apply**. 5. Optionally, you can define the UTM parameters and additional parameters for your dynamic content campaign. 6. Click **Activate**. ## What's next --- After launching the campaign, you can check and export the results — see which variant won, view the conversion probability, and more. In addition, Variant optimizer generates a `variant.assign` event, which can be used to create your own analytics or dashboards.
The view of how the traffic is divided among campaign variants and how those variants perform
Example of how the traffic is divided among campaign variants and how those variants perform
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of each step from this use case in our Synerise Demo workspace: - [Aggregate](https://app.synerise.com/analytics/aggregates/8b2c2e9e-24e0-30ff-aca6-a9f024a99306) - [Similar Recommendation](https://app.synerise.com/ai-v2/recommendations/CWP9JaQ05YAB) - [Cross-sell Recommendation](https://app.synerise.com/ai-v2/recommendations/wE6iwEZvqwsg) - [Dynamic content](https://app.synerise.com/campaigns/dynamic-content/create/98b9ba9e-2b6c-4aeb-9dd5-dcb7f4a29a7a) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 7 events per profile that completes the flow: [`product.addToFavorite`](/docs/assets/events/event-reference/items#productaddtofavorite) (~1), [`variant.assign`](/docs/assets/events/event-reference/search#variantassign) (~1), [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Dynamic content](/docs/campaign/dynamiccontent) - [Dynamic content template builder](/docs/campaign/dynamiccontent/creating-dynamic-content-templates/dynamic-content-template-builder) - [Recommendations](/docs/ai-hub/recommendations-v2) # Recommendations on an empty basket Not every customer on your website converts. Some of them leave their basket empty after deleting products from it. You should remember to use every valuable place on your website to encourage customers to make a purchase and an empty basket is one of them. A empty shopping cart page is definitely a place with sales potential that usually remains unused. **Why do customers leave behind an empty basket?** - They added something to their shopping cart during a previous visit and they want to check it, but its content has already expired. - They checked the contents of their basket, after which they decided to remove all products from it. - They do not know what the online shopping process looks like or they just have clicked it by accident. In all of these cases you can optimize the empty shopping cart page and help the customer find the products they need thanks to personalized recommendations. Our algorithms implemented in the basket could help them make a choice and make a purchase. Recommendations that present personalized products based on previous purchases or recently viewed items can be more effective than simply leaving the space empty. In this use case, we will present product recommendations on an empty basket page. There we will display a personalized offer where customers can find products selected for them. Those products are selected based on each customer’s behavioral history.
The view of recommendations on an empty basket
## Prerequisites --- - [Implement a tracking code](/docs/settings/tool/tracking_codes). - [Import product feed to Synerise](/developers/product-feed). - [Track transaction events](/developers/web/event-tracking). - Implement [OG Tags](/developers/web/og-tags) on your website. - [Configure AI engine](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). - [Configure an item catalog for recommendations](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). Enable personalized recommendations. ## Process --- In this use case, you will go through the following steps: 1. [Create AI recommendations](/use-cases/empty-basket#create-ai-recommendations) with personalized products. 2. [Create a dynamic content](/use-cases/empty-basket#create-a-dynamic-content) on the empty basket page. ## Create AI recommendations --- In this part of the process, you will configure a personalized recommendation which will be later used in the dynamic content campaign. 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. Enter the name of the recommendation (it is only visible on the list of recommendations). 3. In the **Type & Items feed** section, click **Define**. 4. From the **Items feed** dropdown list, select an item feed. 5. In the **Type** section, choose the **Personalized** recommendation type. 6. Confirm the settings by clicking **Apply**. 7. In the **Items** section, click **Define**. 1. Click **Add slot**. 2. Define the minimum and maximum number of items that will be recommended to the user in each slot. 3. Optionally, define [Static filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#static-filters) and [Elastic filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#elastic-filters). In our case, in the static filters, select availability equals true to show only available products
`Screenshot presenting display settings`
Filters
4. Confirm by clicking **Apply**. 8. Optionally, you can define the **Boosting** factors and settings in the **Additional settings** section. 9. In the right upper corner, click **Save**. ## Create a dynamic content --- Create a dynamic content campaign, which will be displayed on an empty basket page. 1. Go to **Experience Hub > Dynamic content > Create new**. 2. Enter the name of the dynamic content. 1. Choose the **Insert Object** type. 2. As the audience, select **everyone**. 3. In the **Content** section, select **Simple message**, and set the CSS to **after** and add the value `.cart-empty`. 4. In the **Content** tab, click **Create Message**. 5. In the code editor, insert Jinjava with the AI recommendation and add your own CSS.
Click to see Jinjava

Replace `your_campaign_ID` with the ID of the AI recommendation (either of the bestselling shoes suitable for asphalt or off-road). The ID of the AI campaign is contained in the URL of the recommendation.

<div class="title-and-link"> <h2>Personalized offers for you!</h2> <a href="https://app.synerise.com/ai-v2/recommendations/bWdoIUSmSfLO" target="_blank" class="border-bottom">Go to Platform</a> </div> <div id="recommendationsForYou" class="block widget block-products-list grid products-grid__layout-default products-grid__buttons-below secondary-top-right product-columns-4 product-columns-l-4 product-columns-m-2 product-columns-s-2 title--align-center quickview-bottom-left "> <div class="block-content"> <div class="products-grid grid"> <ol class="product-items widget-product-grid"> {% recommendations3 campaignId=CjmCJ4X4RfRL %} {% for p in recommended_products3 %} <li class="product-item"> <div class="product-item-info"> <div class="product-grid__image-wrapper"> <a href="{{p.productUrl}}" class="product-item-photo"> <span class="product-image-container product-image-container-5600" style="width: 489px;"> <span class="product-image-wrapper" style="padding-bottom: 100%;"> <img class="product-image-photo" src="{{p.image}}" data-original="{{p.image}}" loading="lazy" width="489" height="489" alt="{{p.name}}"></span> </span> </a> </div> </div> <div class="product-grid-overlay"></div> <div class="product-item-details"> <div class="ox-product-grid__categories"><a href="https://demoshop.synerise.com/men/watches.html" class="ox-product-grid__category-link">{{p.category.split('>')[3]}}</a></div> <strong class="product-item-name"> <a title="{{p.name}}" href="{{p.productUrl}}" class="product-item-link"> {{p.name}}</a> </strong> <div class="price-box price-final_price" data-role="priceBox" data-product-id="5600" data-price-box="product-id-5600"> <span class="price-container price-final_price tax weee"> <span id="old-price-5600-widget-product-grid" data-price-amount="619" data-price-type="finalPrice" class="price-wrapper "><span class="price">${{p.price|float(2)}}</span></span> </span> </div> </div> </div> </li> {% endfor %} {% endrecommendations3 %} </ol> </div> </div> </div>
8. Save the template. 5. In the **Schedule** section, select the date when the dynamic content is activated. 6. In **Display settings**, configure the settings: - Set **Triggers** to **On landing**. - Leave **Delay** at default. - In the **Page targeting** section, select **Others**: - Under **Display on pages** banner, click **Add rule**. - From the dropdown list, select **Page containing URL**. - In the text field, enter the link to your basket. - Leave the rest of the settings at default.
`Screenshot presenting display settings`
Display settings
6. Confirm by clicking **Apply**. 7. In the **UTM & URL parameters** section, click **Skip step**. 8. Activate the dynamic content. 9. Create the second dynamic content template to display the recommendations with the other group bestselling shoes for specific terrain. Repeat all the steps. **Result**: The recommendation frames are displayed at the URLs with the empty basket. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of the campaign components directly in Synerise Demo workspace: - [AI recommendation configuration](https://app.synerise.com/ai-v2/recommendations/CjmCJ4X4RfRL), - [Dynamic content campaign](https://app.synerise.com/campaigns/create/1595de2d-86b9-44be-b435-154908667c8a), If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 5 events per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [API Recommendations](https://hub.synerise.com/api-reference/ai-recommendations#tag/Recommendations) - [Dynamic content campaigns](/docs/campaign/dynamiccontent) - [Recommendations](/docs/ai-hub/recommendations-v2) # Visualizing Value Distribution with Quantiles in Dashboards You can create a dashboard with quantile-type metrics to see how values is distributed and compare results between different cohorts and time periods. In this example, you will create a dashboard that displays quantile values (0.25; 0.50; 0.75) and average values of transaction amounts made by male and female customers. The use case can be modified easily by adding more metrics with other quantile values, or other conditions, such as using age groups or geographical location instead of sex, or using different events and attributes for the analysis. The process consists of two stages: - Creating eight metrics to include in the dashboard - Creating the dashboard ## Prerequisites --- - In this example, the customers' profiles must include information about their sex. ## Process --- In this use case, you will go through the following steps: 1. [Create eight metrics](/use-cases/understand-distribution#create-metrics) for `transaction.charge` event. 2. [Create dashboards](/use-cases/understand-distribution#create-dashboard) presented all metrics. ## Create metrics --- In this stage, you will create eight metrics for `transaction.charge` events. The procedure describes creating a single metric, you will need to repeat the steps for each metric separately, changing the conditions each time. 1. Go to Decision Hub icon **Decision Hub > Metrics > New metric**. 2. Give the metric a meaningful name. For the purpose of this example, the first metric is for quantile 0,25 of transactions made by females. 3. Leave **Type** at **Event**. 4. Change the **Aggregator** to **Quantile**. 5. In the input field which appears next to the aggregator, type `0,25` 5. Leave **Occurrence type** at **All**. 6. Click **Choose event** and select **transaction.charge**.
Events may have different labels between workspaces, but you can always find them by their action name (in this step, it's **transaction.charge**).
6. Next to the event selector, click **Choose param** and select **$totalAmount**. 7. Click **Enable filter**. 8. Click **Choose filter** and use the **Search** field to find and select the **Sex** attribute. 9. In the text field, type `1`.
Contact filter to include only female customers
Contact filter to include only female customers
The values for this parameter mean: - `0`: not specified - `1`: female - `2`: male - `3`: other
1. Click **Apply**. 2. Save the metric.
A completed quantile metric
A completed quantile metric
3. Create the remaining metrics: - For females: quantiles 0.5 and 0.75, and average value (**Average** is one of the aggregators) - For males: quantiles 0.25, 0.5, 0.75, and average value - Optionally, add metrics for the `undefined` and `other` values of the `sex` attribute.
You can do this faster by clicking **Three dots icon > Duplicate** next to a metric in the list of metrics and then modifying the conditions in the created duplicate.
## Create dashboard --- In this stage, you create a dashboard to display the results of all metrics in one place for easier analysis. 1. Go to Decision Hub icon **Decision Hub > Dashboards > Add dashboard**. 1. Add the metrics to the dashboard: 1. Click Metric icon. 2. Click the widget that appears. 3. From the **Metric** drop-down list, select one of the [metrics that you created previously](#create-metrics). 4. On the **Tab**, add two more decimal places to display (by default, none are displayed). 5. Repeat steps **2a-2d** until all the metrics are added. 2. Click **Save dashboard**. **Result:** You can now open the dashboard and use the **Date range** picker to check data for different periods.
A dashboard with eight metrics and an enabled date selector
A dashboard with eight metrics and an enabled date picker
To learn more about viewing, sharing, and formatting dashboards, see [this section of the User Guide](/docs/analytics/analytics-dashboard).
## Check the use case set up on the Synerise Demo workspace --- You can all items created in this use case in our Synerise Demo workspace: - [0,25 quantile of transactions made by females](https://app.synerise.com/analytics/metrics/75713c7f-1480-4377-b11a-0ab656660e08) - [0,5 quantile of transactions made by females](https://app.synerise.com/analytics/metrics/22423a36-6c96-49d0-b3c3-e19cd9ecf6c0) - [0,75 quantile of transactions made by females](https://app.synerise.com/analytics/metrics/7f0815d2-b6b4-445b-ad7d-386625a48ddd) - [Average of transactions made by females](https://app.synerise.com/analytics/metrics/3f334b83-bffe-4d67-a053-83c607afdc1d) - [0,25 quantile of transactions made by males](https://app.synerise.com/analytics/metrics/3192ab2d-35c4-4ad1-9de4-cdf9b75d9e02) - [0,5 quantile of transactions made by males](https://app.synerise.com/analytics/metrics/257c9129-9849-45b0-b7dc-f8ebaa28f788) - [0,75 quantile of transactions made by males](https://app.synerise.com/analytics/metrics/adc59fd7-c9c8-4b19-9921-97ec67e417c9) - [Average of transactions made by males](https://app.synerise.com/analytics/metrics/465fda5a-61c5-430a-b82c-d0993e774fa8) - [Dashboard with presented metrics](https://app.synerise.com/analytics/dashboards/836813e4-d660-49fa-969d-d7d866d8d90b) - [Dynamic content campaign](https://app.synerise.com/campaigns/create/37c5fadb-8628-47a4-ad8c-61a5e2b4a46b) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case does not generate any events. ## Read more --- - [Dashboards](/docs/analytics/analytics-dashboard) - [Metrics](/docs/analytics/metrics) # Campaign optimizer - Advanced configuration Campaign optimization is a very important feature that we develop to let you choose the best time and channel for your customers and send them messages with the highest chances for conversion.
Basic information about our campaign optimizer can be found [HERE](/use-cases/campaign-optimizer)
## Prerequisites --- **General** - Implement [Synerise tracker](/developers/web/installation-and-configuration#creating-a-tracking-code) on your website. - Channel optimization configuration. - [Email account configuration](/docs/campaign/e-mail/configuring-email-account). - [SMS account](/docs/settings/configuration/sms-account) configuration (integration e.g. with SMS API). - [Webpush integration](/docs/campaign/Webpush/configuring-web-push). - [Mobile Push integration](/docs/campaign/Mobile/mobile_campaign). - [Transactional events](/developers/web/transactions-sdk) implemented (optional). **AI time optimizer configuration** - Page visits & other campaign visits. ## Create predefined analytics --- At the very beginning, in order to achieve channel optimization, we have to use predefined analytics. Let’s say we want to use basic, predefined, CTR based channel optimization:
We are using this example to go through the process of configuring an optimized campaign. Please be aware that the base on which you calculate the optimization and metrics are fully customizable.
1. Create the predefined analytics. - First of all **segments** Choose the predefined segment matching the channel in which you want to send a campaign. For example: - (Default) Optimal Channel by CTR - mobile push - (Default) Optimal Channel by CTR - web push - (Default) Optimal Channel by CTR - email - (Default) Optimal Channel by CTR - sms Segment is based on scoring calculated in “optimal.channel” event. In its configuration we used the “Last” aggregate for ”optimal.channel” event with parameter “type:CTR”. - **Expressions** for all channels you want to use (e.g. email, sms, newsletter) - **Metrics** for all channels you want to use (e.g. email, sms, newsletter) 2. Create an example expression for a newsletter ratio CTR In these analytics we have to calculate the ratio between clicked and sent messages, but in order to achieve a proper reference we require that those customers be sent at least 5 campaigns. It should look like below. ![Screenshot presenting campaign optimizer](/api/docs/image/f8a57079df9dd82ae8b22dc747691385d7d51d29/use-cases/all-cases/_gfx/newsletterratio.png) For the calculation of the value of each channel, we can add the expression which meet the conditions described below: - Expressions for optimal individual channels are being compared if they are higher than the global metric​ - If the Expression is less than 5, then its value equals 0​ - If the Expression is lower than the metrics, then is not taken into consideration in comparison ​ - If all expressions are lower than metrics, then we randomly select a channel​ - If all expressions return 0, then we randomly select a channel It can look like this:
<!-- candidates -->
{% set NEWSLETTER = {"name": "NEWSLETTER", "expression":0, "metric":0} %}
{% set MOBILE_PUSH = {"name": "MOBILE_PUSH", "expression":0, "metric":0}%}

{% set CANDIDATES = [NEWSLETTER, MOBILE_PUSH]%}

<!-- value assignment -->
{% expressionvar 37368423-6210-4ee4-bd67-5e2143544576 %}{% do
NEWSLETTER.update({"expression": expression_result})%}{%endexpressionvar%}
{metricsvar metric_id:550060f2-4feb-a6a5-46e8ad01b8ac%}{%do
NEWSLETTER.update({"metric_result})%}{% endmetricsvar %}
{% expressionvar 6e3206d9-708a-4fc5-bfe4-88fea18da90f %}{% do
MOBILE_PUSH.update({"expression_result})%}{% endexpressionvar %}
{% metricsvar metric_id:85651a3a-5163-4b1f-971a-4109e83bf753 %}{% do
MOBILE_PUSH.update ({"metric":metric_result})%}{% endmetricsvar %}

<!-- candidates by expression-->
{set expression_winners = [] %}
{% for candidat in CANDIDATES %}
    {% if candidat["expression"] > candidat ["metric"] %}
        {% do expression_winners.append(candidat)%}
    {% endif %}
{% endfor %}

<!-- print winner-->
{% if expression_winners|count !=0 %}
    {% set winner = expression_winners|sort(true, true, 'expression')|first %}
{% else %}
    {% set winner = CANDIDATES|random %}
{% endif %}

{{winner}}
Everything here is based on jinjava, which produced the event at the very end of this calculation. Based on that we can actually select the segment in which we want to send the message automatically. ## Generated events This use case does not generate any events. ## Read more --- - [Aggregates](/docs/crm/aggregates/introduction-to-aggregates) - [Automation Hub](/docs/automation) - [Basic optimizer configuration](/use-cases/campaign-optimizer) - [Build segmentation](/docs/analytics/segmentations/creating-segmentations) - [Expressions](/docs/crm/expressions) - [Metrics](/docs/analytics/metrics) # Gravity Form integration If you use the Gravity Form plugin for building custom forms in WordPress, you can use webhooks to send data from forms to Synerise. In this use case, the answers from the form are saved as the event parameters on a customer's profile.
Completing this procedure requires some knowledge on sending API requests using cURL, Postman, or similar tools.
You may want to split your browser window into two. In one browser window, open the WordPress account, in the other, log in to the Synerise application.
## Prerequisites --- - Create a form in Gravity Form plugin. The example form used in this use case contains three pieces of information: - Email address of a user who submits the form - The name of the form - A question about a vehicle condition - Install and activate [the webhooks add-on](https://docs.gravityforms.com/installing-a-gravity-forms-add-on/) in your WordPress account. ## Process --- In this use case, you will go through the following steps: 1. [Create an incoming webhook](/use-cases/gravity-form-integration#create-an-incoming-webhook). 2. [Create a webhook in Gravity Form](/use-cases/gravity-form-integration#create-a-webhook-in-gravity-form). 3. [Finish incoming integration](/use-cases/gravity-form-integration#finish-incoming-integration). 4. [Create a workflow](/use-cases/gravity-form-integration#create-a-workflow). 5. [Testing](/use-cases/gravity-form-integration#testing). ## Create an incoming webhook --- In this part of the process, create an incoming webhook to which you will send the data submitted through Gravity forms. 1. In Synerise, go to **Automation Hub > Incoming > New integration**. 2. Enter the name of the webhook. 3. In the **Endpoint** section, click **Define**.
The URL field is already is filled in with the endpoint to which the data submitted through the form will be sent.
1. Optionally, you can add an icon to this integration. 3. Confirm by clicking **Apply**. 4. Click **Finish later**. **Result**: The incoming webhook is saved as a draft. ## Create a webhook in Gravity Form --- In this part of the process, you need to configure the webhook which will send data from the form to Synerise. 1. In the WordPress account, go to **Form Settings > Webhooks tab**, and then click the **Add New** button. 2. Fill in the form: 1. In the **Name** field, enter a name for your form. 2. In the **Request URL**, enter the Synerise endpoint URL from step 3 in [Creating an incoming webhook](/use-cases/gravity-form-integration#create-an-incoming-webhook) procedure. 3. From the **Request method** dropdown list, select **POST** method. 4. From the **Requested Format** dropdown list, select **JSON** format. 5. In the **Request body** input, choose **Select fields** (recommended set-up).
- The **Select Fields** option displays the field values setting which let you define what you send to Synerise. - The **All Fields** option sends the entire unformatted entry.
6. In the **Field Values** inputs, define how each entry from the survey should be sent in the webhook response. - In the **Key** column, enter the name of variables visible in the webhook response.
Use letters only without diacritical characters.
- In the **Value** column, enter the question in the form that is assigned to the key. 7. Confirm the settings by clicking **Update settings**. **Result**: From now, everytime somebody submits the survey, the request will be sent to the Synerise endpoint.
Configuration of the Gravity form webhooks
Configuration of the Gravity form webhooks
## Finish incoming integration --- Go back to creating the incoming webhook in Synerise. 1. In Synerise, go to **Automation Hub > Incoming**. 2. On the list, find the draft incoming integration you created in step [Create an incoming webhook](/use-cases/gravity-form-integration#create-an-incoming-webhook). 3. In the **Incoming data** section, click **Define**. 6. Fill in the form you created in Gravity Forms and submit it. Alternatively, you can send a request in Postman to this endpoint. Example request:
Replace the body of the request with a sample of the data you will send from the form
curl --location --request POST 'ENDPOINT_URL_FROM_STEP_3' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "email": "john.doe@example.com",
        "formType": "formTitle",
        "VehicleCondition": "neutral",
    }'
5. In the **Incoming data** section in Synerise, click **Retrieve data**. The system waits for the incoming request for 1 minute and 30 seconds. ## Create a workflow --- In this part of the process, you create a workflow in Synerise. The workflow starts with the business event trigger that is launched every time a customer submits the form. In response to that, on the profile of the customer who submitted the form, an event is saved with the answers in the survey in the form of parameters. 1. Go to **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. 3. As the first node, select **Business Event**. In the configuration of the node: 1. Select the incoming webhook you created as the first part of this use case. 2. Confirm by clicking **Apply**.
Configuring the Business Event node
Configuring the Business Event node
4. Add the **Outgoing integration** to the workflow. In the configuration of the node: 1. Change the webhook type to **Custom**. 2. As the connection type, select **API Key**. 3. Click **Select connection** and select a connection. If you want to create a connection, click **Add connection** and [create it](/docs/automation/actions/webhook-node#set-up-a-connection). 1. Enter the name of the webhook. This name will be used as the value of the `name` parameter of the event generated by this integration. 3. In **Webhook event name**, click **Create event** and create a new event: 1. As **Name**, enter `gravityform.submit` 2. As **Display name**, enter `Gravity Form survey submitted` 2. Select the **POST** method. 3. Enter the endpoint URL: - For workspaces hosted in Microsoft Azure EU server: `https://api.synerise.com/v4/events/custom` - For workspaces hosted in Microsoft Azure USA server: `https://api.azu.synerise.com/v4/events/custom` - For workspaces hosted in Google Cloud Platform: `https://api.geb.synerise.com/v4/events/custom` 4. Enter the following headers: - set the `content-type` header to `application/json` (default), - set the `accept` header to `application/json`, - set the `api-version` header to `4.4` 5. Enter the request body. For the form used in this case, the body is as follows:
{
           "action": "form.submit",
           "label": "Customer submitted a survey",
           "client": {
               "email": "{{request.body.email}}"
           },
           "params": {
               "formTitle": "{{request.body.formTitle}}",
               "VehicleCondition": "{{request.body.VehicleCondition}}"
           }
       }
Learn more about reusing data from incoming integrations in the Outgoing Integration node [here](/docs/automation/integration/incoming-webhook-node#example-of-use)
6. Confirm by clicking **Apply**.
Configuring the Outgoing Integration node
Configuring the Outgoing Integration node
7. Add the **End** node. 8. Activate your workflow by clicking **Save & Run**.
Automation Hub workflow for Gravity Forms data integration
Final workflow configuration
## Testing --- Fill in your survey and check if data is collected in Synerise properly. Open the workflow statistics and the survey. Fill in the survey, send it, and observe the statistics. If the **Entered** and **Executed** counters increment, your survey triggered the workflow and completed it.
Automation Hub workflow for Gravity Forms data integration
Final workflow configuration
The profile whose identifier was entered in the survey is updated.
Event with survey on a customer's profile
Event with survey on a customer's profile
## Generated events This use case generates approximately 6 events per profile that completes the flow: `incoming webhook event` (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`webhook.response`](/docs/assets/events/event-reference/integration#webhookresponse-and-custom-webhook-response-names) (~1), [`form.submit`](/docs/assets/events/event-reference/web-and-app#formsubmit) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Integration](/docs/automation/integration) # Adding mix of social proof to product pages In today's digital landscape, where the abundance of options and information can be overwhelming, purchasing decisions or content choices often rely on trust and social recommendations. Social proof, plays a pivotal role in shaping online user behavior. It revolves around the notion that individuals are more inclined to trust the actions of others than their own instincts, particularly when those actions are visible and relatable. Social proof is a metric with a dynamic key, thanks to which the statistics on a product page will be displayed in real time and they will adjust to the product that is being currently viewed. This use case will focus on how implementing basic social proof mechanisms centered around various recent events can effectively drive user interactions. We will present you the mechanism of creating basic social proof mix showing three scenarios: - the number of visitors to the product page during last 24 hours, - the number of customers who bought the product during last 24 hours, - the number of customers who added the product to the wishlist during last 24 hours. You can implement all of them (or chosen one) directly to your website thanks to our ready-to-use template.
The view of social proof mix
## Prerequisites --- - Implement a [tracking code](/docs/settings/tool/tracking_codes). - Manage [transaction events](/developers/web/transactions-sdk). ## Process --- To prepare social proof, you have to create dynamic content with a metric, which will dynamically count particular event occurrence for each product. Perform the steps in the following order: 1. [Create a metric counting page views](/use-cases/social-proof-basics#create-metric-for-page-views). 1. [Create a metric counting product purchases](/use-cases/social-proof-basics#create-metric-for-products-bought). 1. [Create metric counting occurrences of adding the product to the wishlist](/use-cases/social-proof-basics#create-metric-for-adding-product-to-the-wishlist). 2. [Prepare a dynamic content](/use-cases/social-proof-basics#prepare-a-dynamic-content). ## Create metric for page views --- If you want to display a message that X customers viewed the product in the last X hours, you have to prepare a metric that counts the occurrences of the [`page.visit` event](/docs/assets/events/event-reference/web-and-app#pagevisit) for a specific product. For that purpose, we will create [a dynamic key](/docs/analytics/i_events-parameter-value#dynamic-key) - `sku` which will analyze values sent through the `retailer_part_no` parameter of the `page.visit` event. 1. Go to **Decision Hub > Metrics > New metric**. 2. Leave the **Type**, **Aggregator** and **Occurrence** options at default (**Event**, **Count**, and **All**, respectively). 3. From the **Choose event** dropdown list, select **page.visit**. 4. Click the **+ where** and select the **product:retailer_part_no** parameter or any other which indicates ID of the product. 5. From the **Choose operator** select **Equal**. 6. Click the icon next to the logic operator and keep clicking until you get Choose value icon. 6. In the left field, enter `sku`. 7. In the right field, enter the value of the SKU (0 in our example). 8. Define time from which metric counts the page visit, for example last 24 hours.
Screenshot presenting Metric with page visit
Metric counting page visits in the last 24 hours
### Create metric for products bought If you want to display a message that X customers bought the product in the last 24 hours, you have to prepare a metric that counts occurrences of the [product.buy event] for a specific product. For that purpose, we will create [a dynamic key](/docs/analytics/i_events-parameter-value#dynamic-key) - `sku` which will analyze values sent through the `$sku` parameter of the [`product.buy` event](/docs/assets/events/event-reference/items#productbuy). 1. Go to **Decision Hub > Metrics > New metric**. 2. Leave the **Type**, **Aggregator** and **Occurrence** options at default (**Event**, **Count**, and **All**, respectively). 3. From the **Choose event** dropdown list, select **product.buy**. 4. Click the **+ where** button and select a parameter that indicates a product ID (in this case, it's **$sku**). 5. From the **Choose operator**, select **Equal**. 6. Click the icon next to the logic operator and keep clicking until you get Choose value icon. 6. In the left field, enter `sku`. 7. In the right field, enter the value of the SKU (0 in our example). 8. Define time range for analyzing events (24 hours in our example).
Screenshot presenting Metric filter
Metric counting purchased products in last 24 hours
### Create metric for adding product to the wishlist If you want to display a message that X customers added the product to the wishlist in the last X hours, you have to prepare a metric that counts occurrences of the [`product.addToWishlist` event](/docs/assets/events/event-reference/items#productaddtofavorite) for a specific product. For that purpose, we will create [a dynamic key](/docs/analytics/i_events-parameter-value#dynamic-key) - `sku` which will analyze values sent through the `$sku` parameter of the `product.addToWishlist` event. 1. Go to **Decision Hub > Metrics > New metric**. 2. Leave the **Type**, **Aggregator** and **Occurrence** options at default (**Event**, **Count**, and **All**, respectively). 3. From the **Choose event** dropdown list, select **product.addToWishlist**. 4. Click the **+ where** button and select a parameter that indicates a product ID (in this case, it's **$sku**). 5. From the **Choose operator**, select **Equal**. 6. Click the icon next to the logic operator and keep clicking until you get Choose value icon. 6. In the left field, enter `sku`. 7. In the right field, enter the value of the SKU (0 in our example). 8. Define time range for analyzing events (24 hours in our example)
Screenshot presenting Metric filter
Metric counting products added to the wishlist in last 24 hours
## Prepare a dynamic content --- To show a social proof on your website, you need to use a dynamic content. You can use the ready-to-use template displayed as an insert on the page of every product which is used in this use case. You can customize the design of the template, adjust the time frame (in the settings of a specific metric), rearrange and modify the content according to your business needs. What is more, you can use dynamic content as a carousel which displays those 3 metrics, but you can also include fewer metric variants.
- When a product meets the conditions of at least one metric, a carousel will be displayed (in the static version). - If a product meets conditions of more than one metric, the carousel will activate and loop to display information from each metric. In this version, up to 3 metrics can be showcased, meaning a maximum of 3 pieces of information will be displayed.
1. Go to **Experience Hub > Dynamic content > Create New**. 2. Choose the **Insert Object** type of campaign. 3. In the **Audience** section, select **Everyone**. 4. In the **Content** section, select **Simple message** and by inserting CSS selector define where the social proof will display on your website. 5. In the **Content** tab, click **Create Message** and go to **Web layer templates** folder. Choose **Social Proof Carousel** template. 6. Customize the template layout according to your needs. In the template configuration, there are three types of variables to edit based on the three metrics created in the previous parts of the process: - Header and metric content - define the title and main information displayed in the social proof such as time period from which metric shows results. In the metric ID field, add the identifier of the metric (which is available on the list of metrics). - Styling settings - you can use them to define the design of the social proof such as text color, background, font size, and others. - Additional carousel settings - these settings let you define carousel speed, switch times, and delay time (given in milliseconds). 7. When your template is ready, save your changes. 6. Schedule when the dynamic content has to be active 8. In the **Display settings**, define the circumstances the dynamic content will be shown: - **Always on landing**, on All pages if in CSS selector is unique selector for a product page. - Always on landing, **on a specific URL** which indicates a product page (for example, if a URL contains product), if CSS selector is not unique for a product page. Read more about [defining url targeting](/docs/campaign/dynamiccontent/creating-dynamic-content/creating-dynamic-content#define-url-targeting). 4. Save and activate the campaign. ## Check the use case set up on the Synerise Demo workspace --- Check all items (metrics and dynamic content) created in this use case in our Synerise Demo workspace: - [Metric that returns the number of visits in last 24 hours](https://app.synerise.com/analytics/metrics/9f3c5d20-dabf-40f4-980b-2c68b5249364), - [Metric that returns the number of times an item was sold in last 24 hours](https://app.synerise.com/analytics/metrics/bca7cdc9-8096-4cd6-a813-e5e978d613f9), - [Metric that returns the number of times a product was added to wishlist](https://app.synerise.com/analytics/metrics/dd0cb02a-6cec-46e4-81a1-62b414a17d74), - [Dynamic content template](https://app.synerise.com/campaigns/dynamic-content/preview/10e783a0-009a-4e06-90fa-557295c75572). If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 2 events per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1). ## Read more --- - [Dynamic content](/docs/campaign/dynamiccontent) - [Dynamic key](/docs/analytics/i_events-parameter-value#dynamic-key) - [Metrics](/docs/analytics/metrics/introduction-to-metrics) # Email with discount for those who left the site If customers were on your site and visited specific product pages, then they probably did not land on it by accident. They wanted to go beyond the main page and learn more about you and your offer. So even if they did not complete a transaction you can reach them with an attractive offer by, for example, sending them a discount in the email. It can encourage them to make a transaction and come back to your site and **use discount to buy products** they previously viewed. ## Example of use - Retail industry A customer from the fashion industry has prepared a different promotion for every day of Black Week. They informed users about it on their site through additional banners. However, they decided to use email as a communication channel with customers who were on the site, visited a product, but did not make a purchase. After leaving the site, these customers received information about the **discount code in an email**. It was made to encourage them to come back and finish their purchase process.
Screenshot presenting ab tests
A/B Test
**Results** - OR **10,31%** - CTOR **31,05%** - Conversion **2,6%** ## Prerequisites --- To implement this use case, check those articles: - [Tracking code](/docs/settings/tool/tracking_codes) - [OG tags implemented](/developers/web/og-tags) - [Transaction events tracking](/developers/web/transactions-sdk) - [Email account configuration](/docs/campaign/e-mail/configuring-email-account) ## Process --- To create an email with discount for those who left the site, perform the following steps: 1. [Prepare coupons](/use-cases/discount_for_those_who_left_the_site#prepare-coupons) 2. [Prepare an email template](/use-cases/discount_for_those_who_left_the_site#prepare-an-email-template) 3. [Create a workflow](/use-cases/discount_for_those_who_left_the_site#create-a-workflow) ## Prepare coupons ---
In [this](/docs/assets/code-pools) article, you will find the rules and procedures needed to create and use voucher pool in Synerise.
Depending on your needs, you can send to user general code with promotion, eg. SHOPPING20%, or coupon code individually for each user. If you decide on this second option you will have to import to Synerise coupons previously prepared in your ecommerce platform which will apply the appropriate discount in the shopping cart. 1. Go to [Vouchers](https://app.synerise.com/spa/modules/vouchers/pools/) and prepare a Voucher pool, to which you will add coupons. 2. Add an obligatory **Pool name**, and set the **Emission** start and **end dates**. 3. When the pool is created, click Import and choose CSV with vouchers.
`Screenshot presenting new coupons pool``
New coupons pool
{{< tip >}} Remember, that your csv should have only 1 column, without a name. {{< /tip >}} ## Prepare an email template --- 1. Go to **Campaign > Email**. 2. To distribute coupon codes, prepare an email template - design banners, copy and add the ID of the coupon pool. 3. Click **Inserts** in the upper right corner, find **Pools** on the list of inserts. 4. Choose previously a prepared Coupon pool and copy and paste it in the place where the coupon code should be shown to the user. Instead of `{% voucher %} voucher-hash {% endvoucher %}`, user will see his individual coupon code.
`Screenshot presenting email template`
Preparing email template
{{< tip >}} If you would like to send the same coupon code to the user twice, eg. after 1 day if user still doesn’t make a purchase, use the same voucher hash, but add flag assign=false, like in this example: **{% voucher assign=false %} voucher-hash {% endvoucher %}** {{< /tip >}} ## Create a workflow --- To send emails to customers you will have to prepare a workflow. 1. Go to **Automation Hub > Workflow.** 2. Start with the **Profile Event** trigger and in the settings of the node, select the **page.visit** event. 2. As the event parameter, select **retailer_part_no** - this way, the workflow starts only when a customer visits a product page. This way the workflow will be started only by a product page visit. {{< tip >}} Use "." in a regular expression to accept a valid value of this parameter (except for null). This way, you know that this event has the **retailer_part_no** parameter. {{< /tip >}}
`Screenshot presenting Profile Event`
Configuration of the Profile Event node
2. Add **Delay** and define the lag between the page visit and sending the message, in our example it is 2 hours.
`Screenshot presenting delay``
Configuration of the Delay node
3. Using the **Profile Filter** node, exclude users who have made a transaction in the last 2 hours – it's important to use minutes instead of hours.
`Screenshot presenting profile filter`
Configuration of the Profile Filter node
4. Configure the **Send Email** node by selecting the appropriate email account, choosing the template that you prepared in the previous step.
`Screenshot presenting content`
Configuration of the Send Email node
5. Specify capping to limit the number of coupons user will get (here it’s 1 for each 30 days). 6. Add End nodes where the workflow should finish for users. 7. Optionally, add titles to each node so the workflow will be more understandable for your colleagues. 8. Name the workflow and Save it or **Save & Run**.
`Screenshot presenting automation``
Workflow
## Check the use case set up on the Synerise Demo workspace --- Check the [workflow](https://app.synerise.com/automations/automation-diagram/e79a8874-7a68-474d-aa69-77d6fac6789f) in our Synerise Demo workspace. {{% include "/reuse/use-cases/synerise-demo-workspace.md" %}} ## Generated events This use case generates approximately 10 events per profile that completes the flow: [`page.visit`](/docs/assets/events/event-reference/web-and-app#pagevisit) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`voucherCode.assigned`](/docs/assets/events/event-reference/loyalty#vouchercodeassigned) (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Email templates](/docs/campaign/e-mail) # Anniversary of the transaction Happy customers are loyal customers. Satisfied customers are those who become advocates for your business and help you grow it by sharing their positive experiences with others. To perpetuate positive customer experiences, you need to make them feel appreciated and noticed. For example, you can use transaction history to identify individuals with a transaction anniversary on the current day and reward them with a discount code delivered in the form of a mobile push message. This use case describes the process of creating a workflow that will send a mobile push with a promo code to a segment of customers who have a transaction anniversary on the current day. ## Prerequisites --- - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#tag/Events). - Implement mobile push notifications in your mobile application: [iOS](/developers/mobile-sdk/configuring-push-notifications/ios), [Android](/developers/mobile-sdk/configuring-push-notifications/android). - Create a [voucher pool](/docs/assets/code-pools). ## Process --- 1. [Create an aggregate](/use-cases/transaction_anniversary#prepare-an-aggregate) that returns the timestamp of the customer's first transaction. 3. [Create a mobile push template](/use-cases/transaction_anniversary#create-mobile-push-template) 2. [Create a workflow](/use-cases/transaction_anniversary#create-a-workflow) that sends a mobile push with a discount code for the customers who made their first transaction exactly one year ago. ## Prepare an aggregate --- Build an aggregate that returns the timestamp of the customer's first transaction. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **First**. 4. Select the **transaction.charge** event. 5. As the event parameter, select **TIMESTAMP**. 6. Set the period from which the aggregate will analyze the event to **Lifetime**. 7. Save the aggregate.
Decision Hub First aggregate returning the TIMESTAMP of the first transaction.charge event over a customer's lifetime
Configuration of the aggregate
## Create mobile push template --- 1. Go to **Experience Hub > Mobile Push > Templates**. 2. You can use the template from the folder or create your own one using the mobile push code editor. To use the template, click **New Template**. 3. Choose what type of message you want to create. In our case it's **Simple Push**. 4. Choose how you want to create a mobile push message. In this use case, we will use **Visual Builder**. 5. Create your mobile push message according to your business needs. For more information on creating a simple mobile push, visit our [User Guide](/docs/campaign/Mobile/creating-mobile-push). To add a voucher code in the form of the barcode, add the following insert:
{% vouchervar id=uuid_of_voucher_pool  %}
{% barcode code= {{voucher_result}}, gray=true, type=barcode_type, hrp=BOTTOM %}
{% endvouchervar %}
Mobile push template example
Mobile push template example
## Create a workflow --- In this part of the process, create a workflow that will manage mobile push notifications with a promo code for customers with an anniversary of transaction. The mobile notifications will be sent once a day to the segment of customers whose transaction anniversary falls on the current day. 1. Go to **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. 3. As the first node of the workflow, add **Audience**. In the configuration of the node: 1. Select **New audience** and **Define conditions**. 2. From **Choose event** dropdown menu, select the aggregate created in the [previous step](/use-cases/transaction_anniversary#prepare-an-aggregate). 3. From the **Choose operator** dropdown menu, select **Date > Current date > Matches current day**. 4. From **Choose filter** dropdown menu, select the [aggreagate](/use-cases/transaction_anniversary#prepare-an-aggregate). 5. From the **Choose operator** dropdown menu, select **Date > Current date > Matches current month**. 6. From **Choose filter** dropdown menu, select the [aggreagate](/use-cases/transaction_anniversary#prepare-an-aggregate). 7. From the **Choose operator** dropdown menu, select **Date > Current date > Matches current year**. 8. In the condition **Matches current year** define the attribute Contacts **not matching**. 9. Confirm your audience settings by clicking **Apply**. 10. Confirm by clicking **Apply**. 4. As the next node, add **Send Mobile Push**. In the configuration of the node: 1. Define the **Template type**. 2. Select the **Push template** you have created. 3. Confirm by clicking **Apply**. 5. Add the **End** node to finish the workflow. 6. Set a workflow capping where each customer can run a workflow once every 12 months. In the configuration of the **Capping**: 1. Define **Limit** as `1`. 2. Define the **Time** to `12 month`. 3. Confirm by clicking **Apply**. 7. To run the workflow, click **Save & Run**.
Configuration of the worflow
Configuration of the workflow
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of each step from this use case in our Synerise Demo workspace: - [Aggregate](https://app.synerise.com/analytics/aggregates/378f75ac-c7a3-3658-bf56-174facc48587) - [Voucher pool](https://app.synerise.com/assets/vouchers/pools/0b0c1720-e9b3-4185-ae04-0df0e16a989a/coupons) - [Workflow](https://app.synerise.com/automations/automation-diagram/bb591c14-3f83-4769-bd82-0e1c16cd423b) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 7 events per profile that completes the flow: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`push.send`](/docs/assets/events/event-reference/mobile-push#pushsend) (~1), [`push.view`](/docs/assets/events/event-reference/mobile-push#pushview) (~1), [`push.click`](/docs/assets/events/event-reference/mobile-push#pushclick) (~1), [`voucherCode.assigned`](/docs/assets/events/event-reference/loyalty#vouchercodeassigned) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates/introduction-to-aggregates) - [Jinjava inserts](/developers/inserts) - [Segmentation](/docs/analytics/segmentations) - [Mobile push](/docs/campaign/Mobile/creating-mobile-push) - [Workflow](/docs/automation/creating-automation) - [Voucher pools](/docs/assets/code-pools) # Message Duplication Prevention for SMS Campaigns Based on Unique Phone Numbers This use case presents a solution to prevent sending the same message to the profiles who have the same phone number. Sharing the same phone number by profiles may happen for example, when a person leaves the company and a new employee takes over a work phone with the phone number of the previous employee; or when a person creates two accounts with different personal data but the same phone number. The core idea of this use case is to check the database for the same phone number and ensure that only one message is sent out when multiple profiles have the same number. This solution is designed to save costs and ensure that profiles do not receive unnecessary messages. The assumption of this use case is importing all customers with unique phone numbers and enabled marketing agreement in the SMS channel to a catalog. All these customers will have a `phone_unique` tag assigned to them. Then, every time a customer enables SMS marketing agreement a workflow will verify whether the phone number for this customer is unique. If so, it will be tagged with `phon_unique`.
We recommend using the `phone_unique` tag for addressing recipients in mass campaigns to all customers (for example, general information about important changes that do not contain personalization). It is not necessary for real-time campaigns, especially those triggered by specific user behaviors and activities such as entering a page, purchasing, and so on, because there is a small probability of sending the same message several times to one number. However, this risk is high with large and mass shipments. It is important to be careful with the personalization of such messages, especially without additional verification of ness of the phone number.
## Prerequisites --- - Create a catalog in Synerise in which you will store customers with unique phone numbers This will allow you to select customers with a `phone_unique` tag as the recipients of your future SMS campaigns - this way you will make sure each customer won't receive the same message several times. - In **Data Modeling Hub > Profile Tags**, [add the following tag](/docs/assets/tags): `phone_unique` It will be used later in the process. - Create a workspace [API Key](/docs/settings/tool/api) which you will use in the process. ## Process --- In this use case, you will go through the following steps: 1. [Create a segmentation](/use-cases/double-phone-number#create-a-segmentation) to group customers who have a phone number assigned and enabled marketing agreement in the SMS channel. 2. [Create a workflow which sends the customers from the segmentation to the catalog](/use-cases/double-phone-number#create-a-workflow-which-sends-the-customers-from-the-segmentation-to-the-catalog). 3. [Download the file with customers from the catalog](/use-cases/double-phone-number#export-the-file-from-the-catalog). 4. [Transform data](/use-cases/double-phone-number#transform-data) in the file: add a column with a `phone_unique` tag, remove `item_key` column, and rename the `id` column. 5. [Create a workflow which imports the modified file with customers to Synerise](/use-cases/double-phone-number#create-a-workflow-which-imports-the-modified-file-with-customers-to-synerise). 6. [Create a workflow that verifies uniqueness of the phone number and assigns a tag to a customer](/use-cases/double-phone-number#create-a-workflow-that-verifies-uniqueness-of-the-phone-number-and-assigns-a-tag-to-a-customer). 7. [Create a workflow that deletes a tag when a customer withdraws consent for receiving SMS](/use-cases/double-phone-number#create-a-workflow-that-deletes-a-tag-when-a-customer-withdraws-consent-for-receiving-sms). ## Create a segmentation --- In this part of the process, you will create a segmentation of customers who have a phone number and enabled a marketing agreement in the SMS channel. 1. Go to Decision Hub icon**Decision Hub > Segmentations > New segmentation**. 3. Enter the name of the segmentation. 4. From the **Add condition** dropdown list, select the `phone` attribute. 5. Click the **Choose** button, and from the list of operators, choose **Boolean**, and then select **Is true**. 4. From the **Add condition** dropdown list, select the `SMS agreement` attribute. 5. Click the **Choose** button, and from the list of operators, choose **Boolean**, and then select **Is true**. 6. Save the segmentation.
Decision Hub segmentation configuration filtering customers with a phone number and SMS agreement
Segmentation configuration
## Create a workflow which sends the customers from the segmentation to the catalog --- In this part of the process, you will create a workflow that imports customer data (phone number) to a file and sends it to the catalog you created as a part of prerequisites. The data will be deduplicated, which means the catalog will contain only unique phone numbers. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Scheduled Run trigger node --- At this stage, configure the conditions that trigger the workflow. 1. As the trigger node, select **Scheduled Run**. 2. In the configuration of the node: 1. Change the **Run trigger** option to **one time**. 2. Choose the **Immediately** option. 3. Confirm by clicking **Apply**.
Automation Hub Scheduled Run node configured for a one-time immediate run to trigger customer data export to catalog
The configuration of the Scheduled Run node
### Select customers to export --- In this part of the process, select a [segmentation of customers you created in the previous part of the process](#create-a-segmentation). Then, you will select the attribute (`phone`) whose value will be exported to a catalog in further steps. 1. Add the **Get Profiles** node. 2. In the configuration of the node: 1. Select the segmentation you [created in the previous step](#create-a-segmentation) to extract customers’ data. 2. In the **Attributes** section, select **phone**. 3. Confirm by clicking **Apply**.
Automation Hub Get Profiles node selecting customers by segmentation with phone attribute to export
The configuration of the Get Profiles node
### Add the Import to Catalog node --- In this part of the process, select a catalog to which the customer data will be imported. 1. Add the **Import to Catalog** node. 2. In the configuration of the node: 1. Select the catalog created as a part of the prerequisites to which the data will be imported. 2. In the **Primary key** field, enter the `phone` attribute. 3. Confirm by clicking **Apply**.
The configuration of the Import to Catalog node
The configuration of the Import to Catalog node
### Prepare the final settings --- 1. Add the **End** node and connect it to the **Import to Catalog** node. 3. Optionally, add titles to each node so the workflow will be more understandable to your colleagues.
Screenshot presenting workflow
Prepare workflow
5. Activate the workflow by clicking **Save & Run**. **Result**: The data will be sent to a catalog and de-duplicated during import. ## Export the file from the catalog --- In this part of the process, you will download the file you imported to the catalog. 1. Go to **Data Modeling Hub > Catalogs**. 2. Choose the catalog from the list. 3. To download the file with your data, click **Download CSV** . In the next step, you will use the exported file to create a data transformation rule which you will use further in the process in the Data Transformation node. ## Transform data --- In this part of the process, you will perform the following modifications to the file: - remove the `item_key` column - rename the `id` column to `clientId` - add the `tags` column with the `phone_unique` value 1. Go to Automation Hub icon **Automation > Data Transformation > Create transformation**. 2. Enter the name of the transformation. 3. Click **Add input**. ### Add file with sample data --- The **Data input** node allows you to add a file to be modified. In further steps, you define how the data in the file will be modified (transformation rules). Later, when this transformation is used in the workflow in the [Data Transformation node](/docs/automation/operation/data-transformation-node), the system uses the rules to transform a file selected in the workflow. 1. On the pop-up, click **Add example**. 2. Upload the file exported in [the previous step](/use-cases/double-phone-number#export-the-file-from-the-catalog). 3. Click **Apply**. ### Remove column --- Use the **Remove columns** node, which allows you to remove the `item_key` column. 1. On the **Data Input** node, click the grey dot. 2. From the dropdown list, select **Remove columns**. 4. In the configuration of the node: 1. Leave the **Remove Columns** option selected in the dropdown menu. 2. Leave the default value in the dropdown (**Equal**). 3. In the text field, enter `item_key`.
The configuration of the Remove columns node
The configuration of the Remove columns node
6. Confirm by clicking **Apply**. ### Rename column --- In this part of the process, change the name of the `id` column to `clientId`. 1. On the **Filter column** node, click the grey dot. 8. From the dropdown list, select **Rename column**. 9. Click the **Rename column** node. 10. In the configuration of the node: 1. Click **Add rule**. 2. Click **Add column**. 3. Select the **id** column. 4. Under **Edit values by**, from the dropdown list, select **Replacing**. 6. In the text field, enter `clientId`.
The configuration of the Rename column node
The configuration of the Rename column node
7. Confirm by clicking **Apply**. ### Add the new column --- In this part of the process, you will add the new `tags` column with the `phone_unique` value. 1. On the **Rename Column** node, click the grey dot. 2. From the dropdown list, select **Add column**. 9. Click the **Add column** node. 10. In the configuration of the node: 1. In the **Add column** field, enter the name of the column. In this use case, it's `tags`. 3. From the dropdown list, select **Static value**. 4. In the value box, enter `phone_unique`. 5. Leave **Handle incomplete data** at default (**Skip row if error occurred**) to skip missing or invalid data which may occur during transformation. 7. Confirm by clicking **Apply**.
The configuration of the Add new column node
The configuration of the Add new column node
### Add the finishing node --- This node lets you preview the output of the transformation rules applied to the file. 1. On the **Add column** node, click the grey dot. 2. From the dropdown list, select **Data Output**. 3. To preview the results, click the **Data Output** node.
The preview of modifications to the file
The preview of modifications to the file
4. Close the preview 3. In the upper right corner, click **Save and publish**.
Data Transformation diagram for processing customer data to handle duplicate phone numbers
The diagram of data transformation
## Create a workflow which imports the modified file with customers to Synerise --- In this part of the process, you will create a workflow that applies transformation rules you created in the [previous part of the process](#transform-data) to the file with customers data and import the modified file to Synerise. As a result, the profiles will be updated. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Scheduled Run trigger node --- At this stage, you will define the conditions that launch the workflow. 1. As the trigger node, add **Scheduled Run**. 2. In the configuration of the node: 1. Change the **Run trigger** option to **one time**. 2. Choose the **Immediately** option. 4. Confirm by clicking **Apply**.
Automation Hub Scheduled Run node configured for a one-time immediate run to trigger modified customer data import to Synerise
The configuration of the Scheduled Run node
### Select file to import --- Select the file you exported in [part of the process](#export-the-file-from-the-catalog). 1. Add the **Local File** node. 2. In the configuration of the node: 1. Upload the file. 2. Confirm by clicking **Apply**.
Local File transfer
Local File transfer
### Add Data Transformation node --- Select a data transformation rule you created [in this part of the process](#transform-data). 1. Add the **Data Transformation** node. 2. In the configuration of the node, select the [data transformation you have created before](#transform-data).
The configuration of the Data Transformation node
The configuration of the Data Transformation node
3. Confirm by clicking **Apply**. ### Add import profiles and finishing node --- In this part of the process, you will import the transformed file with customers to Synerise. 1. Add the **Import Profiles** node. 2. Add the **End** node. 3. In the upper right corner, click **Save & Run**.
Automation Hub workflow for handling customers with duplicate phone numbers
The workflow configuration
## Create a workflow that verifies uniqueness of the phone number and assigns a tag to a customer --- In this part of the process, you will create a workflow that is launched when a customer enables marketing agreement in the SMS channel. The workflow checks whether the phone number is unique, if so the customer is assigned with a `phone_unique` tag and the catalog which stores unique phone numbers is updated. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the trigger node --- The workflow is triggered by **Profile Event** where the triggering event is `profile.updated` with the `profile.receivesmses` parameter which is set to true. 1. Add the first node - **Profile Event**. In the node configuration: 1. From the **Choose event** dropdown list, choose the **profile.updated** event. 2. Click where icon button. 3. From the **Choose parameter** dropdown list, select **profile.receivesmses**. 5. From the **Choose operator** dropdown list, select **Is true(Boolean)**. 2. Click **Apply**.
The view of the Profile Event node configuration
Configuration of the Profile Event node
### Add the Profile Filter node --- In the next stage, using the Profile Filter node, you check if the customer already has the `phone_unique` tag and phone number. You take into account customers who have phone but do not have the `phone_unique` tag. 1. Add the **Profile Filter** node. 2. In the settings of the node, choose **Profiles > Attributes** and select the `phone_unique` tag. 3. As **Operator**, choose **Boolean - Is true** and nd modify the "Profile `matching` attribute" to "`not matching` attribute." 5. Click **Choose filter** and select the attribute `phone`. 3. As the **Operator**, choose **Boolean - Is true**. 4. Click **Apply**. 3. For the **Not Matched** path, add the **End** node . 4. Click **Apply**.
Automation Hub Profile Filter node checking customer has a phone number but does not have the phone_unique tag
The Profile Filter node configuration
### Configure the Outgoing Integration node --- In this part of the process, you will send a request to [retrieve all items from the catalog](https://hub.synerise.com/api-reference/data-management#operation/getItemsByBag) to check if the phone number exists in the catalog. 1. To the **Matched** path, add the **Outgoing Integration** node. In the configuration of the node: 1. Choose **Custom webhook**. 2. In the **Webhook name** field, enter `getPhoneFromCatalog`. 3. In the **URL** section: 1. Choose the **GET** method. 2. Enter the following endpoint: `https://api.synerise.com/catalogs/bags/XXXX/items?itemKey={{client.phone}}`, replace `XXXX` with the ID of your catalog. 7. As the method of authorization, select **by API key**. 8. From the dropdown list, select the API key you created as a [part of prerequisites](#prerequisites). 7. Click **Apply**.
Automation Hub Outgoing Integration node configured as a webhook to check if a phone number exists in the catalog
Webhook settings
### Configure the Event Filter node The workflow will wait for the webhook to return the value of the body.metaData.totalCount parameter. If it's other than 0, the workflow will end. If it is 0, the profile will be updated with the `phone_unique` tag. 1. As the next node, add **Event Filter**. In the configuration of the node: 1. In the **Check** field, from the dropdown menu choose **for period of time**. 2. Set the time range. In our case, it is 5 minutes. 3. In the **Define conditions** field, from the **Choose event** dropdown menu, choose `webhook.response` event. 3. Click the **+ where** button and select `name`. 4. As the logical operator, select **Equal (String)**. 5. As the value, add the name of the event used in the previous node: `getPhoneFromCatalog`. 3. Click the **+ where** button and select `body.metaData.totalCount`. 4. As the logical operator, select **Equal (Number)**. 5. As the value, add `0`. 5. Click **Apply**. 3. For the **Not matched** path, add the **End** node .
Event Filter node settings
Event Filter node settings
### Add the Update Profile node --- 1. For the **Matched** path, add the **Update Profile** node. 2. From the dropdown list, select **phone_unique** tag. 3. Leave the right dropdown list at default (**Add**). 3. To save the changes, click **Apply**.
Screenshot presenting update profile node
The configuration of the Update Profile node
### Configure the Outgoing Integration node --- In this step, [your catalog with unique phone numbers will be updated](https://hub.synerise.com/api-reference/data-management#operation/addItems). 1. Add **Outgoing Integration** node. In the configuration of the node: 1. Choose **Custom webhook**. 2. In the **Webhook name**, enter `addPhoneToCatalog`. 3. In the **URL** section: 1. Choose the **POST** method. 2. Enter the following URL: `https://api.synerise.com/catalogs/bags/XXXX/items?itemKey={{client.phone}}`, where `XXXX` is the ID of your catalog. 4. In the **Body** section, enter:
{
           "itemKey": "{{client.phone}}",
           "value": {
           "id": "{{client.id }}",
           "phone": "{{client.phone}}"
           }
           }
7. As the authorization method, select **by API key**.
Automation Hub Outgoing Integration node configured as a webhook to add a phone number to the catalog
Webhook settings
### Add the finishing node --- 1. Add the **End** node. 2. In the upper right corner, click **Save & Run**. **Result**:
Automation Hub workflow for verifying phone number uniqueness and assigning the phone_unique tag
The workflow configuration
## Create a workflow that deletes a tag when a customer withdraws consent for receiving SMS --- The next step is to create a workflow that will be triggered when a customer withdraws their consent. The workflow has similar structure to the previous one. What changes here is the trigger, instead of Profile Event, you will use the Audience node that is repeatedly triggered, for example everyday, at a certain time. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the trigger node --- The workflow is triggered for specific group of customers every date at a define time. 1. Start the workflow with the **Audience** node. 2. In the configuration of the node, set the **Run trigger** option to **repeatable**. 3. Set the interval to 1 per day. 4. Choose the day and time when the process starts. 5. Select the time zone. 6. In **Define audience**, choose **New Audience** and click **Define conditions**. Our audience will be a group of users who has `phone_unique` tag and change their sms agreement. 1. As the first condition, from the **Choose filter** dropdown menu, choose `phone_unique` attribute. 2. Choose operator as **Is true (Boolean)**. 4. As the second condition, from the **Choose filter** dropdown menu, choose the `SMS agreement` attribute. 5. Choose operator as **Equal (String)** and add the value. In our case it will be `false`.
Configuration of the Segment in the Audience node
Configuration of the segmentation in the Audience node
8. Click **Apply**.
Automation Hub Audience node configuration for targeting customers with unique phone numbers
Configuration of the Audience node
### Add the Profile Filter node --- In the next stage, using the Profile Filter node, you check if the customer has the `phone_unique` tag and phone number. 1. Add **Profile Filter** node. 2. In the settings of the node choose **Profiles > Attributes** and select the tag `phone_unique`. 3. As the **Operator**, choose **Boolean - Is true**. 5. Click **Choose filter** and select the attribute `phone`. 3. As the **Operator**, choose **Boolean - Is true**. 4. Click **Apply**. 3. For the **Not Matched** path, add the **End** node .
Automation Hub Profile Filter node checking customer has both the phone_unique tag and a phone number
The Profile Filter node configuration
### Configure the Outgoing Integration node --- In this part of the process, you will send a request to [retrieve all items from the catalog](https://hub.synerise.com/api-reference/data-management#operation/getItemsByBag) to check if the phone number exists in the catalog. 1. To the **Matched** path, add the **Outgoing Integration** node. In the configuration of the node: 1. Choose **Custom webhook**. 2. In the **Webhook name** field, enter `getPhoneFromCatalog`. 3. In the **URL** section: 1. Choose the **GET** method. 2. Enter the following endpoint: `https://api.synerise.com/catalogs/bags/XXXX/items?itemKey={{client.phone}}`, replace `XXXX` with the ID of your catalog. 7. As the method of authorization, select **by API key**. 8. From the dropdown list, select the API key you created as a [part of prerequisites](#prerequisites). 7. Click **Apply**.
Automation Hub Outgoing Integration node configured as a webhook to check if a phone number exists in the catalog
Webhook settings
### Configure the Event Filter node --- The workflow will wait for the webhook to return the value of the body.metaData.totalCount parameter. If it's equal 0, the workflow will end, because it means that the number is not in the catalog and no need to remove the tag since the number was not unique and the workflow ends. If it's 1, it means the number exists in the catalog because it was unique and the workflow must go on. 1. As the next node, add **Event Filter**. In the configuration of the node: 1. In the **Check** field, from the dropdown menu choose **for period of time**. 2. Set the time range. In our case, it is 5 minutes. 3. In the **Define conditions** field, from the **Choose event** dropdown menu, choose `webhook.response` event. 3. Click the **+ where** button and select `name`. 4. As the logical operator, select **Equal (String)**. 5. As the value, add the name of the event used in the previous node: `getPhoneFromCatalog`. 3. Click the **+ where** button and select `body.metaData.totalCount`. 4. As the logical operator, select **Equal (Number)**. 5. As the value, add `1`. 5. Click **Apply**. 3. For the **Not matched** path, add the **End** node .
Event Filter node settings
Event Filter node settings
### Add the Update Profile node --- 1. For the **Matched** path, add the **Update Profile** node. 2. From the dropdown list, select **phone_unique** tag. 3. Click the right dropdown list and select **Remove**. 3. To save the changes, click **Apply**.
Screenshot presenting update profile node
The configuration of the Update Profile node
### Configure the Outgoing Integration node --- In this step, [you will remove a customer with their phone number from the catalog](https://hub.synerise.com/api-reference/data-management#operation/deleteItem). 1. Add the **Outgoing Integration** node. In the configuration of the node: 1. Choose **Custom webhook**. 2. In the **Webhook name** field, enter `removePhoneFromCatalog` 3. In the **URL** section: 1. Choose the **DELETE** method. 2. Enter the following URL:`https://api.synerise.com/catalogs/bags/XXXX/items/{{event.params['body.data[0].id']}}`, where `XXXX` is the ID of your catalog. 7. As the authorization method, select **by API key**. 8. From the dropdown list, select the API key you created as a [part of prerequisites](#prerequisites). 7. Click **Apply**.
Automation Hub Outgoing Integration node configured as a webhook to remove a phone number from the catalog
Webhook settings
### Add the finishing node --- 1. Add the **End** node. 2. In the upper right corner, click **Save & Run**. **Result**:
Automation Hub workflow for removing the phone_unique tag when a customer withdraws SMS consent
The workflow configuration
## Check the use case set up on the Synerise Demo workspace --- In the Synerise Demo workspace, you can check: - [segmentation configuration](https://app.synerise.com/analytics-v2/segmentations/8e08c002-e0bf-4e66-bb28-7bf276918ee0) - [workflow configuration](https://app.synerise.com/automations/automation-diagram/cd94653c-b2a6-43c2-afa8-7090dee0d81e) - [data transformation](https://app.synerise.com/automations/data-transformation/8888bd88-53a8-4f3a-89c6-93fddf4e6392) - [workflow which imports modified file with customers back to Synerise](https://app.synerise.com/automations/automation-diagram/3f15df7f-10fb-428c-aa52-047d56dfe7d9) - [workflow which updates the customer's profile](https://app.synerise.com/automations/automation-diagram/9bf58473-d660-4f4b-a7be-61b4605b0673) - [workflow that deletes a tag when a customer withdraws consent for receiving SMS](https://app.synerise.com/automations/automation-diagram/afbc1610-892e-43cb-ac8c-e6e49eea56f3) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 11 events per profile that completes the flow: [`profile.updated`](/docs/assets/events/event-reference/profiles#profileupdated) (~2), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~5), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`webhook.response`](/docs/assets/events/event-reference/integration#webhookresponse-and-custom-webhook-response-names) (~2). ## Read more --- - [Automation Hub](/docs/automation) - [Catalogs](/docs/assets/catalogs/introduction-to-catalogs) - [Data Transformation](/docs/automation/data-transformation-and-imports) - [Import](/docs/assets/imports/introduction-to-imports) - [Segmentation](/docs/analytics/segmentations) - [SMS campaigns](/docs/campaign/SMS) # In-App Swipe Campaign for Gathering Customer Preferences In-app campaigns are designed to enhance the customer experience in the mobile application. Thanks to them, on the one hand, we are able to present personalized products based on the analysis of customers behavior and activities. As a result, you always reach your target group with relevant, personalized messages tailored to each customer's specific actions. We can also go a step further and give the customer the opportunity to decide for themselves what products they really like and what are their preferences. One of such actions may be adding a product to your favorites. This activity can be used as a trigger for the campaign which displays the current bestsellers. Based on the swipe mechanism, customer can either like specific product or reject and see another product. In this way, we get to know the customer's taste and preferences better. The products you show to your customers depend on your business needs. These could be bestsellers, but you can also specify a static group of products or use other type of AI recommendations. Moreover, products marked as liked or disliked by the customer can be used in further communication with them. You can boost recommendation campaigns results with the liked products or filter the campaigns and exclude products that were disliked. The results of AI campaigns can be used in personalized mailings and in any other touchpoint, ensuring that you show customers only products they really like. In this use case, we will describe the process of creating an in-app mechanism presenting bestsellers with the swiping system. The campaign will be displayed after the customer adds any product to the favorites. The customer has the option of swiping the products to the right or left and based on the customer decision an event with information that someone like/dislike the specific product is send to Synerise. The mechanism consists of two in-app campaigns: one to display the bar at the bottom of the screen encouraging to display bestsellers, and second one, appearing after clicking the bar, with the proper swiping system.
In-app message example
## Prerequisites --- - [Implement Synerise SDK in your mobile app](/developers/mobile-sdk). - [Configure AI engine](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-search). Enable **Top items** recommendations. - Implement the `product.addToFavorite` event in your [mobile application](/developers/mobile-sdk/event-tracking#product-added-to-favorites). The event must be sent to Synerise after adding any product to favorites by the customer. - In **Data Modeling Hub > Events**, [configure the event actions](/docs/assets/events/event-definitions#adding-event-definitions) that your in-app campaign will use to trigger displaying of the swipe mechanism and to send data about liking/disliking a product. In the JS SDK event settings section, you should set the way of authorizing these events to **Make this event available to anonymous profiles without JWT**. In this use case, the event actions are `preferences.action` and `preferences.trigger`. ## Process --- In this use case, you will go through the following steps: 1. [Create AI recommendations](/use-cases/in-app-bestsellers#create-ai-recommendations) with bestsellers. 2. [Create an in-app campaign to propose the swiping mechanism](#create-an-in-app-campaign-to-propose-the-swiping-mechanism) presenting the bar encouraging to display bestsellers after adding any product to favorites. 3. [Create an in-app campaign to display the swiping mechanism](#create-an-in-app-campaign-to-display-the-swiping-mechanism) presenting bestselling products with a swipe mechanism after clicking the bar. ## Create AI recommendations --- In this stage, you will create an AI recommendation campaign which will be used to display products in your in-app message. The customer will have the ability (implemented in the next stage by using an in-app campaign) to express liking or disliking the presented products. 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. Enter the name of the recommendation (it is only visible on the list of recommendations). 3. In the **Type & Items feed** section, click **Define**. 4. From the **Items feed** dropdown list, select a product feed. 5. Select the **Top products** recommendation type. 6. Confirm the recommendation type by clicking **Apply**. 6. In the **Items** section, click **Define**. 7. Click **Add slot**. 8. Click the **Unnamed slot** that was created. 8. Define the minimum and maximum number of products displayed in the frame according to your needs. 9. In **Static filters**, select the **availability** parameter and set it to **is defined**, so the recommendations will show only available items. 9. Optionally, you can use filters to include specific items in the recommendation frame. 10. Confirm the configuration by clicking **Apply**. 10. In the **Additional settings**, click **Define**. 11. From the **Sort metric** dropdown list, select **Sold items count in the last 7 days**. 12. Confirm the configuration of **Additional settings** by clicking **Apply**. 12. Click **Save**.
AI recommendation configuration
AI recommendation campaign configuration
## Create an in-app campaign to propose the swiping mechanism --- In this part of the process, you create an in-app campaign triggered by the `product.addToFavorite` event. After that, the bar encouraging to display bestsellers is displayed. The campaign lets the customer decide if they want to launch the swiping mechanism with the proposed products. The ready-to-use code presented below generates a custom event (`preferences.trigger`) after the customer clicks the bar. This event triggers the second in-app campaign, described [further in this article](#create-an-in-app-campaign-to-display-the-swiping-mechanism). 1. Go to Experience Hub menu icon **Experience Hub > In-app messages > Create in-app** 2. Enter a meaningful name for the in-app campaign. 3. In the **Audience** section: 1. Click **Define**. 2. Select the **Everyone** tab. 3. Click **Apply**. 4. In the **Content** section: 1. Click **Define**. 2. Click **Create message** and select **Code Editor** 3. Create the content of your in-app campaign. You can reuse the code snippets presented below in your in-app template.
Check the HTML code
<div class="in-app-wrapper bottom_bar"> <div class="in-app-close"> <svg viewBox="0 0 24 24" class="close-m"> <path fill="none" d="M0 0h24v24H0z"></path> <path d="M13.06 12l4.72-4.72a.75.75 0 00-1.06-1.06L12 10.94 7.28 6.22a.75.75 0 00-1.06 1.06L10.94 12l-4.72 4.72a.75.75 0 101.06 1.06L12 13.06l4.72 4.72a.75.75 0 001.06-1.06z"> </path> </svg> </div> <div class="in-app-content"> <p class="in-app-title">Do you like our products?</p> <p class="in-app-subtitle">Let us know your taste 🔥</p> </div> </div>
Check the CSS code
@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;900&display=swap"); .in-app-wrapper.bottom_bar { margin: 15px; background-color: whitesmoke; height: 95px; border-radius: 30px; box-shadow: 0 0px 10px 0 rgba(35, 41, 54, 0.2); display: flex; flex-direction: column; flex-wrap: nowrap; align-content: center; justify-content: center; align-items: center; } .in-app-close { cursor: pointer; position: absolute; padding: 10px; top: 15px; right: 15px; } .in-app-close svg { width: 32px; height: 32px; } .in-app-content { text-align: center; } .in-app-title { margin: 0; font-weight: 600; font-size: 20px; margin-bottom: 2px; font-family: "Nunito", sans-serif; } .in-app-subtitle { margin: 0; font-size: 14px; font-family: "Nunito", sans-serif; }
Check the JS code
(function () { var inApp = document.querySelector('.in-app-wrapper.bottom_bar'); var close = inApp.querySelector('.in-app-close'); close.addEventListener('click', function () { SRInApp.close(); }) var content = inApp.querySelector('.in-app-content'); content.addEventListener('click', function () { SRInApp.close(); setTimeout(function() { SRInApp.trackCustomEvent('preferences.trigger', {}, 'Preferences trigger event'); }, 0) }) })();
1. In the **Trigger events** section: 1. Click **Define**. 2. Select **Add event** and from the dropdown list, choose the `product.addToFavorite` event. 2. Click the **+ where** button and as the parameter, choose `source`. 3. As the logical operator, select **Contain** and as the value add **MOBILE** to analyze events only from the mobile application. 4. Click **Apply**.
Trigger event settings
Trigger event settings
1. In the **Schedule** section: 1. Click **Define**. 2. Choose the **Run immediately** option. 3. Click **Apply**. 2. In the **Display settings** section: 1. Click **Change**. 2. Define the **Delay display** as **0** and **Priority index** as **2**.
The mobile application can display one in-app message at a time. If the conditions allow the triggering of several in-apps at a time, the priority is a decisive factor for displaying the message. The messages with lower priority aren’t queued for displaying after the first one is closed.
3. Enable the **Frequency limit** toggle to manage the frequency of in-app message display in the application. In our case, we set it to once per day. 3. Click **Apply**. 1. Optionally, you can define the **UTM parameters**. Otherwise, click **Skip step**. 2. Optionally, you can add the custom parameters in the **Additional parameters** section. Otherwise, click **Skip step**. 3. To start your campaign, click **Activate**.
In-app campaign settings
In-app campaign settings
## Create an in-app campaign to display the swiping mechanism --- In this part of the process, you create an in-app campaign triggered by the `preferences.trigger` event. After that, the AI recommendation campaign with top products will be displayed. The campaign lets the customer swipe and like or reject displayed products. The ready-to-use code presented below generates a custom event telling you which products the customer liked/disliked. 1. Go to Experience Hub menu icon **Experience Hub > In-app messages > Create in-app** 2. Enter a meaningful name for the in-app campaign. 1. In the **Audience** section: 1. Click **Define**. 2. Select the **Everyone** tab. 3. Click **Apply**. 1. In the **Content** section: 1. Click **Define**. 2. Click **Create message** and select **Code Editor**. 2. In the right upper corner, change the **Bottom bar** default option to **Fullscreen** by using the dropdown menu. 2. Create the content of your in-app campaign. You can reuse the code snippets presented below in your in-app template.
Check the HTML code
<div class="in-app-close" style="width: 100%;text-align: right;width: 90%;"> <svg viewBox="0 0 24 24" class="close-m"> <path fill="none" d="M0 0h24v24H0z"></path> <path d="M13.06 12l4.72-4.72a.75.75 0 00-1.06-1.06L12 10.94 7.28 6.22a.75.75 0 00-1.06 1.06L10.94 12l-4.72 4.72a.75.75 0 101.06 1.06L12 13.06l4.72 4.72a.75.75 0 001.06-1.06z"> </path> </svg> </div> <div class="frame"></div> <div class="icons"> <svg id="hate" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128.07 127.89"> <path class="a" d="M128.07,64.07c-.5,36.31-28,63.57-64,63.82S-.17,99.33,0,63.29C.17,28.25,29.23-.3,64.43,0A63.88,63.88,0,0,1,128.07,64.07ZM45.32,38.54c-2.44.36-4.63,1.12-6,3.68a6.39,6.39,0,0,0,.94,7.83A143,143,0,0,0,50.42,60.36c2.73,2.48,3.44,4.31.2,7a98.44,98.44,0,0,0-9.52,9.53c-3.62,4-3.66,7.48-.47,10.59,2.82,2.76,7.12,2.54,10.7-.79,3.05-2.83,5.91-5.86,8.85-8.8,2.58-2.57,5.16-2.53,7.73,0,2.83,2.81,5.62,5.67,8.52,8.42,3.87,3.68,8.08,4.08,11,1.15,3.23-3.21,3-6.85-.83-11C83.57,73.21,80.44,70,77.1,67c-2.37-2.13-2.71-3.65-.13-5.91,3.24-2.85,6.15-6.08,9.2-9.15,4.17-4.2,4.66-8,1.45-11.34-2.93-3-7.58-2.61-11.49,1.19-3.34,3.25-6.66,6.52-9.85,9.91-1.64,1.74-2.85,1.73-4.49,0-3.32-3.5-6.84-6.81-10.21-10.26A9,9,0,0,0,45.32,38.54Z" /> <path d="M45.32,38.54a9,9,0,0,1,6.26,2.87c3.37,3.45,6.89,6.76,10.21,10.26,1.64,1.73,2.85,1.74,4.49,0,3.19-3.39,6.51-6.66,9.85-9.91C80,38,84.69,37.52,87.62,40.57c3.21,3.34,2.72,7.14-1.45,11.34-3,3.07-6,6.3-9.2,9.15-2.58,2.26-2.24,3.78.13,5.91,3.34,3,6.47,6.24,9.53,9.52,3.87,4.16,4.06,7.8.83,11-2.95,2.93-7.16,2.53-11-1.15-2.9-2.75-5.69-5.61-8.52-8.42-2.57-2.54-5.15-2.58-7.73,0-2.94,2.94-5.8,6-8.85,8.8-3.58,3.33-7.88,3.55-10.7.79-3.19-3.11-3.15-6.6.47-10.59a98.44,98.44,0,0,1,9.52-9.53c3.24-2.72,2.53-4.55-.2-7A143,143,0,0,1,40.28,50.05a6.39,6.39,0,0,1-.94-7.83C40.69,39.66,42.88,38.9,45.32,38.54Z" /> </svg> <svg id="like" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128.06 127.99"> <path class="a" d="M128.06,63.83a63.65,63.65,0,0,1-64,64.16A63.57,63.57,0,0,1,0,64a64,64,0,0,1,128.06-.13ZM96,56.53c0-5.82-3.9-13.3-10.19-16.05-6.9-3-13.67-2.67-19.37,2.82-2,1.9-3.16,1.41-4.93-.17-2.34-2.08-4.86-3.89-8.25-4.24-9.13-.92-15.31,2.3-19.11,10.25-3.89,8.11-2.42,17.27,4,23.34,7.5,7,15.22,13.88,22.77,20.89,2.06,1.92,3.76,2.27,6,.21C74.36,86.7,82,80,89.39,73.09,93.57,69.21,96.06,64.45,96,56.53Z" /> <path d="M96,56.53c.08,7.92-2.41,12.68-6.59,16.56C82,80,74.36,86.7,66.93,93.58c-2.23,2.06-3.93,1.71-6-.21-7.55-7-15.27-13.84-22.77-20.89-6.46-6.07-7.93-15.23-4-23.34,3.8-8,10-11.17,19.11-10.25,3.39.35,5.91,2.16,8.25,4.24,1.77,1.58,2.95,2.07,4.93.17,5.7-5.49,12.47-5.84,19.37-2.82C92.08,43.23,96,50.71,96,56.53Z" /> </svg> </div>
Check the CSS code
@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;900&display=swap"); html, body { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; overflow: hidden; font-family: "Nunito", sans-serif; background-color: rgba(0, 0, 0, 0.4); } .frame { position: relative; width: 90%; height: 70%; max-width: 400px; max-height: 600px; z-index: 1; } .icons { margin-top: 3vh; user-select: none; z-index: 1; } .icons>svg { width: 10vh; height: 10vh; max-width: 60px; max-height: 60px; border-radius: 50%; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); cursor: pointer; } .icons>svg:nth-child(1) { fill: #fb4f68; margin-right: 2vh; } .icons>svg:nth-child(2) { fill: #4dca93; } .icons>svg>path:nth-child(1) { fill: #fff; } .card { background-color: #fff; position: absolute; display: flex; align-items: flex-end; justify-content: center; width: 100%; height: 100%; color: #f1f1f1; border-radius: 10px; user-select: none; cursor: pointer; overflow: hidden; background-size: cover; background-repeat: no-repeat; background-position: center; touch-action: none; } .card .is-like { width: 100%; height: 100%; position: absolute; opacity: 0; } .card .is-like::after { position: absolute; left: 50%; bottom: 30%; transform: translateX(-50%) rotate(-10deg); width: 30%; height: 13%; font-size: 3em; letter-spacing: 0.2em; font-weight: 600; border-radius: 0.15em; display: flex; align-items: center; justify-content: center; } .card .like::after { content: "👍"; } .card .nope::after { content: "👎"; } .card .bottom { width: 100%; height: 25%; background: linear-gradient(to top, #000000b8, #00000000); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding-left: 7%; font-weight: 400; padding-bottom: 25px } .card .bottom .title>span:nth-child(1) { font-size: 2em; font-weight: 700; margin-right: 0.2em; } .card .bottom .title>span:nth-child(2) { font-size: clamp(13px, 1.5em, 25px); } .card .bottom .title>span:nth-child(2)>b { font-size: 0.6em; margin-right: 0.2em; } .card .bottom .info { margin: 0; } @media screen and (max-height: 540px) { .frame { width: 90%; height: 70%; font-size: 13px; } } @media screen and (max-height: 440px) { .frame { font-size: 8px; } } .in-app-close svg { width: 32px; height: 32px; cursor: pointer; background-color: #000; fill: #fff; } .in-app-close { max-width: 400px; margin-bottom: 16px; }
Check the JS code
let imgCount = 0; const data = {% set arr = [] %}{% recommendations3 campaignId=CAMPAIGN-ID %}{% for p in recommended_products3 %}{% set obj = {itemId: p.itemId, img: p.image_link, name: p.title, price: p.price, distance: p.category} %}{% do arr.append(obj) %}{% endfor %}{{arr|tojson}}{% endrecommendations3 %} const frame = document.body.querySelector(".frame"); data.forEach((_data) => appendCard(_data)); let current = frame.querySelector(".card:last-child"); let likeText = current.children[0]; let startX = 0, startY = 0, moveX = 0, moveY = 0; document.querySelector("#like").onclick = () => { moveX = 1; moveY = 0; complete('like'); }; document.querySelector("#hate").onclick = () => { moveX = -1; moveY = 0; complete('hate'); }; function appendCard(data) { const firstCard = frame.children[0]; const newCard = document.createElement("div"); newCard.className = "card"; newCard.setAttribute('data-sku', data.itemId); newCard.setAttribute('data-brand', data.name); newCard.setAttribute('data-title', data.distance); newCard.style.backgroundImage = `url(${data.img})`; newCard.innerHTML = `
                
LIKE
${data.name} ${data.price}
${data.distance}
`; if (firstCard) frame.insertBefore(newCard, firstCard); else frame.appendChild(newCard); imgCount++; } function initCard(card) { card.addEventListener("pointerdown", onPointerDown); } function setTransform(x, y, deg, duration) { current.style.transform = `translate3d(${x}px, ${y}px, 0) rotate(${deg}deg)`; likeText.style.opacity = Math.abs((x / innerWidth) * 2.1); likeText.className = `is-like ${x > 0 ? "like" : "nope"}`; if (duration) current.style.transition = `transform ${duration}ms`; } function onPointerDown({ clientX, clientY }) { startX = clientX; startY = clientY; current.addEventListener("pointermove", onPointerMove); current.addEventListener("pointerup", onPointerUp); current.addEventListener("pointerleave", onPointerUp); } function onPointerMove({ clientX, clientY }) { moveX = clientX - startX; moveY = clientY - startY; setTransform(moveX, moveY, (moveX / innerWidth) * 50); } function onPointerUp() { current.removeEventListener("pointermove", onPointerMove); current.removeEventListener("pointerup", onPointerUp); current.removeEventListener("pointerleave", onPointerUp); if (Math.abs(moveX) > frame.clientWidth / 2) { current.removeEventListener("pointerdown", onPointerDown); complete(String(moveX).match('-') ? 'hate' : 'like'); } else cancel(); } function complete(type) { try { const flyX = (Math.abs(moveX) / moveX) * innerWidth * 1.3; const flyY = (moveY / moveX) * flyX; setTransform(flyX, flyY, (flyX / innerWidth) * 50, innerWidth); SRInApp.trackCustomEvent('preferences.action', { actionType: type, itemId: current.getAttribute('data-sku'), title: current.getAttribute('data-title'), brand: current.getAttribute('data-brand') }, 'Preferences action'); const prev = current; const next = current.previousElementSibling; if (next) initCard(next); current = next; likeText = current.children[0]; // appendCard(data[imgCount % 4]); setTimeout(() => frame.removeChild(prev), innerWidth); } catch(error) { document.querySelector('body').style.backgroundColor = 'rgba(0, 0, 0, 0.6)'; document.querySelector('body').innerHTML = '<h1 style="color: #fff; width: 90%; max-width: 400px;">Thank you!<br>We will reach out to you</h1>'; setTimeout(function(){ SRInApp.close(); }, 3000) } } function cancel() { setTransform(0, 0, 0, 100); setTimeout(() => (current.style.transition = ""), 100); } var close = document.querySelector('.in-app-close svg'); close.addEventListener('click', function () { SRInApp.close(); }) initCard(current);
In the JS code section, replace the CAMPAIGN-ID with the [ID of your campaign created in the previous step](/use-cases/in-app-bestsellers#create-ai-recommendations).
1. In the **Trigger events** section: 1. Click **Define**. 2. Select **Add event** and from the dropdown list, choose the `preferences.trigger` event. 2. Click the **+ where** button and as the parameter, choose `source`.
If you cannot find the `source` parameter on the dropdown list, go to **Data Modeling Hub > Events**, find `preferences.trigger` event on the list and add `cource` parameter by clicking **Add property** button.
3. As the logical operator, select **Contain** and as the value add **MOBILE** to analyze events only from the mobile application. 4. Click **Apply**. 1. In the **Schedule** section: 1. Click **Define**. 2. Choose **Run immediately** option. 3. Click **Apply**. 2. In the **Display settings** section: 1. Click **Change**. 2. Define the **Delay display** as **0** and **Priority index** as **1**.
The mobile application can display one in-app message at a time. If the conditions allow the display of several in-apps at a time, the priority is a decisive factor for displaying the message. The messages with lower priority aren’t queued.
3. Click **Apply**. 1. Optionally, you can define the **UTM parameters**. Otherwise, click **Skip step**. 2. Optionally, you can add the custom parameters in the **Additional parameters** section. Otherwise, click **Skip step**. 3. To start your campaign, click **Activate**. ## What's next --- After the campaign is implemented, the event `preferences.action` is added on the client's card. This event has an `itemId` (product id) and `actionType` parameter with a value `like` or `hate`. Based on this event, you can create an [aggregate](/docs/crm/aggregates) with products liked or rejected by the customer. Remember, that before creating an aggregate, you should either have this event already somewhere in your history, or have its definition added in [Data Modeling Hub](/docs/assets) in Synerise. Otherwise it will not be available in analysts.
Check how to build this aggregate
  1. Go to Behavioral Data Hub icon Behavioral Data Hub > Live Aggregates > Create aggregate.
  2. As the aggregate type, select Profile.
  3. Enter the name of the aggregate.
  4. Click Analyze profiles by and select Last Multi.
  5. In the Size field choose how many values you would like to return - in this case it might be 100.
  6. Select Consider only distinct occurrences of the event parameter.
  7. Select the `preferences.action` event.
  8. Select the itemId parameter.
  9. Click the + where button, and add the actionType parameter.
  10. Choose operator Equal.
  11. Define the parameter value as `like`.
  12. Save the aggregate.
Decision Hub Last Multi aggregate returning the distinct IDs of products liked by the customer using the preferences.action event
Configuration of the aggregate

To create an aggregate with product rejected by the customer, duplicate the aggregate created above and change the value of the parameter to `hate`.

**Here are some ideas for using the aggregate:** - You can [add such an aggregate to the Boosting](/use-cases/boost-favorite-products) section in other recommendation campaigns and enrich the proposed recommendations with products that have been liked by the customer, or to exclude those which they have rejected. - You can use the aggregate with the customer's favorite products and display them as the section on the website or in the cart, as an incentive to buy products that the customer liked and in this way - increase the value of the basket. - You can use this aggregate also in the [price drop campaign](/use-cases/price-drop-alert). If the customer does not buy a specific product they liked and its price drops, you can send them this information to encourage them to come back and make a purchase. - You can use disliked products in AI search filters, and in this way - exclude those products from the search results. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of the campaign components directly in Synerise Demo workspace: - [AI recommendation configuration](https://app.synerise.com/ai-v2/recommendations/4TohwHGOPXVQ), - [in-app campaign with the bottom bar](https://app.synerise.com/communications/in-app/00880268-6c60-43cd-b79a-99db6e1efc83), - [in-app campaign with the swiping mechanism](https://app.synerise.com/communications/in-app/197099f1-4dde-48c8-96a3-5a71c7aa71e9), - additional [aggregate with liked products](https://app.synerise.com/analytics-v2/aggregates/4af1a1ab-7339-3c6f-85a7-706b316b6d0c). If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 11 events per profile that completes the flow: [`product.addToFavorite`](/docs/assets/events/event-reference/items#productaddtofavorite) (~1), [`inApp.show`](/docs/assets/events/event-reference/inapp#inappshow) (~2), [`inApp.click`](/docs/assets/events/event-reference/inapp#inappclick) (~1), `preferences.trigger` (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), `preferences.action` (~5). ## Read more --- - [In-app messages](/docs/campaign/in-app-messages) - [Mobile campaigns](/docs/campaign/Mobile) - [Recommendations](/docs/ai-hub/recommendations-v2) - [Recommendations inserts](/developers/inserts/recommendations-v2) # Category promotion By focusing on specific product categories, you can curate promotions that resonate with your customers' unique needs. Unlock the ability to connect with your customers during special occasions that matter most to them. Whether it's the back-to-school rush, festive holidays, or the start of barbecue season, category promotions allow you to deliver precisely timed offers that align with your audience's interests. Elevate your business promotional strategy with Synerise and harness the power of precision marketing to elevate customer engagement and enhance conversion rates. In this use case, you will create a back-to-school promotion for electronics category, valid only once per customer. ## Prerequisites --- - Implement Promotions with [SDK mobile in your mobile application](/developers/mobile-sdk/loyalty) or through [API](https://hub.synerise.com/api-reference/loyalty-and-engagement#operation/profileLogin) in any channel. - [Implement transactional events](/developers/web/methods-reference#tracking-transactions). - [Import the product feed to a catalog](/use-cases/import-product-feed-to-catalog). - Create a specific category filter in the product catalog to be reused while preparing the promotion.
Click here to see how to build the filter
  1. Go to Data Modeling Hub > Catalogs.

  2. On the list find the catalog in which you want to create the filter.

  3. On the right side of the screen, click

    Clicking the filter icon

  4. Click Define.

  5. On the pop-up, define the conditions by clicking Choose filter. The list contains all parameters from the product feed.

    The view of filter configuration for category
    Filter configuration for category
  6. Name and save the filter by clicking Save filter.

## Create a promotion --- Create a promotion for one specific category [using the catalog filter created as part of the prerequisites](#prerequisites). The promotion gives a 15% discount for items from the specified category and is valid only once per customer. 1. Go to AI Hub icon **AI Hub > Regular Promotions > Add Promotion**. 2. Enter a name for the promotion. 3. Select the **For selected items** type of promotion. 4. In the **Audience** section, choose **Everyone**. 5. In the **Content** section: 1. Define the name, descriptions, thumbnail and image of the promotion. 3. Optionally, you can add tags to the promotion and JSON code with advanced parameters. 2. Confirm the settings by clicking **Apply**.
The view of Content configuration
Content configuration
6. In the **Type and limits** section: 1. In **Type section**, leave the selection at default (**General**). 2. In the **Priority** field, enter a number that defines the priority for the promotion.
Priority defines the order of display in the customer’s view. 1 is the highest priority. If two or more promotions applicable to a customer have the same priority, the order of display is determined by the date of creation. The one that was created earlier takes the priority over the other promotion.
3. Select the **Single** tab (default). 4. In the **Limit per profile** field, type 1. 5. From the **Discount type** dropdown list, select **Percentage**. 6. From the **Discount mode** dropdown list, select **Static**. 7. In the **Value** field, type 15. 8. Confirm the settings by clicking **Apply**.
AI Hub promotion Type and limits section with single 15% percentage discount limited to one per profile
Type and limits configuration
7. In the **Schedule** section, specify the time, when you want to display your promotion according to your business needs. 8. In the **Items** section: 1. From the **Source catalog** dropdown list, select a catalog of items. 2. In the **Include items** section, choose **Filtered items**. 3. From the **Select filter** dropdown list, select [the filter created as a part of the prerequisites](#prerequisites).
AI Hub promotion Items section showing filtered items from a selected catalog
Type and limits configuration
9. To apply configuration and run the promotion, click **Publish**. ## Check the use case set up on the Synerise Demo workspace --- You can check the [promotion configuration](https://app.synerise.com/campaigns/promotions/5486dfe0-92e2-4f2f-aa9b-901457489f47) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 4 events per profile that completes the flow: [`client.activatePromotion`](/docs/assets/events/event-reference/loyalty#clientactivatepromotion) (~1), [`transaction.charge`](/docs/assets/events/event-reference/items#transactioncharge) (~1), [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~2). ## Read more --- - [Catalogs](/docs/assets/catalogs/introduction-to-catalogs) - [Promotions](/docs/ai-hub/promotions) # Send offline transactions to Facebook You can enrich events collected in Facebook Pixel with any event gathered in Synerise. Based on Facebook Conversion API, Synerise enables sending all event parameters or only its chosen parameters. In this use case, we will send offline transactions to Facebook using the dedicated integration node in Automation Hub. ## Prerequisites --- - [Create a Pixel in Facebook](https://developers.facebook.com/docs/facebook-pixel). - [Generate an access token in Facebook](https://developers.facebook.com/docs/marketing-api/conversions-api/get-started/#access-token). - [Implement offline transactions events](https://hub.synerise.com/api-referenceClientManagement/ClientManagement.html#operation/CreateATransaction). ## Create a workflow --- In order to send offline transactions using Automation Hub, create a workflow that is triggered by a purchase in the point of sales. Through the Facebook Integration node, Synerise sends this event to Facebook. ### Add the Profile Event trigger 1. In the Synerise app, go to **Automation Hub > Workflows > New workflow**. 2. On the dashboard, click the plus button. 3. From the dropdown list, select **Profile Event**. 4. Double-click the **Profile Event** node. 5. On the pop-up, from the **Choose event** list, select the transaction event. If you're not sure of the event's label in your system, search for `transaction.charge`. 6. Click the **+ where** button. 7. From the **Choose parameter** dropdown list, select **$source**. 8. From the **Choose operator** dropdown list, select **Equal**. 9. In the text field, enter `POS`. 10. Confirm by clicking **Apply**.
Configuration of the Profile Event trigger
Configuration of the Profile Event trigger
### Configure Facebook Integration node 1. On the **Profile Event** node, click the plus icon. 2. From the dropdown list, select **Facebook**. 3. From the dropdown list, select **Send Offline Transactions**. 4. Click the node. 5. Click **Select connection**. 6. From the dropdown list, select the connection. If you haven't established a connection yet, see [Create a connection](/use-cases/sending-offline-transactions-facebook#create-a-connection).
Configuration of the Facebook Integration node
Configuration of the Facebook Integration node
### Create a connection Use an access token which allows you to send a request. 1. At the bottom of the **Select connection** dropdown list, click **Add connection**. 2. In the **Access token** field, enter the app access token.
You can read more about access tokens in [Facebook documentation](https://developers.facebook.com/docs/marketing-api/conversions-api/get-started/#access-token).
3. Click **Next**. 4. In the **Connection name** field, enter the name for the access token you generated. 5. Click **Apply**. **Result**: A connection is created and selected. ### Define the integration settings 1. In the **Graph API version** field, enter the currently used API version in Facebook. You can find information about the currently used API version in the Facebook documentation. 2. In the **Meta Pixel ID** field, enter the identifier of the Pixel you use in Facebook. You can find information about how to find ID of the Pixel in the Facebook documentation. 3. From the **Identifier type** dropdown list, select the identifier of customer - an email address of phone number. Offline transactions will be matched with customers based on this identifier. 4. In the **Identifier source** field, enter the Automation insert (Jinjava tag) that corresponds to the identifier you selected as the **Identifier type**.
Read the article about the [Automation inserts](/developers/inserts/automation).
5. In the **Currency code** field, enter the ISO currency code of the transactions, for example, `USD`, `EUR`, `GPB`, `AUD`, `PLN`, and so on. 6. Confirm by clicking **Apply**. ### Add the End node 12. On the **Outgoing webhook** node, click the plus button. 13. From the dropdown list, select **End**. 14. Save and activate the automation by clicking **Save&Run**.
The final structure of the workflow
The final structure of the workflow
15. Go to your Facebook Ad account, select **Facebook Manager > Events Manager** to see the events. After the offline transaction, the `automation` event is visible on the customer's card with 200 status. That means that the transaction has successfully been sent to Facebook.
A webhook response with 200 status on a profile of a test customer
A webhook response with the OK status (200) on a customer's profile
## Check the use case set up on the Synerise Demo workspace --- You can also check the [workflow configuration](https://app.synerise.com/automations/automation-diagram/5a304073-4d44-448a-a4b3-812054f4a423) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 7 events per profile that completes the flow: [`transaction.charge`](/docs/assets/events/event-reference/items#transactioncharge) (~1), [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~2), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), `facebook.sendOfflineTransactions` (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Facebook integration](/docs/automation/integration/facebook) # In-app message with a price drop for recently viewed products In-app messaging has become an essential tool for businesses as it provides a direct and personal communication channel with customers. Price drops are a key aspect of business strategy to drive sales, increase customer engagement, and enhance brand loyalty. In an ever-competitive market, price drops can help companies stand out and create a unique value proposition for their customers. With the right strategy, price drops can produce significant results, leading to revenue growth and increased customer engagement. For customers, price drops represent an opportunity to save money on products that interest them. This, in turn, can increase customer loyalty and satisfaction and encourage repeat purchases. The scenario described in this use case involves using an in-app message to notify customers of price drops on recently viewed products. The in-app message will be displayed right after the start of the mobile session only for customers for whom the product they were viewing has actually been reduced in price.
In-app price drop message example
## Prerequisites --- - Implement the [required version](/docs/campaign/in-app-messages/introduction-to-inapp-messages#requirements) of [Synerise SDK in your mobile app](/developers/mobile-sdk). - Implement the [transaction events](/developers/web/transactions-sdk) using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). - [Create an item catalog](/use-cases/import-product-feed-to-catalog) containing information on the actual price of products. ## Process --- In this use case, you will go through the following steps: 1. [Create an aggregate that returns the IDs of visited products](/use-cases/in-app-price-drop-last-seen-products#create-an-aggregate-that-returns-the-ids-of-last-visited-products) 2. [Create an aggregate that returns the prices of visited products](/use-cases/in-app-price-drop-last-seen-products#create-an-aggregate-that-returns-the-original-prices-of-last-visited-products) 3. [Create an aggregate that returns sku of recently purchased products](/use-cases/in-app-price-drop-last-seen-products#create-an-aggregate-that-returns-the-skus-of-recently-purchased-products) 4. [Create an in-app campaign](/use-cases/in-app-price-drop-last-seen-products#create-an-in-app-campaign) ## Create an aggregate that returns the IDs of last visited products --- 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last multi** and size: **100**. 5. From the **Choose event** drop-down list, select the **page.visit** event. 6. As the event parameter, select **product:retailer_part_no**. 7. Click the **+ where** button. 8. From the **Choose parameter** drop-down list, select the **product:retailer_part_no** parameter. 9. From the **Choose operator** drop-down list, select **Is true (Boolean)**. 10. Set the period for which the aggregate will return IDs of the viewed products to the last **30 days**. 11. Save the aggregate.
Configuration of the aggregate with last visited products
Configuration of the aggregate with last visited products
## Create an aggregate that returns the original prices of last visited products --- 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last multi** and size: **100**. 5. From the **Choose event** drop-down list, select the **page.visit** event. 6. As the event parameter, select **product:original_price:amount**. 7. Click the **+ where** button. 8. From the **Choose parameter** drop-down list, select the **product:original_price:amount** parameter. 9. From the **Choose operator** drop-down list, select **Is true (Boolean)**. 10. Set the period for which the aggregate will return the original prices of viewed products to the last **30 days**. 11. Save the aggregate.
Configuration of the aggregate with original price of last visited product
Configuration of the aggregate with original price of last visited product
## Create an aggregate that returns the skus of recently purchased products --- This aggregate will be used to exclude products that the customer has already purchased. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last multi** and size: **100**. 5. From the **Choose event** drop-down list, select the **product.buy** event. 6. As the event parameter, select **$sku**. 7. Click the **+ where** button. 8. From the **Choose parameter** drop-down list, select the **$sku** parameter. 9. From the **Choose operator** drop-down list, select **Is true (Boolean)**. 10. Set the period for which the aggregate will return skus of the viewed products to the last **30 days**. 11. Save the aggregate.
Configuration of the aggregate with skus of last visited product
Configuration of the aggregate with skus of last visited product
## Create an in-app campaign --- In this part of the process, you will create an in-app campaign triggered by the `session.start` event. We will use a predefined template for the price drop scenario, so there is no need to create a template from scratch. 1. Go to Experience Hub menu icon **Experience Hub > In-app messages > Create new** 2. Enter a meaningful name for the in-app campaign. ### Define the audience --- 1. In the **Audience** section, click **Define**. 2. Select the **Everyone** tab. 3. Click **Apply**. ### Define content --- 1. In the **Content** section, click **Define**. 2. Click **Create message** and from the list of template folders, select **Predefined templates**. 3. Select **Price alert** template. **Result:** You are redirected to the code editor.
You can edit the template in two ways, by editing the code of the template ([add inserts](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-snippet-to-the-template-code), [add variables](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-variable)) and/or by filling out the form in the **Config** tab. In this use case, we will use the capabilities of the predefined **Config** tab.
#### Edit form in the Config tab --- The form in the **Config** tab is already filled in with default values. You can keep them or change them to fit your business needs. The fields in **Config** are split into two types: ones for dynamic content (related to Jinja) and ones for in-app appearance. The dynamic content fields must match the values in the catalog and the names of the attributes returned by the recommendations. The appearance fields only affect the visual layer of the in-app message. 1. In the **Header text** text box, type the header you want to display in the in-app message. 2. From the **Aggregate with IDs of products the customer interacted with** drop-down list, select the aggregate you created in [this step](/use-cases/in-app-price-drop-last-seen-products#create-an-aggregate-that-returns-the-ids-of-last-visited-products). You can find it by typing its name or ID in the search box.
In this scenario, customers interact with the product by viewing it. This is just one example. You can create other aggregates to show different types of interaction with the product, such as adding it to the cart or favorites list, etc. This also applies to all related aggregates used in this use case.
3. From the **Aggregate with prices of products the customer interacted with** drop-down list, select the aggregate you created in [this step](/use-cases/in-app-price-drop-last-seen-products#create-an-aggregate-that-returns-the-original-prices-of-last-visited-products). You can find it by typing its name or ID in the search box. 4. From the **Aggregate with IDs of products purchased** drop-down list, select the aggregate you created in [this step](/use-cases/in-app-price-drop-last-seen-products#create-an-aggregate-that-returns-the-skus-of-recently-purchased-products). This field corresponds to the code fragment in the template that excludes products displayed in the in-app message, so the products with the IDs returned by the selected aggregate won't be displayed. You can find it by typing its name or ID in the search box. 5. In the **Name of the catalog with product information** field, change the default `Snrs-produktu-ogTag` value to the catalog name with product information you use. In our case, we use the same product catalog. 6. In the **Name of the column with sale price** field, change the default `g:sale_price` value to the name of the column with sale price in your catalog with product information. In our case the name of the column with sale price is `product:sale_price:amount`.
The price defined in this field refers to a column in the catalog with the discount price of the product.
7. In the **Name of the column with product title** field, change the default `og:title` value to the name of the column with product title in your catalog with product information. 8. In the **Name of the column with product link** field, change the default `og:url` value to the name of the column with product link in your catalog with product information. 9. In the **Name of the column with image link** field, change the default `og:image` value to the name of the column with image link in your catalog with product information. 10. Define the **Name of the column with average rating** and **Name of the column with number of ratings** fields if you want to include this information in your in-app message. 11. In the **Name of the column with price** field, change the default `product:original_price:amount` value to the name of the column with price in your catalog with product information.
The price defined in this field refers to the column in the catalog with the original price of the product - the price before any reductions.
12. In the **Button text** text box, type the text you want to display on the in-app button that adds the product to the cart. 13. Define the color in the following fields: **Wrapper background color**, **Button background color**, **Button text color**. 14. After you make changes to the template, you can check the preview. 1. Click the **Preview** button on the upper left side. 2. Enter the ID of a customer or a product. 3. Click **Apply**. 15. If the template is ready, in the upper right corner, click **Save this template > Save as**. 16. On the pop-up: 1. In the **Template name** field, enter the name of the template. 2. From the **Template folder** drop-down list, select the folder where the template will be saved. 3. Confirm by clicking **Apply**. 17. To continue the process of configuring the in-app campaign, click **Next**. 18. To save your content changes, click **Apply**. ### Select events that trigger the in-app message display --- In this part of the process, define the event that triggers the display of the in-app message. In our case, the trigger is the start of the session start. 1. In the **Trigger events** section, click **Define**. 2. Select **Add event** and from the drop-down list, choose the `session.start` event. 3. Click the **+ where** button and as the parameter, choose `mobile`. 4. As the logical operator, select **Exists**. 5. Click **Apply**.
The view of In-app trigger event configuration
In-app trigger event configuration
### Schedule the message and configure display settings --- As the final part of the process, you need to set the schedule, display settings configuration, capping, priority of the message among other in-app messages. 1. In the **Schedule** section: 1. Click **Define**. 2. Choose **Run immediately** option. 3. Click **Apply**. 2. In the **Display settings** section: 1. Click **Define**. 2. Define the **Delay display** as **5** and **Priority index** as **1**.
The mobile application can display one in-app message at a time. If the conditions allow the display of several in-apps at a time, the priority is a decisive factor for displaying the message. The messages with lower priority aren’t queued.
3. Enable the **Frequency limit** toggle to manage the frequency of in-app message display in the application. In our case, we want to display the message to the customer maximum once a day. 4. You can additionally enable the **Capping limit** toggle to limit the amount of time the in-app message can be displayed to a customer in general. 5. Click **Apply**. 3. Optionally, you can define the UTM parameters in the **UTM & URL parameters** section. Otherwise, click **Skip step**. 4. Optionally, you can add the custom parameters in the **Additional parameters** section. Otherwise, click **Skip step**. 5. To start your campaign, click **Activate**.
In-app campaign configuration settings
In-app campaign configuration settings
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of the campaign components directly in Synerise Demo workspace: - [Aggregate that returns the IDs of visited products](https://app.synerise.com/analytics/aggregates/d6b649d5-e0c5-3c2a-b311-4eaf3530e82b), - [Aggregate that returns the prices of visited products](https://app.synerise.com/analytics/aggregates/300949d8-f120-3714-adcc-14a6c8bb6119), - [Aggregate that returns sku of recently purchased products](https://app.synerise.com/analytics/aggregates/46a9c55a-f894-3d83-b7a5-d193e0223de9), - [In-app campaign](https://app.synerise.com/communications/in-app/6eaea5ba-88a7-4507-a904-e09a2a99e867) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`session.start`](/docs/assets/events/event-reference/web-and-app#sessionstart) (~1), [`inApp.show`](/docs/assets/events/event-reference/inapp#inappshow) (~1), [`inApp.click`](/docs/assets/events/event-reference/inapp#inappclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [In-app messages](/docs/campaign/in-app-messages) - [Using in-app template builder](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template) - [Mobile campaigns](/docs/campaign/Mobile) # Sync Microsoft Azure Forms Data with Synerise for Customer Profile Updates You can integrate Microsoft Azure Forms with Synerise to collect data from the forms in Synerise and create new customer profiles or update the existing ones. In this use case, a submission of a form that contains three fields (name, surname and email address) launches a workflow that creates a customer profile or updates an existing profile with identical credentials.
Completing this procedure requires some knowledge on sending API requests using cURL, Postman, or similar tools.
Workflow that sends data from forms to Synerise
## Prerequisites --- Access to Microsoft Forms and Microsoft Azure. ## Process --- In this use case, you will go through the following steps: 1. [Create an incoming webhook](/use-cases/send-data-from-forms#create-an-incoming-webhook). 2. [Create a form](/use-cases/send-data-from-forms#create-a-form). 3. [Create a workflow](/use-cases/send-data-from-forms#create-a-workflow). ## Create an incoming webhook --- Create an incoming webhook to which you will send the data submitted through Microsoft Forms. 1. In Synerise, go to **Automation Hub > Incoming > New integration**. 2. Enter the name of the webhook. 3. In the **Endpoint** section, click **Define**.
The URL field is already is filled in with the endpoint to which the data submitted throught the form will be sent.
1. Optionally, you can add an icon to this integration. 3. Confirm by clicking **Apply**.
Configuration of the Endpoint section
Configuration of the Endpoint section
4. In the **Incoming data** section, click **Define**. 5. Click **Retrieve data**. Right after you click the button, send a request to the endpoint in the **Endpoint** section with the sample of data that will be sent through forms. The system waits for the incoming request for 1 minute and 30 seconds. Example request:
Replace the endpoint URL from the example with the endpoint URL from step 3.
curl --location --request POST 'https://{SYNERISE_API_BASE_PATH}/automation-endpoint/endpoints/END_ID/trigger' \
   --header 'Content-Type: application/json' \
   --data-raw '{
    "firstname": "test",
    "lastname": "test",
    "email": "test"
   }'
6. When the endpoint receives data from the request, verify the list of variables. If the variables include those which are in the payload (in this case, firstname, lastname, and email), click **Define**. If not, click **Start again** re-send request, and wait for the results.
Collected variables from the request
Collected variables from the request
7. Click **Save & publish**.
You can read the documentation of Incoming integration [here](/docs/automation/integration/incoming-webhook-node).
## Create a form --- In this part of the process, you need to create a form in Microsoft Forms app and configure the flow of sending data from the form to Synerise. 1. Go to Microsoft Forms app. 2. Create a form.
If you need help, you can refer to the [documentation](https://support.microsoft.com/en-us/office/create-a-form-with-microsoft-forms-4ffb64cc-7d5d-402f-b82e-b1d49418fd9d).
Example form used in this use case
Example form used in this use case
3. Go to Azure Portal. From the list of Azure services, select Logic Apps. If you don't see the icon right away, click **More services** and find the app.
Azure services available in the Azure Portal
Azure services available in the Azure Portal
4. As the connector of the Logic App, select Microsoft Forms.
Example form used in this use case
Connecting Logic App with Microsoft Forms
4. As a trigger, from the dropdown list, select **when a new response is submitted**. 5. Choose the form you want to connect.
Selecting a form
Selecting a form
6. In the panel of operations, choose **Microsoft Form Standard**. As an action, choose **get response details**. 7. From the **Form Id** dropdown list, select the ID of your form. 8. From the **Response Id** dropdown list, As response Id select **List of response notifications Response Id**.
Selecting an action to be performed when a form is submitted
Selecting an action to be performed when a form is submitted
9. In the panel of operations, choose **HTTP**. Configure this section according to the [incoming webhook](/use-cases/send-data-from-forms#create-an-incoming-webhook) you created before. The body must be identical to the body you defined in the incoming webhook in Synerise.
Configuring the endpoint section
Configuring the endpoint section
10. Save the workflow. ## Create a workflow --- In this part of the process, you create a workflow in Synerise. The workflow starts with the business event trigger that is launched every time a customer submits the form. In response to that, a customer profile is created or updated if it exists already. 1. In Synerise, go to **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. 3. As the first node, select **Business Event**. In the configuration of the node: 1. Select the incoming webhook you created as the first part of this use case. 2. Confirm by clicking **Apply**.
Configuring the Business Event node
Configuring the Business Event node
4. Add the **Outgoing Integration** node to the workflow. In the configuration of the node: 1. Enter the name of the webhook. This name will be used as a value of the `name` parameter of the `webhook.response` event. 2. Select the **POST** method. 3. Enter the endpoint URL: - For workspaces hosted in Microsoft Azure EU: `https://api.synerise.com/v4/clients/batch` - For workspaces hosted in Microsoft Azure USA: `https://api.azu.synerise.com/v4/clients/batch` - For workspaces hosted in Google Cloud Platform: `https://api.geb.synerise.com/v4/clients/batch` 4. Enter the following headers: - set the `content-type` header to `application/json` (default), - set the `accept` header to `application/json`, - set the `api-version` header to `4.4` 5. Enter the request body. For the form used in this case, the body is as follows:
{
           "email": "{{ request.body.email }}",
           "firstname": "{{ request.body.firstname }}",
           "lastname": "{{ request.body.lastname }}"
       }
5. In the **Authorization** section, select **By API key**. 6. From the dropdown list, select API key that has permissions to create or update customer's data.
You can read more about API keys [here](/docs/settings/tool/api) and you can find more information about the endpoint and required API key permissions [here](https://hub.synerise.com/api-referenceClientManagement/ClientManagement.html#operation/BatchAddOrUpdateClients).
6. Confirm by clicking **Apply**.
Configuring the Outgoing Integration node
Configuring the Outgoing Integration node
7. Add the **End** node. 8. Activate your workflow by clicking **Save & Run**.
Automation Hub workflow for sending data from web forms
Final workflow configuration
## Testing --- If the workflow works, you will see a new/updated customer in **Behavioral Data Hub > Profiles** and a success in the statistics of the **Outgoing Integration** node:
Workflow statistics
Workflow statistics
## Watch video --- You can watch the video that presents the whole process of implementing this use case.
Send data from Microsoft Azure Forms to Synerise
## Check the use case set up on the Synerise Demo workspace --- In the Synerise Demo workspace, you can check the configuration of: - the [incoming integration](https://app.synerise.com/automations/custom-blocks/integrations/incoming/edit/a205358b-d82b-4e35-88a3-b511d8e3a04d) - the [workflow](https://app.synerise.com/automations/automation-diagram/f3c9163c-a6e8-4276-a11c-6e45ce1f181f) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 6 events per profile that completes the flow: `incoming webhook event` (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`webhook.response`](/docs/assets/events/event-reference/integration#webhookresponse-and-custom-webhook-response-names) (~1), [`profile.updated`](/docs/assets/events/event-reference/profiles#profileupdated) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Integrations](/docs/automation/integration) # Search engine for a brand with multiple languages and currencies AI search is not difficult tool to use, especially when we use one language. A lot of our customers are operating in many markets and want to use search in different languages. It is hard to avoid a situation where a user enters a different language when searching certain categories in his language on the website. We can accept it and the fact that he will find a blank page with no results, but on the other hand we can set up the search process and, based on that, show him the products he is looking for no matter which language he uses. **Challenge** Our client had one e-commerce platform that uses different variants depending on the region chosen by customers, currencies available on the chosen region and website language. Additionally, each market had its own product stock. So, in fact we had several e-commerce operations under one domain. Our customer wanted to have all the data in one place and execute all campaigns from the one place as well. He was also interested in creating AI search which makes it possible to search for products in different languages. ![Screenshot presenting ai search](/api/docs/image/f8a57079df9dd82ae8b22dc747691385d7d51d29/use-cases/all-cases/_gfx/aisearch-products1.png) ## Prerequisites --- - Synerise [tracking code](/docs/settings/tool/tracking_codes), to collect all necessary events from the website. - [Product feed](/developers/product-feed) implemented. - [OG tags](/developers/web/og-tags). - Collecting [transactional events](/docs/automation/actions/synerise-integrations/import-events). ## Process --- 1. [Prepare product feeds](/use-cases/search-multiple-languages#prepare-product-feeds) for each market. 2. [Prepare a search ranking](/use-cases/search-multiple-languages#prepare-a-search-ranking). 3. [Set up AI search](/use-cases/search-multiple-languages#set-up-ai-search) - query rules and synonyms. ## Prepare product feeds --- 1. **Create separated product feeds** for each market with additional information about those languages on the website which we want to use in our search - every attribute like description, title, type, category should be added in two languages. Everything in the Google merchant format. Thanks to that, even if the customer is on the English version of the website, he can search using Arabic words as well.

2. Every search for each region has to be built on the basis of separate product feeds. So, we have to prepare **different indexes for such an AI search**. Thanks to that we can choose, based on which product feed we want to build our models on. As you can see below, we can choose one of the imported product catalogs and later use it to prepare the appropriate campaign. ![Screenshot presenting index](/api/docs/image/f8a57079df9dd82ae8b22dc747691385d7d51d29/use-cases/all-cases/_gfx/indexes.png) ## Prepare a search ranking --- In the case of a search engine, the most important step of setting it up is to **prepare a search ranking**. This means you have to indicate which attributes around the product have to be searchable and assign their importance. ![Screenshot presenting ranking](/api/docs/image/f8a57079df9dd82ae8b22dc747691385d7d51d29/use-cases/all-cases/_gfx/aisearchranking.png) As you can see here, we have a lot of attributes from the product feed, from this customer, but the most important are searchable attributes which will be search at the beginning. In our case it will be: - Category - itemID - attributes.product_type_ar – second language - brand - title In medium and low importance, we have also the next attributes from the product; description, gender, attributes.title_ar, attributes.description_ar, and more of them in the low importance (e.g. size, pattern etc.).

## Set up AI Search --- ### Query rules Synerise lets you optimize search using our query rules. It also allows us to prepare seven better search results. Based on this, in just a few steps you can decide that if somebody enters a query, you can replace it with a different phrase and show him specific content. We can prepare such query rules in AI Hub – Indexes - New index, clicking button “create new” in query rules. We have to complete 3 sections: - Conditions - Consequences - Schedule ![Screenshot presenting query rules](/api/docs/image/f8a57079df9dd82ae8b22dc747691385d7d51d29/use-cases/all-cases/_gfx/queryrules.png) Let’s say that we want to prepare a query for when someone enters “dress” - we would like to show him products from the dress category in the Arabic language “فستان”. So, we choose the title from the first steps subpage and add it to the consequences section. In this way we will define that if somebody enters “dress” we would like to replace this query with a new query, which is dress in Arabic. ### Synonyms You can also use synonyms to make the search more effective. To do this, add new synonym in the synonym section. Choose if it should work in one way or two ways. ![Screenshot presenting query rules](/api/docs/image/f8a57079df9dd82ae8b22dc747691385d7d51d29/use-cases/all-cases/_gfx/synonyms.png) It can be helpful if a lot of similar words for your category exist (sweatshirt and hoodie) or a lot of different products are in the same category e.g. beach accessories, where you can find towels, bags, umbrellas etc.
You can always check the **zero page results section** in your search configurator to see what kind of words are often entered by your customers. It may be that some categories or product names are entered by mistake and you can automatically replace them with the proper word.
## Generated events This use case generates approximately 2 events per profile that completes the flow: [`item.search`](/docs/assets/events/event-reference/search#itemsearch) (~1), [`item.search.click`](/docs/assets/events/event-reference/search#itemsearchclick) (~1). ## Read more --- - [AI search](/docs/ai-hub/ai-search/introduction-to-ai-search) - [Catalogs](/docs/assets/catalogs/creating-catalogs) - [Product Search API documentation](https://hub.synerise.com/api-reference/ai-search) # ABX Test - Optimizing Discounts for Medium-Purchase-Probability Customers This ABX test is designed to help optimize discount offers for customers with low predicted purchase probability from specific category — a segment that requires more strategic effort to convert. Using our prediction model, customers are divided into three groups: - High probability to buy - Medium probability to buy - Low probability to buy Instead of offering discounts to everyone, the focus here is on the **medium-intent group**, where the real challenge lies. This segment is targeted with multiple variants of a campaign for specific product category (like electronics in our case) to determine which incentive, if any, drives the highest engagement and conversion: - 5% discount - 10% discount - 15% discount - No discount (control group) The results help you fine-tune your strategy by understanding which discount level justifies the cost of acquisition in this sensitive segment. This leads to smarter spending on incentives and a higher return on your promotional efforts. ## Prerequisites --- To implement this use case, perform the following steps in the given order: - [Create an email account](/docs/campaign/e-mail/configuring-email-account). - [Prepare email templates](/docs/campaign/e-mail/creating-email-templates). - Create [voucher pools](/docs/assets/code-pools) with different discounts. In our example: 15%, 10% and 5% for `Electronics` category. ## Process --- 1. [Create a Propensity prediction](/use-cases/abx-optimize-coupon-strategy#create-a-propensity-prediction) that produces the 5-point score (results will be later grouped using 3-point score labels). 2. [Create a segmentation](/use-cases/abx-optimize-coupon-strategy#create-a-segmentation). 3. [Create a workflow](/use-cases/abx-optimize-coupon-strategy#create-a-workflow). ## Create a Propensity prediction --- In this part of the process, you will create a propensity prediction to purchase any product from the `electronics` category for the audience of recognized customers (assigned with the email attribute and with a page visit event within the last 30 days).
Synerise allows you to run the predictions also for anonymous visitors. If you need to prepare scenario for other segment - like anonymous visitors - you can define the conditions while preparing the segment.
### Select the model type 1. Go to AI Hub icon **AI Hub > (AI Predictions) Models > New prediction**. 2. On the pop-up, select the **Create from scratch** option. 3. Select **Propensity**. 4. Name your prediction. ### Select customers to be analyzed Select the audience for whom you want to prepare a prediction. 1. In the **Audience** section, click **Define**. 2. Click **Choose segmentation**. 3. On the dropdown list, click **Create new**. 4. In the **Segmentation name** field, enter a meaningful name of the segmentation. 5. Click **Next step**. 5. Click **Add condition**: 1. From the dropdown list, select the `email` attribute. 2. From the **Choose operator** dropdown list, select **String** and **Is not empty** (this operation will work on Recognized visitors only, as the email field in anonymous visitors has special handling policy). 6. Once again click **Add condition**: 1. From the dropdown list, select the `Visited page` event. 2. In the calendar in the bottom right corner, leave **Last 30 days**. 7. Save the segmentation by clicking **Create segmentation**. 8. Click **Apply**.
The view of propensity audience configuration
Propensity audience configuration
### Define the item In this section, you define the product category for which you want to calculate the prediction, in our case it's the `electronics` category. This is done by creating a filter that matches the product category in the catalog. 1. In the **Item selection** section, click **Define**. 2. Click **Choose item feed**. 3. Select the catalog that contains the items you want to make the prediction for. **Result**: The **Item filter** section appears. 4. Click **Define item filter**. 5. From the **Select value** dropdown list, select the `category` attribute. 6. As the logical operator, select **In**. 7. Click **Select value** and add `0` items. **Result**: An **Array values** pop-up appears. 8. Use the search field to add the desired product category. In our case:`root catalog> default category>electronics`. 9. Click **Add**. 10. Click **Apply**. 13. Click **Save**. 10. Save the item feed configuration by clicking **Apply**.
The view of propensity item filter configuration
Propensity item filter configuration
### Additional settings and saving Configure the [additional settings](/docs/ai-hub/predictions/propensity#additional-settings) (or leave them at default) and click **Save & Calculate**. In our case we choose the 5-point probability scale: very high, high, medium, low, very low. **Result:** After the calculation is complete a `snr.propensity.score` event is saved in the profiles of each customer in the audience. The event data includes detailed results of the prediction. Based on the `snr.propensity.score` event, you can create segmentations of customers with different propensity. ## Create a segmentation --- Based on the `snr.propensity.score` event, create a segmentation of customers with medium propensity to purchase any item from the product - `electronics` category. 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of the segmentation. 1. Click **Add condition**. 2. Select the `snr.propensity.score` event. 3. Click **+ where**. 4. As the event parameter, select `modelId` (available in the parameters of the `snr.propensity.score` event).
The wiev of properties of the snr.propenisty.score event
Properties of the snr.propenisty.score event
3. As the logical operator, select **Equal**. 4. In the text field, enter the value of the `modelId` parameter. 5. Click **+ and where**. 6. As the event parameter, select `score_label`. 7. As the logical operator, select **Equal**. 8. In the text field, enter `Medium`. 9. Set the date range according to your buisness needs. 5. Click **Save**.
For other scenarios using 5 point label scale you can group very low & low and very high & high propensity scores using `contain` operator accordingly. This way you can create 3 point label scale.
The view of segmentation configuration
Segmentation configuration
## Create a workflow --- As the final part of the process, create a workflow that sends an email with a voucher code to customers with the medium propensity to buy items from the electronics category. We will use the A/B/X tests to send the different vouchers to different groups of users. This way, we will be able to check the effectiveness of incentives of a different level. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Choose the segmentation of customers 1. As the first node of the workflow, add **Audience**. In the node settings: 1. In the **Define audience** section, select the [segmentation you created in the previous step](#create-a-segmentation), click **Apply** to confirm. 9. Confirm by clicking **Apply**. ### Add the ABx Test node --- 1. Add the **ABx Test** node. 2. Click **Add group** to create 4 groups of customers. By default, we have the group A and B with an equal 50/50 division - you can add another group here, and de-select the **Equal allocation** option if you want an unequal division. In our example, 4 groups are created. - **Group A**: 25% of the database - **Group B**: 25% of the database - **Group C**: 25% of the database - **Group D**: 25% of the database 3. Enable the **Generate a variant assignment event** option. As a result, Synerise will record which test variant a given customer was assigned to, which later allows you to analyze results and build segments based on that assignment. 4. To save your changes, click **Apply**.
`Screenshot presenting ABx Test node`
Screenshot presenting ABx Test node
### Add the Send Email node --- Add the **Send Email** node to 3 of the 4 groups in our workflow. 1. Add the **Send Email** node. In the node settings: 1. In the **Sender details** section, choose the email account from which the email will be sent. 2. In the **Content** section, type the **Subject** and from the **Template** dropdown, select [the template you created as part of the prerequsites](#prerequisites). In the email editor, click the Inserts button and from the dropdown list, select Pools. Find one of the [pools you created as a part of prerequisites](#prerequisites) and click it. Then copy its code and paste to the email template. 3. In the **UTM & URL parameters** section, you can define the UTM parameters added to the links included in the email. 4. In the **Additional parameters** section, you can optionally describe campaigns with [additional parameters](/docs/campaign/e-mail/creating-email-campaigns#adding-custom-parameters). 2. Click **Apply**. 3. Repeat the all steps in the two following Send Email nodes. Change the voucher pool ID in the content of the email template. 4. Add the **End** node to the last group of customers. By doing this, you will exclude this audience segment from receiving any communications, allowing you to determine how many of them make purchases without any incentives. ### Add the finishing node and set capping --- 1. Add the **End** node after each **Send Email** node. 2. In the upper right corner, click **Set Capping** and define the limit of workflows. 3. In the upper right corner, click **Save & Run**.
`Screenshot presenting the final automation`
The final workflow
## What's next --- Once your ABX workflow is live, it’s important to go beyond campaign delivery and take a closer look at the actual effectiveness of each variant. To support this analysis, make sure you enabled the **Generate a variant assignment event** option in the ABx Test node when building the workflow. This guarantees that Synerise will generate an `automation.abTestVariantAssigned` event, for each customer who passes through this node. With these events in place, you can now build four segments representing the groups who received different incentives: - automation.abTestVariantAssigned → variantName = A (10% discount) - automation.abTestVariantAssigned → variantName = B (15% discount) - automation.abTestVariantAssigned → variantName = C (20% discount) - automation.abTestVariantAssigned → variantName = X (no discount – control group) 1. Go to Decision Hub icon**Decision Hub > Segmentations > New segmentation**. 3. Enter the name of the segmentation. 4. Click **Add condition**. 4. From the dropdown list, select the `automation.abTestVariantAssigned` event. 5. Add the following conditions to the event: - **diagramId** – This parameter allows you to differentiate between multiple ABX tests running in your environment. The ID is the part of the URL that comes after /automation-diagram/, for example: **ced9c208-8adb-4879-b9dd-55c7aab50872** in the URL `https://app.synerise.com/automations/workflows/automation-diagram/ced9c208-8adb-4879-b9dd-55c7aab50872`. - **variantName** – This is the actual test group the user was assigned to: A → 15% discount B → 10% discount C → 5% discount D → No discount 7. Using the date picker in the lower-right corner, set the time range based on your business needs. Confirm by clicking **Apply**. 6. Save the segmentation. 8. Create the next segmentation. Repeat the steps.
Decision Hub segmentation configuration for an ABX coupon discount strategy test
Segmentation configuration
Once you’ve created these segments, you can analyze your results. You can for example compare performance metrics such as: - Open Rate (OR) - Click-Through Rate (CTR) - Conversions (transaction.charge) etc. You can also take the analysis a step further by comparing test results across different predictive groups. For example, do users from the "Low probability" group respond better to incentives than those who were originally scored as "High probability"? This can reveal whether your discounting strategy should be personalized not only by behavior but also by predicted intent. This layered analysis will help you understand not just which discount works best overall, but which incentive works best for which type of customer — and whether offering anything at all is even necessary in certain segments. This scenario assumes using the entire audience for the campaign and analyzing the results. If we want to run an A/B test and, after a defined period, send out the discount value that brings the highest benefits, we need to reserve X% of the audience for that final send. The winning discount will be selected based on performance metrics, using a metric filter. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of the following objects in the Synerise Demo workspace: - [target segmentation](https://app.synerise.com/analytics-v2/segmentations/f3e6db3b-d73d-4737-b50f-3b153b34e3df) - [prediction](https://app.synerise.com/ai-v2/predictions/roqlnshnmwob) - [final segmentation](https://app.synerise.com/analytics-v2/segmentations/8403ef59-5e32-41a1-8309-9a32eaf41f7d) - [workflow](https://app.synerise.com/automations/workflows/automation-diagram/ced9c208-8adb-4879-b9dd-55c7aab50872) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 10 events per profile that completes the flow: [`snr.propensity.score`](/docs/assets/events/event-reference/predictions#snrpropensityscore) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~2), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`automation.abTestVariantAssigned`](/docs/assets/events/event-reference/automation#automationabtestvariantassigned) (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1), [`voucherCode.assigned`](/docs/assets/events/event-reference/loyalty#vouchercodeassigned) (~1). ## Read more --- - [ABx Test node](/docs/automation/conditions/abx-split-node) - [Automation Hub](/docs/automation) - [Predictions](/docs/ai-hub/predictions) # Transaction trends dashboard Creating a transaction trends dashboard is an efficient way for businesses to keep track of their financial performance by analyzing transactional data. With this reporting tool, businesses can easily monitor trends in transaction values and purchase data. The goal of this dashboard is to provide a quick and clear overview of transactional activity, helping businesses to make data-driven decisions in real time. In this use case, you will design a transaction trends dashboard that enables businesses to gain insights into their financial performance by visualizing transactional data. ## Prerequisites --- - Implement a [tracking code](/developers/web/installation-and-configuration) on your website. - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). - Implement [OG tags](/developers/web/og-tags) on your website. ## Process --- In this use case, you will go through the following steps: 1. [Create metrics](#create-metrics) for a number and value of transactions, Average Order Value (AOV), and number of bought products. 2. [Create a histogram](#create-a-histogram) that presents a number and value of transactions in time. 3. [Create an expression](#create-an-expression) that returns the month and year for the `product.buy` event. 3. [Create reports](#create-reports) for most frequently bought products, most frequently bought products by categories and by month, most frequently bought categories by month, most frequently visited products, most frequently visited products by categories. 4. [Create a dashboard](#create-a-dashboard) that gathers created analyses.
These are just examples of analytics you can use, such a dashboard can be expanded with various other analytics suitable for your business needs.
## Create metrics --- In this part of the process, you will create four metrics for the `transaction.charge`, `product.buy` and `Visited page` events. They will be later used in [a histogram](#create-a-histogram),[reports](#create-reports) and [the dashboard](#create-a-dashboard). ### Number of transactions This metric will return the number of all transactions. 1. Go to Decision Hub icon **Decision Hub > Metrics > New metric**. 2. Enter the name of the metric. 3. As a metric kind, select **Simple metric**. 4. As the type, set **Event**. 5. As the aggregator, set **Count**. 4. As the occurrence type, set **All**. 5. From the **Choose event** dropdown list, select `transaction.charge`. 6. To select a specific time range, click the calendar icon. In our case, it will be **Lifetime**. Confirm your choice with the **Apply** button. 7. Click **Save**.
The view of the configuration of the metric returning the number of all transactions
Configuration of the metric returning the number of all transactions
### Transactions value This metric will return the value of transactions. 1. Go to Decision Hub icon **Decision Hub > Metrics > New metric**. 2. Enter the name of the metric. 3. As a metric kind, select **Simple metric**. 4. As the type, set **Event**. 5. As the aggregator, set **Sum**. 4. As the occurrence type, set **All**. 5. From the **Choose event** dropdown list, select `transaction.charge`. 6. Click the **+ where** button. **Result**: The **Choose parameter** button appears. 7. From the **Choose parameter** dropdown list, choose `$totalAmount`. 8. To select a specific time range, click the calendar icon. In our case, it will be **Lifetime**. Confirm your choice with the **Apply** button. 9. Click **Save**.
The view of the configuration of the metric returning the value of transactions
Configuration of the metric returning the value of transactions
### AOV This metric will return the avarage order value. 1. Go to Decision Hub icon **Decision Hub > Metrics > New metric**. 2. Enter the name of the metric. 3. As a metric kind, select **Simple metric**. 4. As the type, set **Event**. 5. As the aggregator, set **Average**. 4. As the occurrence type, set **All**. 5. From the **Choose event** dropdown list, select `transaction.charge`. 6. Click the **+ where** button. **Result**: The **Choose parameter** button appears. 7. From the **Choose parameter** dropdown list, choose `$totalAmount`. 8. To select a specific time range, click the calendar icon. In our case, it will be **Lifetime**. Confirm your choice with the **Apply** button. 9. Click **Save**.
The view of the configuration of the metric returning the AOV*
Configuration of the metric returning the AOV
### Number of bought products This metric will return the number of bought products. 1. Go to Decision Hub icon **Decision Hub > Metrics > New metric**. 2. Enter the name of the metric. 3. As a metric kind, select **Simple metric**. 4. As the type, set **Event**. 5. As the aggregator, set **Sum**. 4. As the occurrence type, set **All**. 5. From the **Choose event** dropdown list, select `product.buy`. 6. Click the **+ where** button. **Result**: The **Choose parameter** button appears. 7. From the **Choose parameter** dropdown list, choose `$quantity`. 8. To select a specific time range, click the calendar icon. In our case, it will be **Lifetime**. Confirm your choice with the **Apply** button. 9. Click **Save**.
The view of the configuration of the metric returning the number of bought products
Configuration of the metric returning the number of bought products
### Number of visits on the product page This metric will return the number of visits on the product page. 1. Go to Decision Hub icon **Decision Hub > Metrics > New metric**. 2. Enter the name of the metric. 3. As a metric kind, select **Simple metric**. 4. As the type, set **Event**. 5. As the aggregator, set **Count**. 4. As the occurrence type, set **All**. 5. From the **Choose event** dropdown list, select `Visited page`. 6. Click the **+ where** button. **Result**: The **Choose parameter** button appears. 7. From the **Choose parameter** dropdown list, choose `product:retailer_part_no`. 5. From the **Choose operator** dropdown list, select **String** and **Is not empty**. 8. To select a specific time range, click the calendar icon. In our case, it will be **Lifetime**. Confirm your choice with the **Apply** button. 9. Click **Save**.
The view of the configuration of the metric returning the number of visits on the product page
Configuration of the metric returning the number of visits on the product page
## Create a histogram --- In this part of the process, you will create a histogram for the [transactions value](#transactions-value) and [number of bought products](#number-of-bought-products) metrics. They will be later used in [the dashboard](#create-a-dashboard). 1. Go to Decision Hub icon **Decision Hub > Histograms > New histogram**. 2. Enter the name of the histogram. 3. From the **Choose metric** dropdown, select the [transactions value metric](#transactions-value) created in the previous step. 4. Click the **Interval** button and set it for **day**. 5. To select a specific time range, click the calendar icon. In our case, it will be **Last 30 days**. Confirm your choice with the **Apply** button. 6. Add another metric to the histogram: 1. Click the Add new tab button. 2. Repeat steps 3-5 for the [number of bought products metric](#number-of-bought-products) created in the previous step. 7. Click **Save**.
The view of the configuration of the histogram
Configuration of the histogram
## Create an expression --- In this part of the process, create an expression for the `product.buy` event. It will return month and year of the purchase and will be later used in [reports](#create-reports). 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. Enter the name of the expression. 3. Set the **Expression for** option to **Event**. 4. From the **Choose event** dropdown list, select `product.buy` event. 5. Build the following formula of the expression:
The view of the configuration of the expression
Configuration of the expression which returns the date in month/year format
6. Save the expression. ## Create reports --- In this part of the process, you will create reports: - for most frequently bought products, - most frequently bought products by categories, - most frequently bought products by month, - most frequently bought categories by month, - most frequently visited products, - most frequently visited products by categories. All the reports will be used in the [dashboard](#create-a-dashboard) in the further part of the process.
Most frequently bought products

This report will return the names of most frequently bought products and its values.

  1. Go to Decision Hub icon Decision Hub > Reports > New report.
  2. Enter a meaningful name of the report.
  3. Click the Choose metric and from the dropdown list, select a metric that returns the number of bought products, created in the previous part of the process.
  4. From the Range dropdown list, select the number of top (the most frequently bought) products to be shown in the preview of the report. In this case, it will be TOP 20 products.
  5. In the Dimension section, from the dropdown list, select Events > Parameters. To be able to show product names in the report, choose `title`.
  6. To select a specific time range, click the calendar icon. In our case, it will be Lifetime. Confirm your choice with the Apply button.
  7. Click Save.
    The view of the configuration of the wost frequently bought products report
    Configuration of the most frequently bought products report
Most frequently bought products by categories

This report will return the names of most frequently bought products and its values by its categories.

  1. Go to Decision Hub icon Decision Hub > Reports > New report.
  2. Enter a meaningful name of the report.
  3. Click the Choose metric and from the dropdown list, select a metric that returns the number of bought products, created in the previous part of the process.
  4. From the Range dropdown list, select the number of top (the most frequently bought) products to be shown in the preview of the report. In this case it will be TOP 20 products.
  5. In the Dimension section, from the dropdown list, select Events > Parameters. To be able to show products name in the report, choose `category`.
  6. To select a specific time range, click the calendar icon. In our case, it will be Lifetime. Confirm your choice with the Apply button.
  7. Click Save.
Most frequently bought products - monthly comparison

This report will return the names of most frequently bought products by categories and its values in a specific month.

  1. Go to Decision Hub icon Decision Hub > Reports > New report.
  2. Enter a meaningful name of the report.
  3. Click the Choose metric and from the dropdown list, select a metric that returns number of bought products, created in the previous part of the process.
  4. From the Range dropdown list, select the number of top (the most frequently bought) products to be shown in the preview of the report. In this case, it will be TOP 20 products.
  5. In the Dimension section, from the dropdown list, select Events > Parameters. To be able to show product names in the report, choose `title`.
  6. Click Add dimension.
    1. Click Choose dimension and from the dropdown list, select Events > Expressions. To be able to show the date of the transaction in the month/year format choose the expression you created in the previous part of the process.
  7. To select a specific time range, click the calendar icon. In our case it will be Lifetime. Confirm your choice with the Apply button.
  8. Click Save.
Most frequently bought products by categories - monthly comparison

This report will return the names of most frequently bought products by categories and its values in a specific month.

  1. Go to Decision Hub icon Decision Hub > Reports > New report.
  2. Enter a meaningful name of the report.
  3. Click the Choose metric and from the dropdown list, select a metric that returns the number of bought products, created in the previous part of the process.
  4. From the Range dropdown list, select the number of top (the most frequently bought) products to be shown in the preview of the report. In this case, it will be TOP 20 products.
  5. In the Dimension section, from the dropdown list, select Events > Parameters. To be able to show products name in the report, choose `category`.
  6. Click Add dimension.
    1. Click Choose dimension and from the dropdown list, select Events > Expressions. To be able to show the date of the transaction in the month/year format choose the expression you created in the previous part of the process.
  7. To select a specific time range, click the calendar icon. In our case, it will be Lifetime. Confirm your choice with the Apply button.
  8. Click Save.
Most frequently visited products

This report will return the names of most frequently visited products and its values.

  1. Go to Decision Hub icon Decision Hub > Reports > New report.
  2. Enter a meaningful name of the report.
  3. Click the Choose metric and from the dropdown list, select a metric that returns the number of visits on the product page, created in the previous part of the process.
  4. From the Range dropdown list, select the number of top (the most frequently bought) products to be shown in the preview of the report. In this case, it will be TOP 20 products.
  5. In the Dimension section, from the dropdown list, select Events > Parameters. To be able to show product names in the report, choose `og:title`.
  6. Switch off the Show null values toggle.
  7. To select a specific time range, click the calendar icon. In our case it will be Lifetime. Confirm your choice with the Apply button.
  8. Click Save.
Most frequently visited products by categories

This report will return the names of most frequently visited products and its values by categories.

  1. Go to Decision Hub icon Decision Hub > Reports > New report.
  2. Enter a meaningful name of the report.
  3. Click the Choose metric and from the dropdown list, select a metric that returns the number of visits on the product page, created in the previous part of the process.
  4. From the Range dropdown list, select the number of top (the most frequently bought) products to be shown in the preview of the report. In this case, it will be TOP 20 products.
  5. In the Dimension section, from the dropdown list, select Events > Parameters. To be able to show products name in the report, choose `product:category`.
  6. Switch off the Show null values toggle.
  7. To select a specific time range, click the calendar icon. In our case, it will be Lifetime. Confirm your choice with the Apply button.
  8. Click Save.
## Create a dashboard --- In the final part of the process you will create a dashboard with the [metrics](#create-metrics), [reports](#create-reports) and [the histogram](#create-a-histogram) created in previous steps. 1. Go to Decision Hub icon **Decision Hub > Dashboards > Add dashboard**. 2. Enter the name of the dashboard. 3. To add a widget to the dashboard, click an icon on the The panel of analysis icons panel. The icons are (left to right): HTML code, text field, image, [segmentation](/docs/analytics/segmentations/creating-segmentations), [trend](/docs/analytics/trends/creating-trends), [funnel](/docs/analytics/funnels/creating-funnels), [metric](/docs/analytics/metrics/creating-simple-metrics), [histogram](/docs/analytics/histograms/creating-histograms), [aggregate](/docs/crm/aggregates/creating-profile-aggregates), [expression](/docs/crm/expressions), and a [report](/docs/analytics/reports/creating-reports).
You can create a custom template according to your business needs with the help of this [article](/docs/analytics/analytics-dashboard/creating-dashboards) or follow the sample instructions below.
4. Add a metric by clicking the Metric icon on the dashboard panel on the panel.
You can adjust the size of widgest by dragging their lower right corner.
5. Edit widget contents with the editor on the right. In the **Metric** section, choose the [metric that returns the number of all transactions you have created in the previous part of the process](#number-of-transactions). You can change the title and description. Do the same for the following [metrics created in the previous part of the process](#create-metrics): transactions value, AOV, and number of bought products
The view of the configuration of the metric on the dashboard
Configuration of the metric widget
6. Add a histogram by clicking the Histogram icon on the panel. 7. Edit widget contents with the editor on the right. In the **Histograms** section, choose the [histogram for the transactions value and number of bought products you have created in the previous part of the process](#create-a-histogram). You can change the title and description. 8. Click the **Style** section in the widget editor and change **Visualization type** to **Column**.
The view of the style configuration of the histogram
Style configuration of the histogram
9. Add a report by clicking the Report icon on the panel. 10. Edit widget contents with the editor on the right. In the **Reports** section, choose the [report for most frequently bought products you have created in the previous part of the process](#create-reports). You can change the title and description. 11. Click the **Style** section in the widget editor and change **Visualization type** to **Table**. 12. Do the same for the following [reports created in the previous part of the process](#create-reports): most frequently bought products by categories, most frequently bought products - month comparison, most frequently bought products by categories - month comparison, most frequently visited products, most frequently visited products by categories.
You can look up the sample dashboard created in the Demo workspace [here](https://app.synerise.com/analytics/dashboards/9a11421a-8da9-40ad-bf9f-6693c44663f5)
10. When you complete creating the dashboard, click **Save dashboard**.
By default, a new dashboard is private. If you want to share it with others, check the instruction [here](/docs/analytics/analytics-dashboard/sharing-dashboards).
## Check the use case set up on the Synerise Demo workspace --- You can check all configurations directly in Synerise Demo workspace: - Metrics - [Number of transactions](https://app.synerise.com/analytics/metrics/6b93889f-3967-4149-b6a5-37fbd26e3155) - [Value of transactions](https://app.synerise.com/analytics/metrics/774a54a2-9830-4e7f-9a69-c32009552a3a) - [AOV](https://app.synerise.com/analytics/metrics/2d536298-dd87-4d73-be8f-a2ae493044fe) - [Number of bought products](https://app.synerise.com/analytics/metrics/2ee8c7e4-300f-4d26-a0f0-0be7d0a61ecc) - [Number of visits on the product card](https://app.synerise.com/analytics/metrics/eb1d3b8c-9e71-42bf-8cfe-6f5d56c66863) - [Histogram](https://app.synerise.com/analytics/histograms/50645c5d-bcbd-4731-96c7-946b151621b7) - [Expression](https://app.synerise.com/analytics/expressions/7a25c893-45be-4dfd-a54e-fa9f0ff68c5f) - Reports - [Most frequently bought products](https://app.synerise.com/analytics/reports/e9665c7b-03d4-42ed-9c4e-919a75e4160e) - [Most frequently bought products by categories](https://app.synerise.com/analytics/reports/c888152c-ab63-4bb9-916e-723a54701595) - [Most frequently bought products - month comparison](https://app.synerise.com/analytics/reports/ee008cde-256e-4767-b316-adf2855fc939) - [Most frequently bought products by categories - month comparison](https://app.synerise.com/analytics/reports/3c286572-ba0a-47d7-9aaf-7d485910f63b) - [Most frequently visited products](https://app.synerise.com/analytics/reports/a1867119-e1d3-4557-8523-4b8d1f416cb3) - [Most frequently visited products by categories](https://app.synerise.com/analytics/reports/eb01a20c-12f6-45b8-bbca-402531f7e06a) - [Dashboard](https://app.synerise.com/analytics/dashboards/9a11421a-8da9-40ad-bf9f-6693c44663f5) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case does not generate any events. ## Read more --- - [Dashboards](/docs/analytics/analytics-dashboard) - [Expressions](/docs/crm/expressions) - [Histograms](/docs/analytics/histograms) - [Metrics](/docs/analytics/metrics) - [Reports](/docs/analytics/reports) # Promotion for the first transaction after joining the loyalty program It is very important to engage new users who have just joined your in-app loyalty program and encourage them to make purchases. For this purpose, you can use a push notification that will automatically notify them about a promotion in the application that will give them a discount on their first purchase. This is a good way to generate profits, especially if the promotion is time limited and the first purchases must be made within a certain period. This approach can lead to boosting customer satisfaction, increasing revenue and customer loyalty to your business. In this use case, we will create a promotion for new loyalty program members and a workflow which will send a mobile push notification with the information about the special promotion in the mobile app (10% discount for the whole cart). The promotion will be available for 14 days from the date of joining the loyalty program and can be used only once. ## Prerequisites --- - [Implement Synerise SDK in your mobile app](/developers/mobile-sdk). - [Implement promotions in your mobile application](/developers/mobile-sdk/loyalty) and through [API](https://hub.synerise.com/api-reference/loyalty-and-engagement#operation/profileLogin). - Implement mobile pushes in your mobile application: [iOS](/developers/mobile-sdk/configuring-push-notifications/ios), [Android](/developers/mobile-sdk/configuring-push-notifications/android). - Collect the [custom event](/developers/mobile-sdk/event-tracking) which sends information to Synerise about joining a loyalty program (for example `account.status` with parameter `accountStatus` equal to `active`). Such an event with the appropriate status should be sent each time the membership status changes (when the customer resigns from the program or joins again).
In this case, when a customer joins the loyalty program, a custom event is generated on their card. However, these conditions and the scenario can be adapted to your business needs, for example, you can count the customers who joined the loyalty program using the registration event in the mobile application.
## Process --- In this use case, you will go through the following steps: 1. [Create aggregates](/use-cases/discount-promotion-for-first-transaction#create-aggregates) which return the time of joining the loyalty program and current status of customer's membership. 2. [Create a segmentation](/use-cases/discount-promotion-for-first-transaction#create-a-segmentation) of customers who have your mobile app and joined the loyalty program during last 14 days. 3. [Create a promotion](/use-cases/discount-promotion-for-first-transaction#create-a-promotion). 4. [Prepare a mobile push notification](/use-cases/discount-promotion-for-first-transaction#prepare-a-mobile-push-notification) with information about the promotion. 5. [Create a workflow](/use-cases/discount-promotion-for-first-transaction#create-a-workflow) to send the mobile push. ## Create aggregates --- ### Time of joining the loyalty program Start with creating an aggregate that returns the time of the first occurrence of the `account.status` event. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **First**. 4. Select the event `account.status`. 5. As a parameter choose **Timestamp**. 6. Select the **accountStatus**. 7. Use operator **equal** and add as the value `active`. 8. Define the period for the event as **Lifetime**. 9. **Save** the aggregate.
Decision Hub First aggregate returning the TIMESTAMP of the first account.status event with active status over a customer's lifetime
Configuration of the aggregate
### Current status of the membership Create the second aggregate analyzing the current status of the customer's membership. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last**. 4. Select the event **account.status**. 5. As a parameter choose **accountStatus**. 6. Define the period for the event as **Lifetime**. 7. To save the aggregate, click **Save**.
Decision Hub Last aggregate returning the last accountStatus parameter of account.status events in a customer's lifetime
Configuration of the aggregate
## Create a segmentation --- In this part of the process, you create a segmentation of customers who installed your mobile app and joined the loyalty program during last 14 days. 1. Go to Behavioral Data Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of segmentation. 3. Choose **Add condition** and find the [aggregate counting the time of joining the loyalty program](/use-cases/discount-promotion-for-first-transaction#time-of-joining-the-loyalty-program), created in the previous step. 4. Choose option **Custom** and select the date range as last 14 days. This way we can be sure that we analyze only the customers who joined the loyalty club for the first time during last 14 days (time in which the promotion is available), and we exclude the customers who join the club, resign and try to join another time to use the promotion for the second time. 5. Choose **Add condition** and find the [aggregate analyzing the active status of the customer's membership](/use-cases/discount-promotion-for-first-transaction#current-status-of-the-membership), created in the previous step. 6. As an operator, choose **Equal** and add the value `active`. 7. Save the aggregate.
The segmentation settings
The segmentation settings
## Create a promotion --- Create a promotion for customers who joined the loyalty program. The promotion gives a 10% discount for the entire transaction and is valid only once per user. It will be targeted for the audience created in the previous step. 1. Go to AI Hub icon **AI Hub > Regular Promotions > Add promotion**. 2. Select the **For entire cart** option. 3. In the **Audience** section, select the segmentation created in [this step](/use-cases/discount-promotion-for-first-transaction#create-a-segmentation). Your promotion will be activated only for this group of customers. Confirm your selection, by clicking **Apply**. 4. In the **Content** section, define the name, description, and an image of the promotion. Confirm the settings by clicking **Apply**. 5. In the **Limit per profile** field, enter `1` to make sure that this discount can be used only once. 6. In **Type & limits** section: 1. As a Discount type, choose **Percentage**. 2. In the Cart section, as the minimum value, enter `10`, and click **Apply**. 6. In the **Schedule** section, define the distribution period. 7. **Optional**: In the **Stores** section, specify stores where the promotion is available.
This is possible only if the list of stores is imported into a [catalog](/docs/assets/catalogs).
8. In **Items** section, choose the main product catalog with all products a customer can buy with this discount. If you want to narrow down the list of categories a customer can choose from, use one of the options presented below (Selected items/Filtered items). If discount should be active for all products, choose **Entire catalog**. 9. In **Exclude items** section, you can exclude a specific product or categories for which the discount is not active. 10. To apply all changes and run the promotion, click **Publish**. Once the promotion is published, it will be visible immediately to all customers defined in the **Audience** section in your mobile app (users who joined loyalty program during last 14 days). ## Prepare a mobile push notification --- 1. Go to **Experience Hub > Mobile > Templates**. 2. Create your mobile push in the code editor. For more information on creating a simple mobile push, visit our [User Guide](/docs/campaign/Mobile/creating-mobile-push).
Example of mobile push notification
Example of mobile push notification
## Create a workflow --- In this part of the process, prepare a workflow that notifies customers who joined loyalty program about the promotion in the mobile app. 1. Go to **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. 3. As the first node of the workflow, add **Profile Event**, and choose the event which signifies joining the loyalty program. 4. As the next node, choose **Delay**. In the settings of the node, set the delay period to 10 minutes. 5. Add **Profile Filter** to check if the user made a transaction during last 10 minutes. To do it, select the `transaction.charge` event and set up the time range as last 10 minutes. Mark this filter as not matched. 6. As the last node, add **Send Mobile Push** for users who matched used Profile Filter. In the configuration of the **Send Mobile Push** node: 1. Select the type of the mobile push notification.. 2. Select the push template created in [this part](/use-cases/discount-promotion-for-first-transaction#prepare-a-mobile-push-notification) of the process. 6. Set up the Action limit for the Send Mobile Push as one time per workflow. 7. Set the capping for the workflow to make sure that it will be available once for every user (choose very distant date for example, once in 1000 months). 7. Confirm the settings by clicking **Apply**. 7. Add the **End** node to finish the workflow. 8. Click **Save & Run**.
Automation Hub workflow for sending a discount promotion on first transaction
Workflow configuration
## Check the use case set up on the Synerise Demo workspace --- In the Synerise Demo workspace, you can check: - [Segmentation](https://app.synerise.com/analytics-v2/segmentations/e87b4f75-803a-4593-9649-9c35bae5b377) - [Aggregate returning the time of joining the loyalty program](https://app.synerise.com/analytics/aggregates/9b862d15-7301-31c1-a830-ea6b5c3e392d) - [Aggregate returning current status of membership](https://app.synerise.com/analytics/aggregates/4538a92b-b5e7-338e-a7f0-a4c690b63272). - [Promotion](https://app.synerise.com/campaigns/promotions/de7a11c5-795f-4eda-ade6-cc45f021022c) - [Workflow](https://app.synerise.com/automations/automation-diagram/3b673608-34c4-4013-8d60-99f01b0a8cf1) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 9 events per profile that completes the flow: `account.status` (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`push.send`](/docs/assets/events/event-reference/mobile-push#pushsend) (~1), [`push.view`](/docs/assets/events/event-reference/mobile-push#pushview) (~1), [`push.click`](/docs/assets/events/event-reference/mobile-push#pushclick) (~1). ## Read more --- - [Creating promotions](/docs/ai-hub/promotions) - [Loyalty programs basics](/use-cases/loyalty-programs-basics) - [Mobile push notifications](/docs/campaign/Mobile) - [Workflow](/docs/automation/creating-automation) # Email with the products most frequently visited by a customer It is worth remembering how important it is to analyze what users view on the website, what subpages they visit and how much time they spend there. Behavioral data is the basis for creating a specific marketing strategy and appropriate personalization. Remember that even if the users do not add anything to the basket, they can be reminded of the products they most often visited by sending them a personalized email. ## Example of use - Electronic industry A client from the electronics industry decided to make use of information about the products customers viewed. However, instead of sending them the products they viewed recently, they were sent most viewed products in general.
Screenshot presenting personalized email with top products
Email with top products
If the customers were on the site but did not add anything to the cart, after the session ended, they would receive an email with the products they visited more than once - ordered from the most to the least frequently visited. ## Prerequisites --- To implement this use case, you have to: - Implement [tracking code](/docs/settings/tool/tracking_codes) on your website. - Implement [OG Tags](/developers/web/og-tags). - Import [product feed](/developers/product-feed). - Create [product catalog](/docs/assets/catalogs). - Integrate [transaction events](/developers/web/transactions-sdk). - Have [add to cart event](/docs/assets/events/event-definitions). - Create and set up your [email account](/docs/campaign/e-mail/configuring-email-account). - Import your [subscriber's database](/docs/automation/actions/synerise-integrations/import-customers) to Synerise. ## Process --- To create an email with products most frequently visited, perform the steps in the following order: 1. [Prepare the aggregate](/use-cases/email-with-products-most-frequently-visited#prepare-the-aggregate). 2. [Prepare a product catalog](/use-cases/email-with-products-most-frequently-visited#prepare-a-product-catalog) 2. [Prepare the workflow](/use-cases/email-with-products-most-frequently-visited#prepare-the-workflow). ## Prepare the aggregate --- Build an aggregate that collects the SKUs of the most frequently visited products. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **TOP MULTI**. 3. In the Size field, enter the number of recent events (for example, 10). 4. Select the event `page.visit` and the `retailer_part_no`. 5. Click button + where and add the condition that the `product:retailer_part_no` parameter is true. This will give us confidence that we only take into account the visited product pages. 5. Save your aggregate.
`Screenshot presenting aggregate with recently viewed product`
The aggregate with recently viewed product
## Prepare a product catalog --- The event page.visit contains the most important information about the product - its ID in the product:retailer_part_no parameter. To add additional information about the product in the email template, such as a photo, price, link, you need a product catalog. You can import your feed following these [instructions](/docs/assets/imports) or you can use Snrs-product-ogTag catalog which is automatically built from the product page og tags. ## Prepare the workflow --- 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Add an **Profile Event** as a trigger node. 3. Select the **session.end** event.
`Screenshot presenting using trigger`
Configuration of the Profile Event node
4. Click **Delay** to define the duration of delay - after the session ends, the system waits for the time defined in the Delay node before the email is sent.
`Screenshot presenting delay`
Configuration of the Delay node
Remember that event session.end appears 30 minutes after the last user activity on the website.
5. Add the **Generate Event** node. It generates an event on the customer's profile. In this case, the event will contain ID of the most frequently viewed products by a customer. 1. In the **Event name**, enter the name, for example `topvisited.products`. 3. In the **Body**, enter the Jinjava code available below. Replace AGGREGATE_HASH with the hash of the aggregate you in the previous step. As a result you will analyze the products that the user has viewed, sort them in order of the most frequently viewed to the least viewed (products that have been viewed at least two times) and return them to the user’s card in this event.
`Screenshot presenting sending Profile Event`
Generate Event
An event created in this way will return all the products that the user saw at least twice within the time specified in your aggregate. The event with parameter will be returned in the form of the sku listed after the decimal point, e.g.: top: sku1, sku2, sku3.
CHECK JINJA CODE
{ "top": "{% set skus = [] %} {% set counter = [] %} {% set skusTmp = [] %} {% set skuDict = [] %} {% set sortDict = [] %} {% aggregate AGGREGATE_HASH %} {% for sku in aggregate_result|unique %}{% set k = [] %}{% for tmp in aggregate_result %}{% if sku == tmp %}{% do k.append('+') %}{% endif %}{% endfor %}{% do skuDict.append({'sku':sku,'counter':k|length }) %}{% endfor %}{% endaggregate %}{% for dictItem in skuDict %}{% do counter.append(dictItem.counter)%}{% endfor %}{% set sortCounter = counter|sort() %}{% for count in sortCounter %}{% for dictItem in skuDict %}{% if dictItem.counter == count && dictItem.sku in skusTmp == false %}{% do skusTmp.append(dictItem.sku) %}{% do sortDict.append(dictItem) %}{% endif %}{% endfor %}{% endfor %}{% set top = [] %}{% set len = sortDict|length + 1 %} {% for i in range(len) %}{% set ind = sortDict|length - i %}{% set item = sortDict[ind] %}{% if sortDict[ind].counter > 1 %}{% do top.append(sortDict[ind].sku) %}{% endif %}{% endfor %}{{ top|join(',')|trim }}" }
`Screenshot presenting effect after implementing jinjava`
Effect after implementing jinjava
6. Add **Profile Event Filter**. This node allows you to wait for the event sent in the previous node. When the event appears on the customer's profile, it will be possible to refer to its parameters in the next node - here in **send.email**, you will refer to the "Top" parameter via `{{event.params.top}}`
`Screenshot presenting Profile Event Filter`
Configuration of the Profile Event Filter node
7. Add the **Send Email** node. In the message template, we can use {{event.params.top}} which will return the "top" parameter of the last event we sent. For example, sku1, sku2, sku3 which can then be converted into an array using the | split (',') function and use in the template structure.
{% set topProducts = event.params.top %} 
      {% set skus = topProducts|split(',') %}
Additionally - to add the most visited products , you will have to use Jinjava and add your own CSS. If you want to display all objects that are under the key products, follow the instruction:
<!-- Opening the tag that retrieves the value from the aggregate prepared in point 1 -->
   {% aggregate XXXXXXXXXXX %}
   <!-- In the section {% for r in aggregate_result %} ... {% endfor %} there is access to product:retailer_part_no of the 10 most visited products -->
   {% for r in aggregate_result %}
   next item:
   {{r}}
   <!-- r is a single product:retailer_part_no and can be used as the key: {% catalog.Snrs-produktu-ogTag(r).og:XXX %} downloads additional data from a catalog built on the basis of og tags - which information about the product you want to add in the template depends on you. If you want to add the product name, photo, link, price in the e-mail - you can take it from the catalog -->
   {% catalog.Snrs-produktu-ogTag(r).og:image %}
   {% catalog.Snrs-produktu-ogTag(r).og:title %}
   {% catalog.Snrs-produktu-ogTag(r).product:price:amount %}
   {% catalog.Snrs-produktu-ogTag(r).og:url %}
   {% endfor %}
   <!-- Closing of the tag that gets the value from the aggregate prepared in point 1 -->
   {% endaggregate %}
To find the aggregate ID to replace XXX in the code, simply navigate to the aggregate in the Synerise application. The ID is the part of the URL that comes after /aggregates/, for example: **bfba46b4-e0d6-3ea9-8ae6-c7a2495c54c7** in the URL `https://app.synerise.com/analytics-v2/aggregates/bfba46b4-e0d6-3ea9-8ae6-c7a2495c54c7`. Copy this ID and use it in your code where needed.
8. Add final settings: - Add the End nodes where the workflow should finish for users. - Specify capping (here 1 for 1 day). - Optionally add titles to each node so the workflow will be more understandable for your colleagues. - Name the automation and Save it or Save & Run. - Save your workflow. **Results:**
`Screenshot presenting automation`
Workflow
**It will result in an array:** skus = [sku1, sku2, sku3] which we can then use to build a template - we can, for example, download items from the product catalog and simply display them in our email or download similiar recommendations for the most viewed item (skus [0])
Based on this workflow, you can also extract the user's favorite brand (by creating an aggregate that collects the brand parameter transferred in page visits, adding products to the cart or transactions).
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of each step directly in the Synerise Demo workspace: - [Aggregate](https://app.synerise.com/analytics/aggregates/bfba46b4-e0d6-3ea9-8ae6-c7a2495c54c7) - [Workflow](https://app.synerise.com/automations/workflows/automation-diagram/e2685ff9-390e-47c7-805f-377f35f49bc4) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 11 events per profile that completes the flow: [`session.end`](/docs/assets/events/event-reference/web-and-app#sessionend) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~4), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), `topvisited.products` (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates/creating-profile-aggregates) - [Email template](/docs/campaign/e-mail/creating-email-templates) - [Jinjava inserts](/developers/inserts/insert-usage) - [Product feed to catalogs](/use-cases/import-product-feed-to-catalog) - [Workflow](/docs/automation/creating-automation) # Export Multiple Metrics with Dynamic Keys to Amazon S3 Efficiently managing and analyzing metrics is crucial for optimizing operations and making informed decisions. However, manually creating and maintaining separate metrics for different brands, segments, or reporting needs can be time-consuming and complex. Simplify the process with dynamic keys and reduce the number of metrics required to build reports. In this use case, we will export three metrics for two different brands to Amazon S3 - with a total of six results. We want to report on the sales volume of products in a given category and brand, as well as the number of products sold for the previous week. The metrics and dynamic keys used in this use case are only an example. You can export any other metrics with dynamic keys as needed, the value of the dynamic key can be static or dynamic (Jinjava). ## Prerequisites --- - You must have an account on AWS. - You must be granted a user role that includes the `Data export > Export metrics result` permission. ## Process --- In this use case, you will go through the following steps: 1. [Create metrics](#create-metrics) with dynamic key for value of sold products and number of sold products from a specific category, value of products sold from a particular brand. 2. [Create a workflow](#create-a-workflow) sending two different metric reports to Amazon S3. ## Create metrics --- In this part of the process, you will create three metrics for the `product.buy` event. ### Value of products sold from a category 1. Go to Decision Hub icon **Decision Hub > Metrics > New metric**. 2. Enter the name of the metric. 3. As a metric kind, select **Simple metric**. 4. As the type, set **Event**. 5. As the aggregator, set **Sum**. 4. As the occurrence type, set **All**. 5. From the **Choose event** dropdown list, select `product.buy`. 6. From the **Choose parameter** dropdown list, select the `finalUnitPrice` parameter. 7. Click the **+ where** button. 8. From the **Choose parameter** dropdown list, select the `category` parameter. 9. From the **Choose operator** dropdown list, choose **String**, and then select **Equal**. 10. Next to the operator, click the String data type icon icon until you get two fields: **Dynamic key** and **Value**. 1. In the **Dynamic key** field, enter the name of the dynamic key, in our case: `productCategory`. The value for the key will be sourced from the `category` parameter. 2. In the **Value** field, enter `none`. 6. To select a specific time range, click the calendar icon. In our case, it will be **Last week**. Confirm your choice with the **Apply** button. 7. Click **Save**.
The view of the value of products sold from a category metric configuration
Configuration of the value of products sold from a category metric
### Number of products sold from a category 1. Go to Decision Hub icon **Decision Hub > Metrics > New metric**. 2. Enter the name of the metric. 3. As a metric kind, select **Simple metric**. 4. As the type, set **Event**. 5. As the aggregator, set **Sum**. 4. As the occurrence type, set **All**. 5. From the **Choose event** dropdown list, select `product.buy`. 6. From the **Choose parameter** dropdown list, select the `quantity` parameter. 7. Click the **+ where** button. 8. From the **Choose parameter** dropdown list, select the `category` parameter. 9. From the **Choose operator** dropdown list, choose **String**, and then select **Equal**. 10. Next to the operator, click the String data type icon icon until you get two fields: **Dynamic key** and **Value**. 1. In the **Dynamic key** field, enter the name of the dynamic key, in our case: `productCategory`. The value for the key will be sourced from the `category` parameter. 2. In the **Value** field, enter `none`. 6. To select a specific time range, click the calendar icon. In our case, it will be **Last week**. Confirm your choice with the **Apply** button. 7. Click **Save**.
The view of the number of products sold from a category metric configuration
Configuration of the number of products sold from a category metric
### Value of products sold from a brand 1. Go to Decision Hub icon **Decision Hub > Metrics > New metric**. 2. Enter the name of the metric. 3. As a metric kind, select **Simple metric**. 4. As the type, set **Event**. 5. As the aggregator, set **Sum**. 4. As the occurrence type, set **All**. 5. From the **Choose event** dropdown list, select `product.buy`. 6. From the **Choose parameter** dropdown list, select the `finalUnitPrice` parameter. 7. Click the **+ where** button. 8. From the **Choose parameter** dropdown list, select the `brand` parameter. 9. From the **Choose operator** dropdown list, choose **String**, and then select **Equal**. 10. Next to the operator, click the String data type icon icon until you get two fields: **Dynamic key** and **Value**. 1. In the **Dynamic key** field, enter the name of the dynamic key, in our case: `brandName`. The value for the key will be sourced from the `brand` parameter. 2. In the **Value** field, enter `none`. 6. To select a specific time range, click the calendar icon. In our case, it will be **Last week**. Confirm your choice with the **Apply** button. 7. Click **Save**.
The view of the value of products sold from a brand metric configuration
Configuration of the value of products sold from a brand metric
## Create a workflow --- Create a workflow that sends the metrics data for two different brands to Amazon S3 once a week. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Scheduled Run trigger node --- At this stage, configure the conditions that trigger the workflow. 1. As the trigger node, select **Scheduled Run**. 2. In the configuration of the node: 1. Leave the **Run trigger** option at default (**all time**). 2. Select the timezone in which the workflow will be launched. 3. To launch the workflow every week at the defined time, click the **Every week** tab below. 4. Select the desired day, in our case **Monday**. 5. Click **Add time** and set it according to your needs, in our case to `9:45`. 6. Confirm by clicking **Apply**. ### Configure the Get Metrics node --- As the next node, choose **Get Metrics** to retrieve metrics for specific categories and brand. 1. Optionally, in the **Time range** field, on the calendar, select the time range from which you want to get the results of the metric or metrics. The time range you select will override the original time range settings of the metrics. 2. In the **Select metrics** field, select [metrics created in the previous part of the process](#create-metrics). 3. In the **Dynamic keys** section: - in the **brandName**, enter the name of the brand - in the **productCategory**, enter the name of the category 4. Confirm by clicking **Apply**.
The view of Get Metrics node configuration
Get Metrics node configuration
### Configure Send file to Amazon S3 Bucket node --- 1. Click **Amazon S3 Bucket > Send File**. 2. Click **Select connection**. 3. From the dropdown list, select the connection. - If no connections are available or you want to create a new one, see [Create a connection](/docs/automation/integration/amazon-s3-bucket/send-file-amazon-s3-bucket#create-a-connection). - If you selected an existing connection, proceed with the integration settings. 4. In the **Region** field, enter the region of your bucket. 5. In the **Bucket** field, enter the name of an existing container in your storage. 6. In the **Path to directory** field, enter the path to the existing bucket in which the file will be saved. 7. In the **File name** field, enter the name of the file you want to send to the storage. If the file already exists, the contents of the file will be overwritten. 8. From the **File format** dropdown list, select the format in which the file will be saved in the storage. 9. Confirm by clicking **Apply**.
The configuration of the Send file to Amazon S3 Bucket node
The configuration of the Send File node
10. Repeat the configuration of the second **Get Metrics** node but for a different brand and **Send file to Amazon S3 Bucket** node.
Add the second **Get Metrics** node with the same settings except for values in **brandName** and **productCategory** fields. This way, the same set of metrics will produce results for different contexts.
### Add the finishing node 1. Add the **End** node. 2. In the upper right corner, click **Save & Run**.
Automation Hub workflow for retrieving and processing metrics data
The workflow configuration
## Check the use case set up on the Synerise Demo workspace --- You can check the: - [Value of products sold from a category metric](https://app.synerise.com/analytics/metrics/9721f381-8f18-4a40-aa86-25f2824f0d41) - [Number of products sold from a category metric](https://app.synerise.com/analytics/metrics/b1469768-a17e-4985-9544-0d23dd612afc) - [Value of products sold from a brand metric](https://app.synerise.com/analytics/metrics/39bcbcfc-9026-4cf8-a526-77926404fd56) - [Workflow](https://app.synerise.com/automations/workflows/automation-diagram/f604360f-0003-4749-a97a-3703d9b11a5a) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 8 events per workflow execution: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~4), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), `amazonS3.sendFile` (~2). ## Read more --- - [Automation Hub](/docs/automation) - [Metrics](/docs/analytics/metrics) # Send an alert to Microsoft Teams channel You can integrate Synerise with Microsoft Teams using a dedicated node to build a variety of business scenarios. One of them is building a workflow that sends messages to a Microsoft Teams channel based on metrics, expressions, reports or any other analyses created in Synerise. Sending alerts can be additionally dependent on the value of these analyses and you can send messages if the value of the analyses is greater or lower than a specific number. This particular use case uses a metric which analyzes percentage decline of transactions every day. If the number of transactions decreased the day before by 50% compared to the average for the last 30 days, the message with alert is sent to a specific channel on Microsoft Teams. The message to the channel contains information with the value of the metric. ## Prerequisites --- - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). - Create a workflow from a channel in Teams by following steps below (skip point 4): 1. Go to Power Automate to create [a workflow from a channel in Teams](https://support.microsoft.com/en-us/office/creating-a-workflow-from-a-channel-in-teams-242eb8f2-f328-45be-b81f-9817b51a5f0e). Save workflow to generate incoming webhook URL. 2. Edit the created workflow by filling out the **TeamId** and **ChannelId** fields. These values will be suggested. If not: - To get the value of **TeamId**, go to the MS Teams application and retrieve a link to the team. **TeamId** is the part of generated URL groupId=XXXX. - To get the value of **ChannelId**, go to the MS Teams application and retrieve a link to the channel. **ChannelId** is a part of generated URL channel/XXXXXXXX. 3. Save the changes in the workflow. 4. If you want to send an interactive message (such message can contain links, simple surveys, sections), prepare it in [AdaptiveCard](https://adaptivecards.io/designer/). ## Process --- In this use case, you will go through the following steps: 1. [Create a metric which counts the change in transactions](/use-cases/teams-integration#create-a-metric-which-counts-the-change-in-transactions). It calculates percentage change in transactions the day before compared to the daily average for the last 30 days. 2. [Create a workflow](/use-cases/teams-integration#create-a-workflow) which sends the message to the Microsoft Teams channel. ## Create a metric which counts the change in transactions --- In this step, we will create the metric, whose result will be later sent in the Microsoft Teams message. This specific metric will count the change in the amount transaction.charge events in comparison to the average from previous 30 days. The result of the metric will be expressed as a percentage. The message to the channel will contain information with the value of the metric. 1. In Synerise, go to Decision Hub icon **Decision Hub > Metrics > New metric**. 2. Enter the name of the metric. 2. Choose the **Formula metric**. 3. Build the formula of the metric as shown in the screen below:
Configuration of the metric which counts the change in transactions
Configuration of the metric which counts the change in transactions
Where: - The time range for the first `transaction.charge` event (on the left side) is set to Last 1 day before 1 day. - The time range of the second `transaction.charge` event (in the middle) is set to Last 30 days before 2 days. - The time range of the third `transaction.charge` event (on the right side) is set to Last 30 days before 2 days. 4. Confirm by clicking **Apply**. **Results:** The results will show by how many percent transaction events increased or decreased in comparison to the average from previous 30 days. ## Create a workflow --- In this part of the process, you will create a workflow that sends a message to the Microsoft Teams channel if the number of transaction events decreased more than 50% comparing to the average in previous 30 days. 1. In Synerise, go to **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Configure the trigger --- As the first node, select the **Scheduled Run** node in which you will define the frequency of triggering this workflow and schedule the start of the workflow. 1. Start with the **Scheduled Run** node. In the configuration of the node: 1. Set the **Run trigger** option to **all time**. 2. Select the **Everyday** tab. 3. Select the time zone.
Select the time zone consistent with the time zone selected for your workspace.
3. Select the time when the workflow will be launched. 4. Confirm by clicking **Apply**.
Automation Hub Scheduled Run node configuration for triggering Microsoft Teams integration workflow
The configuration of the Scheduled Run node
### Configure the Metric Filter --- In the **Metric Filter** node, you will select [the metric prepared in the previous part of the process](/use-cases/teams-integration#configure-the-metric-filter). The continuation of the workflow will depend on the result of the metric. If the metric result is lower than 50, the alert about significant transaction events decrease will be sent to a Microsoft Teams channel. 1. On the **Scheduled Run** node, click **THEN**. 2. Choose the [metric created in the previous step](/use-cases/teams-integration#create-a-metric-which-counts-the-change-in-transactions). 3. As the condition, by using the mathematical operators, set the metric result to be less or equal `-50`. 4. Apply changes. ### Configure Microsoft Teams Integration node --- In this step, you will configure the settings of the outgoing integration that sends the message to the Microsoft Teams channel. #### Create a connection 1. On the **Metric Filter** node, click **THEN**. 2. From the dropdown list, select **Microsoft Teams > Send Channel Message**. 3. In the configuration of the node: - If you already create a connection, select the connection from the list. - If you haven't created any connection yet: 1. At the top of the dropdown list, click **Add connection**. 2. In the **Incoming Webhook URL** field, enter the incoming webhook URL you created as a part of [prerequisites](/use-cases/teams-integration#prerequisites). 3. Click **Next**. 4. In the **Connection name** field, enter the name for the connection you created. 5. Click **Apply**. **Result**: A connection is created and selected. #### Define the integration parameters 1. In the **Type of message** dropdown list, select the **Simple message**. 2. In the **Text of message** field, enter the text of message that will be sent to Microsoft Teams channel. In the message, you can insert the result of metric created in the [previous step](/use-cases/teams-integration#create-a-metric-which-counts-the-change-in-transactions). This way the result of the metric will be sent to the Microsoft Teams. See the example message with metric insert:
Check the transaction level! It decreased for more thank 50% comparing to the average from last 30 days. The metric result is: {% metricsvar metric_id:78d31e68-d886-4fcb-9ca3-b2136e74be01 %}{{ metric_result }}{% endmetricsvar %}%.
Check the instruction of [usage inserts with metrics](/developers/inserts/insert-usage#metrics). It might be helpful in creating your own message.
### Add final setting to your workflow --- 5. Add the **End** node. 6. Launch the workflow by clicking **Save&Run**.
Configuration of the workflow that sends alert messages based on the metric results to the Microsoft Teams channel
Configuration of the workflow that sends alert messages based on the metric results to the Microsoft Teams channel
**Result**: The message is sent to the Microsoft Teams channel. ## Check the use case set up on the Synerise Demo workspace --- Directly in our Synerise Demo workspace, you can check the configuration of the [metric which counts the percentage change in transaction events](https://app.synerise.com/analytics/metrics/78d31e68-d886-4fcb-9ca3-b2136e74be01) and the [workflow configuration](https://app.synerise.com/automations/automation-diagram/8a90a0f0-e019-475e-a8c5-c00b92a9c71c). If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 5 events per workflow execution: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~2), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`MSteams.sendChannelMessage`](/docs/assets/events/event-reference/integration#msteamssendchannelmessage) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Integration](/docs/automation/integration) - [Inserts](/developers/inserts) - [Metrics](/docs/analytics/metrics) # Content personalization in an external tool on the example of e-point CMS Personalization refers to the process of tailoring experiences, products, and services to the unique needs and preferences of individual customers. By using large amounts of data and technology to analyze it accurately, we can gain an understanding of each cusotomer's behavior, preferences, and characteristics. Such knowledge allows companies to deliver an engaging and valuable personalized experience to each customer. Implementing personalization on a website can bring many benefits. First, it can improve the customer experience by providing personalized content and recommendations that are tailored to each customer's interests and preferences. This can lead to increased engagement and loyalty as customers feel more valued and understood by the business. Second, personalization can also lead to increased revenue by driving more sales and higher customer lifetime value. By providing personalized product recommendations and offers, companies can encourage customers to make repeat purchases and continue to engage with the brand over time. Third, personalization can also lead to cost savings by reducing the need for broad, one-size-fits-all marketing campaigns. By targeting specific customer segments with personalized messages and offers, companies can achieve higher conversion rates and lower customer acquisition costs. This use case describes the process of sending customers segmentations using tracking code and API to an external tool - CMS. Based on the acquired customer segmentations created in Synerise, we can tailor content and offers to each customer group to meet their needs and expectations. ## Prerequisites --- - Implement a [tracking code](/developers/web/installation-and-configuration) into your website. - Generate a Workspace [API key](/docs/settings/tool/api) with the following permission: `ANALYTICS_BACKEND_SEGMENTATIONS_LIST_READ` ## Process --- In this use case, you will go through the following steps: 1. [Create a segmentation](/use-cases/content-personalization-CMS#create-a-segmentation). 2. [Get all segmentations for clients](/use-cases/content-personalization-CMS#get-all-segmentations-for-client). ## Create a segmentation --- In this step, you can create any customer segmentation for which you will personalize content/offers on your site. In our case, we will create a segmentation of heavy buyers based on the RFM analysis. You'll find a detailed process for creating the RFM analysis in [this use case](/use-cases/rfm-analysis).
The segmentation shown in this use case is just an example. You can create any other segmentation that meets your specific business needs.
1. Go to **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of the segment. 3. Choose **Add condition** and find the RFM segmentation. For detailed steps on how to create an RFM segmentation, refer to [this section](/use-cases/rfm-analysis#create-a-rfm-segmentation) of the process of creating RFM analysis. 4. Select the **Equal** operator and in the right field enter the name of the segment that defines the heavy buyers. In our case, we type - `Heavy Buyers` 5. Save the segmentation.
Segmentation settings
Segmentation settings
## Get all segmentations for client --- In this part of the process, you will get all the customer segmentations from Synerise to use them for content personalization from within your external tool - CMS in our case. We will also provide a code sample, the task of which is to replace the title content on the page if the customer belongs to a certain segmentation. However, before implementing the code, there are a series of requests you need to perform. These requests will help determine whether the customer belongs to the segmentation that we have chosen as the condition for displaying the personalized header.
Completing this procedure requires some knowledge on sending API requests using cURL, Postman, or similar tools.
1. Acquire API authorization token by using [Log in as Workspace](https://hub.synerise.com/api-reference/profile-management#operation/profileLogin) endpoint. Use it to authorize later calls to the API.
See an example of a cURL request
curl --request POST --url https://api.synerise.com/uauth/v2/auth/login/profile --header 'content-type: application/json' --data '{"apiKey":"64c09614-1b2a-42f7-804d-f647243eb1ab"}'
2. Get all defined segmentations by list, using [List segmentations](https://hub.synerise.com/api-reference/analytics-suite#tag/Analytics-v2) endpoint.
See an example of a cURL request
curl --request GET --url 'https://api.synerise.com/analytics/%7Bnamespace%7D/segmentations?page=SOME_NUMBER_VALUE&limit=SOME_NUMBER_VALUE&search=SOME_STRING_VALUE&sortBy=SOME_STRING_VALUE' --header 'Authorization: Bearer _YOUR_JWT_TOKEN_'
3. Pick which segmentations from above call response are relevant and see if the client is in them by using [Check if profile in segmentations](https://hub.synerise.com/api-reference/analytics-suite#operation/analytics2-segmentation-check) endpoint.
See an example of a cURL request
curl --request POST --url https://api.synerise.com/analytics/%7Bnamespace%7D/segmentations/check/by/%7BidentifierType%7D --header 'Authorization: Bearer _YOUR_JWT_TOKEN_' --header 'content-type: application/json' --data '{"identifierValue":"string","segmentationIds":["a8b2ed5c-c342-436f-a98e-eca642767926"]}'
4. Show part of your web frontend based on your segmentations. Below we present an exemplary React code that renders component that displays a secondary title if a specific profile ID is present in an array of segmentations. Remember to communicate with the Synerise API in your backend and pass segmentations to the frontend.
The presented React code is just an example. You can use any other method to render your content.
function renderPersonalizedMessage(props) {
  const segmentations = props.segmentations;
  return (
    <div>
      <h1>Hello!</h1>
        {segmentations.includes("a8b2ed5c-c342-436f-a98e-eca642767926") &&
          <h2>Discover our new offer!.</h2>}
    </div>
  );
}
**Below you will find a sequence diagram to help you better understand the communication flow between e-point CMS and Synerise.**
Communication flow diagram
Communication flow diagram
## Explore the content configuration process in e-point CMS --- Below, you'll find screenshots from e-point CMS that demonstrate the configuration of various platform elements. - Below are screenshots showcasing the e-point visual builder. In the first screenshot, you can see a component created specifically for a specified customer segment.
e-point CMS Visual Builder with defined component
e-point CMS Visual Builder with defined component
- In the following screenshot, the same page is displayed, but the component is hidden and will only be shown to customers outside of the predefined segment.
e-point CMS Visual Builder with hidden component
e-point CMS Visual Builder with hidden component
- The screenshot displayed below presents the configuration panel for the component.
e-point CMS component configuration panel
e-point CMS component configuration panel
- The screenshot below provides a view of the list of e-point CMS segmentations that were obtained from Synerise.
e-point CMS segmentation list
e-point CMS segmentation list
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of [segmentation](https://app.synerise.com/analytics-v2/segmentations/a8b2ed5c-c342-436f-a98e-eca642767926) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case does not generate any events. ## Read more --- - [e-point CMS](https://www.e-point.com/products/e-point-cms) - [API keys](/docs/settings/tool/api) - [API references](https://hub.synerise.com/api-reference) - [Segmentations](/docs/analytics/segmentations) - [Synerise API](/developers/api) # Voucher-based referral program Creating a solid loyalty program is key to building lasting relationships with customers. Among the countless strategies to achieve this, the use of discount codes stands out as a powerful tool. Implementing a referral program based on discount codes opens up many opportunities to attract new users, while encouraging current users to engage more deeply. These codes not only encourage customers to make additional purchases, but also serve as a channel to expand our customer base through word-of-mouth referrals. What's more, this referral system isn't just advantageous for the invitee; it's a win-win scenario that rewards both the inviter and the invitee when the shopping voucher is utilized. In this use case, the loyalty program works by giving customers a discount code that they can share with their friends after they've made a purchase. If a friend then uses this code to buy something, the original customer gets a reward, usually in the form of another discount. These discount codes are shared through email. This approach keeps customers engaged and encourages them to spread the word, benefiting both the business and its customers. ## Prerequisites --- - [Create an email account](/docs/campaign/e-mail/configuring-email-account) which you will use to send emails. - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). Additionally, implement a custom parameter for the **transaction.charge** event, which will contain the coupon code that was used in the transaction. In our case, we will use the `discountCode` parameter. - Create two different [voucher pools](/docs/assets/code-pools): - One pool is for voucher codes that customers can share with their friends. - The second pool contains rewards for customers after someone they shared a voucher code with makes a purchase using the code from the first pool.
To easily identify discount codes in the next process steps, you can start each voucher with the same set of letters. For example, use prefixes like `SPR`_F45670, `SPR`_J20948.
- Meet [all requirements](https://hub.synerise.com/api-reference/loyalty-and-engagement#operation/RedeemAVoucher) necessary to redeem a voucher - Make two types of email templates: - One for customers who have made a purchase and will get a voucher code to share with friends. - Another for customers whose shared voucher code was used by a friend, so they get a new voucher code for themselves.
We recommend using Jinjava in templates to retrieve the voucher code for the customer. To get the same voucher code, use this Jinjava code:
{% voucher assign=false %} pool-uuid {% endvoucher %}
## Process --- 1. [Create a workflow](/use-cases/voucher-codes-share#create-first-workflow) that sends a discount code to customers who have made a transaction to share the code with another person. 2. [Create a workflow](/use-cases/voucher-codes-share#create-second-workflow) that checks the use of the code by the recipient of the code. 3. [Create a workflow](/use-cases/voucher-codes-share#create-third-workflow) that will reward a customer from the first workflow who gifted someone with the code. ## Create first workflow --- This workflow is used to send a discount code to customers who have made a transaction to share the code with another person. 1. Go to **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Profile Event trigger node --- 1. As the first node of the workflow, add **Profile Event**. In the node settings: 1. Click **Choose event** and from the dropdown list, select the [`transaction.charge` event](/docs/assets/events/event-reference/items#transactioncharge). 2. Confirm by clicking **Apply**.
Profile Event trigger configuration
Profile Event trigger configuration
### Configure the Send email node --- In this part of the process, send email communication to customers who have made a transaction. Following the allocation of a voucher to a customer, a [**voucherCode.assigned**](/docs/assets/events/event-reference/loyalty#vouchercodeassigned) event will be recorded in their customer profile. 1. Add the **Send Email** node and open its settings. 2. In the **Sender details** section, choose the email account from which the email is sent. 3. In the **Content** section, select the template that you prepared as a part of the prerequisites. 4. **Optional**: In the **UTM & URL parameters** section, define the UTM parameters added to the links included in the email. 5. **Optional**: In the **Additional parameters** section, assign [additional parameters](/docs/campaign/e-mail/creating-email-campaigns#adding-custom-parameters) to the events generated by interactions with the message. 6. Confirm by clicking **Apply**. ### Configure the Event filter node --- In this step, we verify if the **voucherCode.assigned** event has been generated for a customer. 1. Add the **Event Filter** node. In the configuration of the node: 1. Enter the title of the node, (for example, we use `voucherCheck`). 1. Check event **for period of time**. 2. Define the time range to **5 Minute**. 3. From the **Choose event** dropdown list, select the **voucherCode.assigned** event. 4. As the event parameter, select **poolName**. 5. From the **Choose operator** dropdown list, select **Equal**. 6. As the value, enter the name of the voucher pool you are referring to. 7. Confirm by clicking **Apply**.
Event filter node configuration
Event filter node configuration
2. For the **not matched** path, select the **End** node. 3. For the matched path, select the **Update profile** node. ### Add the Update Profile node --- In this step, assign an attribute to customer's profile with the value of the voucher code. In our case, we use **my_refferal_code** attribute. 1. For the **Matched** path, add the **Update Profile** node. 2. Click dropdown list and create **my_refferal_code** attribute. 3. From the next dropdown list, choose **Change** operator. 4. In the **Value** section, insert the following jinjava which will display as the **voucherCode**:
`{{ automationPathSteps['voucherCheck'].event.params.voucherCode }}`
Note that `voucherCheck` is the name of the **Event Filter** trigger added manually.
Update Profile node configuration
Update Profile node configuration
3. To save the changes, click **Apply**. 4. Add the **End** node.
Final view of the workflow configuration
Final view of the workflow configuration
## Create second workflow --- This workflow will be used to redeem discount code. 1. Go to **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Profile Event trigger node --- 1. As the first node of the workflow, add **Profile Event**. In the node settings: 1. Create name for this node, as it will be used later in the workflow. 2. Click **Choose event** and from the dropdown list, select the `transaction.charge` event. 3. Click **+where** and from the dropdown list, select **discountCode** parameter. 4. From the **Choose operator** dropdown list, select **Starts with (String)**. 5. In the **Value** section insert the prefix that is used in all codes from the first voucher pool you created as a part of prerequisites. In our case it's `SPR` prefix. 3. Confirm by clicking **Apply**.
Profile Event trigger configuration
Profile Event trigger configuration
### Configure the Profile filter node --- This Profile filter creates a security measure so that this code cannot be used by people who received it through the [first workflow](#create-first-workflow). 1. Add the **Profile Filter** node. In the configuration of the node: 1. From the **Choose filter** dropdown list, select the **my_refferal_code** attribute. 2. From the **Choose operator** dropdown list select **Starts with (String)**. 3. In the **Value** section, insert the prefix that is used in all codes from the first voucher pool you created as a part of prerequisites. In our case it's `SPR` prefix. 4. Modify the **Profile matching** attribute to **Profile not matching**. 5. From the **Choose filter** dropdown list, select the **voucherCode.assigned** event. 8. Click **+where** and from the dropdown list, select **poolName** parameter. 9. From the **Choose operator** dropdown list, select **Equal (String))**. 5. In the **Value** section insert the prefix that is used in all codes from the first voucher pool you created as a part of prerequisites. In our case it's `SPR` prefix. 6. Modify the **Profile matching** attribute to **Profile not matching**. 7. Define the time period for which the event will be calculated. 8. Use the **AND** logical operator to connect set rules. 7. Confirm by clicking **Apply**.
Event filter node configuration
Event filter node configuration
2. For the **not matched** path, select the **End** node. 3. For the matched path, select the **Outgoing integration** node. ## Configure the Outgoing Integration node --- In this step, we will redeem the used coupon during the transaction using [Synerise API reference](https://hub.synerise.com/api-reference/loyalty-and-engagement#operation/RedeemAVoucher). 1. Add **Outgoing Integration** node. 2. In **Definition** section, choose the **Custom** tab. 2. Choose Webhook connection type. 3. Select a connection. If you haven't created any connection yet, see instructions in ["Set up a connection" section](/docs/automation/actions/webhook-node#set-up-a-connection). 3. In the **Webhook name**, enter your preferred name. The value of this field will be stored as a Name parameter in the response event. It makes it easier to identify the event and is useful for creating analysis. In our use case, we will use the following name `voucherRedeemed`. 4. Define the **Webhook event name**. In our use case, we use the `voucherCode.redeemed` event.
This is the event key. While naming it, follow the pattern used for the default events in the application such as page.visit, product.buy and so on.
5. In the **URL** section, choose the **POST** method. 2. Enter the following URL: `https://api.synerise.com/v4/vouchers/item/redeem` 5. In the **Key** field, enter `Accept` and in the **Value** field, enter `application/json` 6. Click **Add header**. 7. Add **Accept** with `application/json` 7. In the **Key** field, enter `Api-Version` and in the **Value** field, enter `4.4` 4. In the **Body** section, enter the following Jinjava:
{"code":"{{ automationPathSteps['transactionCode'].event.params.discountCode }}"}
Note that `transactionCode` is the name of the **Profile Event** trigger added manually. In this Jinjava we reference to code that has been used. Because this code was assigned in the first workflow to the user who shares it, the voucherCode.redeemed event (which is the result of using this API request) is assigned to the profile of the person who shares the code. Such configuration is crucial for the [third workflow](#create-third-workflow) which sends out reward discount code which is based on the `voucherCode.redeemed` event. 3. Confirm by clicking **Apply**.
Outgoing integration node configuration
Outgoing integration node configuration
4. Add the finishing **End** node.
Final view of the workflow configuration
Final view of the workflow configuration
## Create third workflow --- This workflow will send a reward to a customer from the first workflow after the code they shared with someone has been used. ### Define the Profile Event trigger node --- The worflow is triggered by the `voucherCode.redeemed` event which was generated in the previous workflow. 1. As the first node of the workflow, add **Profile Event**. In the node settings: 1. Click **Choose event** and from the dropdown list, select the `voucherCode.redeemed` event. 2. Click **+ where** and from the dropdown list, select **poolName**. 3. From the **Choose operator** dropdown list select **Equal (String)**. 4. As the value, enter the name of the voucher pool you are referring to. 5. Confirm by clicking **Apply**.
Profile Event trigger configuration
Profile Event trigger configuration
### Configure the Send email node --- In this part of the process, send email communication to customers who previously shared the code. They'll receive a reward in the form of a voucher code for their own use. 1. Add the **Send Email** node and open its settings. 2. In the **Sender details** section, choose the email account from which the email is sent. 3. In the **Content** section, select the template that you prepared as a part of the prerequisites. 4. **Optional**: In the **UTM & URL parameters** section, define the UTM parameters added to the links included in the email. 5. **Optional**: In the **Additional parameters** section, assign [additional parameters](/docs/campaign/e-mail/creating-email-campaigns#adding-custom-parameters) to the events generated by interactions with the message. 6. Confirm by clicking **Apply**. 4. Add the **End** node.
Final view of the workflow configuration
Final view of the workflow configuration
## Check the use case set up on the Synerise Demo workspace --- Check all items (metrics and dynamic content) created in this use case in our Synerise Demo workspace: - [Workflow 1](https://app.synerise.com/automations/automation-diagram/8b5add66-f831-412b-880a-e687a31e651a) - [Workflow 2](https://app.synerise.com/automations/automation-diagram/b05c6666-cf7d-49c9-aff4-9efe742e1149) - [Workflow 3](https://app.synerise.com/automations/automation-diagram/52294202-031a-4a19-ae01-86a91ae456bd) - [Voucher codes for referral](https://app.synerise.com/assets/vouchers/pools/193bf1b4-3e95-4236-9117-35d161ab62cc/coupons) - [Voucher codes for those who shared the code](https://app.synerise.com/assets/vouchers/pools/3d914818-46e0-42dd-b703-f07736d73c70/coupons) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 28 events per profile that completes the flow: [`transaction.charge`](/docs/assets/events/event-reference/items#transactioncharge) (~2), [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~4), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~3), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~6), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~3), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~2), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~2), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~2), [`voucherCode.assigned`](/docs/assets/events/event-reference/loyalty#vouchercodeassigned) (~2), [`profile.updated`](/docs/assets/events/event-reference/profiles#profileupdated) (~1), [`voucherCode.redeemed`](/docs/assets/events/event-reference/loyalty#vouchercoderedeemed) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [API](/developers/api) - [Email campaigns](/docs/campaign/e-mail) - [Voucher pools](/docs/assets/code-pools) # Send Reminder Emails for Products Added to Saved List If the customer adds a favorite product to a list, but does not complete a transaction, send an email based on the product. This can direct the customer straight to the recently liked product. You can always let your customers know if products they like go on sale. Use a reminder email to send them notifications about the latest promotion connected with products they have on their lists. ![Screenshot presenting similar products recommendations](/api/docs/image/f8a57079df9dd82ae8b22dc747691385d7d51d29/use-cases/all-cases/_gfx/sendmessagewithproductsonsavedlist.png) ## Example of use - Retail industry The client wants to convert abandoned items on saved lists. He has sent an email campaign with a reminder about the saved products and encouraged customers to finish the purchase. **Results** - OR 18.94%, - CTR 8.11%, - Conversion 15,7%. ## How to do it --- 1. First of all create your segment with customers who e.g. during last week have added something to favorite list but have not made a purchase. Also you can add any other condition based on the goal of your campaign. 2. Create an email campaign with products added to favorites or last seen products by this customer. Here you can read more [how to do it.](/docs/ai-hub/recommendations-v2/recommendation-types#last-seen) Learn more how to build an [email campaign](/docs/campaign/e-mail). 3. When your template is ready, you can use it in an automation. A good idea to maintain customer commitment and increase their willingness to buy is to send an email reminder about the items in the wish list. You can do this with the following automation: ![Screenshot presenting automation](/api/docs/image/f8a57079df9dd82ae8b22dc747691385d7d51d29/use-cases/all-cases/_gfx/automation_sendsavedproducts.png) Automation blocks in this template: - Profile Event as a trigger – leaving the website (session finished) - Delay – for example 2h - Profile Filter – consent for profiling - Send an email with personalized products ## Generated events This use case generates approximately 10 events per profile that completes the flow: [`session.end`](/docs/assets/events/event-reference/web-and-app#sessionend) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1). # Voucher assignment based on average basket value Most marketers know that vouchers in line with your customers' shopping habits are one of the best ways to turn a visit into a sale. Sending an email with a relevant discount coupon to customers who have not purchased in a while will be great to re-engage them. You can personalise the communication and drive extra revenue for your business by grouping your customers by their average order value and offering them a better-tailored offer. Directing vouchers to the right audience at the right time will be more effective than sending irrelevant offers to all your customers. In this use case, you will create an automation that sends an email communication with a dedicated voucher code to a specific segment of customers with two or more transactions, depending on their average order value (AOV). The workflow is triggered when customers's session on the site ends, and will only continue for those customers who meet all the conditions defined in the segmentation and have not made any purchase in the last 30 days.
The promotional graphic for the use case
## Prerequisites --- - [Implement a tracking code](/docs/settings/tool/tracking_codes). - [Configure email account](/docs/campaign/e-mail/configuring-email-account). - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). - Create two different [voucher pools](/docs/assets/code-pools). One will be used for customers whose AOV less than 200 PL and one for those with AOV greater than or equal to 200 PLN. ## Process --- In this use case, you will go through the following steps: 1. [Create an aggregate for calculating AOV](#create-an-aggregate-for-calculating-aov). 2. [Create an aggregate for counting transactions](#create-an-aggregate-for-counting-transactions). 3. [Create a segmentation](#create-a-segmentation) based on the aggregates to set an audience for use in communication. 4. [Create an expression](#create-an-expression) that will be used in an e-mail template to check which segment the customer is in. 6. [Create an email template](#create-an-email-template) with jinjava code that inserts a voucher code depending on the customer's segment. 6. [Create a workflow](#create-a-workflow) that will send emails with vouchers to a specific segment of customers. ## Create an aggregate for calculating AOV --- In this part of the process, create an aggregate that returns AOV from `transaction.charge` event. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Average**. 4. From the **Choose event** dropdown list, select the `transaction.charge` event. 5. As the event parameter, select **$totalAmount**. 6. Define the period which the aggregate will analyze. In this use case, it is **Lifetime**. 7. Save the aggregate.
The view of the configuration of the avarage order value aggregate
Configuration of the AOV aggregate
## Create an aggregate for counting transactions --- In this part of the process, create an aggregate that returns number of transactions. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Count**. 4. From the **Choose event** dropdown list, select the `transaction.charge` event. 6. Define the period which the aggregate will analyze. In this use case, it is **Lifetime**. 7. Save the aggregate.
The view of the configuration of the aggregate returning number of transactions
Configuration of the aggregate returning the number of transactions
## Create a segmentation --- In this part of the process, create a segmentation that contains two customer target groups who made at least two transactions. First for customers with AOV less than 200 PLN and second for customers with AOV equal or greater than 200 PLN. The names of the segments will be used as variables later, so enter them as exactly as instructed. 1. Go to Behavioral Data Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of segmentation. 3. Rename **Segment A** to `AOV < 200 PLN` 4. From the **Add condition** dropdown list, select the [aggregate for AOV](#create-an-aggregate-for-calculating-aov) you created in the previous step. 5. As the operator, choose **Less than** for number. 6. In the text field, enter `200` 7. From the **Add condition** dropdown list, select the [aggregate for counting transactions](#create-an-aggregate-for-counting-transactions) you created in the previous step. 8. As the operator, choose **More or equal to** for number. 9. In the text field, enter `2`
The view of the configuration of the segmentation for AOV less than 200 PLN
Configuration of the segmentation for AOV less than 200 PLN
10. Click **Add segment** next to the first one. Name the new segment `AOV >= 200 PLN` 4. From the **Add condition** dropdown list, select the [aggregate for AOV](#create-an-aggregate-for-calculating-aov) you created in the previous step. 5. As the operator, choose **More or equal to** for number. 6. In the text field, enter `200` 7. From the **Add condition** dropdown list, select the [aggregate for counting transactions](#create-an-aggregate-for-counting-transactions) you created in the previous step. 8. As an operator, choose **More or equal to** for number. 9. In the text field, enter `2` 10. Save the segmentation.
The view of the configuration of the segmentation for AOV more or equal to 200 PLN
Configuration of the segmentation for AOV more or equal to 200 PLN
## Create an expression --- In this part of the process, create an expression which will be used to return the customer's segment in the [segmentation created in the previous step](#create-a-segmentation). It will be used later in the email template and will allow us to target vouchers appropriately - to the right group of customers. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. Enter a meaningful name of the expression. 3. Leave the expression type at default (**Attribute**). 4. Build the formula of the expression. 1. Click the **Select** node. 2. From the dropdown list, select **Profile**. 4. Click the **unnamed** node. 5. From the **Choose attribute** dropdown list, select the [segmentaion created in the previous step](#create-a-segmentation). 5. Save the expression.
The view of the configuration of the expression for definig in which segment is the customer
Configuration of the expression
## Create an email template --- In this part of the process, create an email template with a Jinjava code which uses the results from the expression created in the [previous part of the process](#create-an-expression) to check the customer's segment and assign a voucher code from the corresponding pool. 1. Go to Experience Hub icon **Experience Hub > Email**. 2. On the left pane, click **Templates**. 3. Select the wizard: - **Drag&drop builder** - use ready-made components to build an email template. - **Code editor** - use HTML, CSS and JS to build an email template from scratch. 4. Build a template. 5. Add the Jinjava code presented below. This code includes a context of the node from the [workflow](/developers/inserts/automation#context) you will create in the next part of the process. Thanks to this context, the latest results of the expression will be used in the email template to select the voucher pool corresponding to the customer's segment. You can change the text of the messages in the code according to you business needs. 1. Replace the UUID after `expressionvar` with the ID of the expression you created earlier. 2. Replace the UUID in the first `voucher` tag with the ID of the voucher pool with vouchers for customers whose AOV is less than 200 PLN. 3. Replace the UUID in the second `voucher` tag with the ID of the voucher pool with vouchers for customers whose AOV is 200 PLN or more
Check the Jinjava code
{% expressionvar 2bf51517-ae79-4bfb-bd37-153408c80bf5 %} {% set state = expression_result %} {% if state == 'AOV < 200 PLN' %} Buy discounted products from the online shop with an extra 10% discount! You can find your personal code below <p> {% voucher assign=false %} f017803f-4d5c-4192-aa3a-f845822490cb {% endvoucher %} {% elif state == 'AOV >= 200 PLN' %} Buy new collection products from the online shop with a 20% discount! You can find your personal code below. <p> {% voucher assign=false %} 8464b593-478c-412a-9dfb-0aab59f8ff5e {% endvoucher %} {% endif %} {% endexpressionvar %}
6. Save the template. ## Create a workflow --- In this part of the process, you will create the workflow which sends emails with vouchers to a specific segment of customers, triggered when they finish their session on the site. The voucher will be sent maximum once a month, to customers who didn't make a purchase in the last 30 days. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. 3. Click **Set capping** and define the limit of workflows a profile can start: 1. Set **Limit** to 1. 2. Set **Time** to 30 days. 4. Confirm by clicking **Apply**.
The view of the configuration of the workflow capping
Configuration of Workflow capping
### Add the Profile Event node 1. Click **Add trigger**. 4. From the dropdown list, select **Profile Event**. 5. Click the node. 6. From the **Choose event** dropdown list, select `session.end`. 7. Confirm by clicking **Apply**. ### Add the Delay node Add the Delay node to define the lag between the `session.end` event and sending an email with voucher to specific segment of customers. In this example it is 1 hour. 1. Click **MATCHED**. 2. From the dropdown list, select **Delay** node. 3. Click the node. 4. Set **Time of delay** to 1 hour. 5. Confirm by clicking **Apply**. ### Add the Profile Filter node 1. Click **THEN**. 2. From the dropdown list, select **Profile Filter** node. 3. Click the node. 4. From the **Choose filter** dropdown list, select the [expression created in the previous step](#create-an-expression). 5. From the **Choose operator** dropdown list, select **Is true**. 5. Add another condition by clicking the **Choose filter** dropdown list and selecting the `transaction.charge` event. 6. Click **Profiles matching funnel** and change it to **Profiles not matching funnel**. 7. Click the calendar icon in the right lower corner to change the date range. 1. In the **Relative date range** section, select **Custom**. 2. Set to **Last 30 days**. 3. Confirm by clicking **Apply**. 8. Confirm by clicking **Apply**. 9. At the **NOT MATCHED** path, add the **End** node.
The view of the configuration of the Profile Filter node
Configuration of the Profile Filter node
### Add the Send Email node 1. Click **THEN**. 2. From the dropdown list, select **Send Email** node. 3. In the **Sender details** section, choose the email account from which the email is sent. 4. 4. In the **Content** section: 5. Select the [template that you prepared in the previous step](#create-an-email-template). 6. Add the subject of the email. 3. You can define the UTM parameters in the **UTM & URL parameters** section. 4. In the **Additional parameters** section, optionally describe the campaign with [additional parameters](/docs/campaign/e-mail/creating-email-campaigns#adding-custom-parameters). 4. Confirm by clicking **Apply**. 5. Click **THEN**. 6. From the dropdown list, select **End** node. 7. Click **Save & Run**.
The view of the Automation
Automation
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of: - [Voucher pool for customers with AOV less than 200 PLN](https://app.synerise.com/assets/vouchers/pools/f017803f-4d5c-4192-aa3a-f845822490cb/coupons) - [Voucher pool for customers with AOV more than or equal to 200 PLN](https://app.synerise.com/assets/vouchers/pools/8464b593-478c-412a-9dfb-0aab59f8ff5e/coupons) - [Aggregate for AOV](https://app.synerise.com/analytics/aggregates/7a866b05-137b-3237-ad36-041cdf14553a) - [Aggregate for counting transactions](https://app.synerise.com/analytics/aggregates/1b01b454-3e3f-3837-8ba1-feb4bf117ce6) - [Segmentation](https://app.synerise.com/analytics-v2/segmentations/039f798d-2bdc-4979-a7e4-e56a81d93ae4) - [Expression](https://app.synerise.com/analytics/expressions/2bf51517-ae79-4bfb-bd37-153408c80bf5) - [Automation](https://app.synerise.com/automations/automation-diagram/8fe22258-0ef2-42f0-bbf4-afe79f76abe8) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 10 events per profile that completes the flow: [`session.end`](/docs/assets/events/event-reference/web-and-app#sessionend) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1), [`voucherCode.assigned`](/docs/assets/events/event-reference/loyalty#vouchercodeassigned) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Automation Hub](/docs/automation) - [Email campaigns](/docs/campaign/e-mail) - [Expressions](/docs/crm/expressions) - [Jinjava inserts](/developers/inserts) - [Segmentation](/docs/analytics/segmentations) - [Voucher pools](/docs/assets/code-pools) # Optimizing Voucher Campaigns for First-Time Website Visitors Engaging new visitors effectively is crucial for driving conversions and building customer loyalty. Dynamic Content campaigns tailored for first-time visitors, such as offering a voucher, can create a strong initial impression and encourage users to complete their first transaction. However, when running such campaigns, there is a risk of missing new users who are not in the database at the time of campaign launch. This is where the **Include first time visitors in audience** option becomes invaluable, ensuring convenient targeting for these users. In this use case, we will describe a voucher campaign targeted at new users who have never made a transaction. By enabling the **Include first time visitors in audience** option in the campaign, we ensure that new users visiting the website are not overlooked. Even if they were not yet in the database at the moment the campaign started, they will still see the dynamic content and receive their voucher. This ensures that the campaign reaches its intended audience and no opportunities to engage first-time visitors are missed. ## Prerequisites --- [Implement a tracking code](/docs/settings/tool/tracking_codes). ## Process --- In this use case, you will go through the following steps: 1. [Create a voucher pool](/use-cases/voucher-for-new-users-optimization#create-a-voucher-pool). 3. [Create a dynamic content](/use-cases/voucher-for-new-users-optimization#create-a-dynamic-content) campaign, which displays the voucher code on the website. ## Create a voucher pool --- In this use case, the ID of this voucher pool will be used as a dynamic value during the message creation process, allowing discount codes to be assigned to each customer participating in this scenario. 1. Go to **Settings > [Voucher pools](https://app.synerise.com/spa/modules/vouchers/pools/)** and click **Add pool**. 2. In the voucher pool configuration form: 1. In the **Pool name** field, enter the name of the pool. 2. Select the dates for the **Emission start** and **Emission end** fields. 3. Complete the form by clicking **Apply**. **Result**: The pool is created. 3. Open the voucher pool by clicking its name on the voucher pool list. 4. Add codes to the voucher pool by clicking **Add record** button. You can also import records to the voucher pool. You can learn more about it in ["Importing vouchers"](/docs/assets/imports/importing-vouchers). ## Create a dynamic content --- Create a dynamic content campaign. This dynamic content will be displayed on your site with the unique voucher from the voucher pool. 1. Go to **Experience Hub > Dynamic content > Create new**. 2. Enter the name of the dynamic content. 1. Choose **Insert Object** type. 2. To select the recipients of the dynamic content, on the **Audience** tab, click **Define**. 3. Select **New Audience** and click **Define conditions**. In this step, you define the group of customers who have never bought anything from your shop. 1. Choose **Add condition** and find the `transaction.charge` event. 5. Set the time as **Lifetime**. 6. Click **Performed** and change it to **Not Performed**. 7. Click **Apply**.
The audience settings
The audience settings
9. Click **Advanced options** and choose the **Include first time visitors in audience** option. 10. Click **Apply**.
The audience settings
The audience settings
### Create the Dynamic Content template 3. In the **Content** section, specify the CSS selector where you want to insert your campaign. 4. Click **Create Message**. 5. In the code editor, create a dynamic content campaign based on your preferences and your own CSS styles. Remember about the predefined templates in Synerise, which you can use to simplify the process and avoid building everything from scratch. 2. Click **Inserts** and **Pools** and choose the voucher pool created in the [previous step](#create-a-voucher-pool).
Check also the voucher pools inserts documentation, based on different possible options: - [If you want to always display the same code for a customer,](/developers/inserts/insert-usage#retrieving-the-same-code-every-time) - [If you need to display barcodes.](/developers/inserts/insert-usage#barcodes)
4. Customize the design and content of your dynamic content campaign to suit your business needs. 3. Click **Use in communication** and then click **Apply**. ### Define schedule and display settings 1. In the **Schedule** section, click **Define** and set the time when the message will be active. 2. In the **Display Settings** section, click **Define** and specify circumstances for dynamic content to be displayed. Optionally, you can also define the Advanced options. You can define the frequency of dynamic content to be displayed. You can also define the type of device you want to show your dynamic content. 3. Optionally, you can define the type of device you want to show your dynamic content on. 4. Click **Apply**. 5. Optionally, you can define the UTM parameters and additional parameters for your dynamic content campaign. 6. Click **Activate**. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of [dynamic content campaign](https://app.synerise.com/campaigns/dynamic-content/create/1cb07032-a65c-44fe-9d09-1b3db3c811c0), directly in Synerise. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1), [`voucherCode.assigned`](/docs/assets/events/event-reference/loyalty#vouchercodeassigned) (~1). ## Read more --- - [Dynamic content](/docs/campaign/dynamiccontent) - [Voucher pools](/docs/assets/code-pools) # Transfer Propensity Prediction Results to DataLayer Using Predefined Templates Transferring data to DataLayer is a common practice for companies to collect and store customer data in a centralized location. DataLayer is a powerful tool that allows companies to integrate customer data with other business applications, analytics tools, and third-party platforms. By storing data in a centralized location, businesses can gain valuable insights into their customers' behaviors and preferences, which they can use to create targeted marketing campaigns. With the new predefined Dynamic Content templates, you can easily send aggregates and expression results to DataLayer. In this use case, the propensity to buy prediction results for a specific brand are sent to the DataLayer (along with the propensity to buy score for individual customers).
Sending data to DataLayer
## Prerequisites --- - Implement a [tracking code](/developers/web/installation-and-configuration) into your website. - Create an [item feed](/developers/product-feed). - [Enable the Propensity prediction type](/docs/ai-hub/predictions/enabling-predictions#enabling-propensity-and-best-fit-predictions). - [Implement Google Data Layer on your website](https://developers.google.com/tag-platform/tag-manager/web/datalayer). ## Process --- In this use case, you will go through the following steps: 1. [Create a prediction](/use-cases/send-aggregate-to-datalayer#create-a-prediction). 2. [Create an aggregate](/use-cases/send-aggregate-to-datalayer#create-an-aggregate) that returns the last propensity score received by each customer. 2. [Create dynamic content](/use-cases/send-aggregate-to-datalayer#create-dynamic-content) that send the results of aggregate to DataLayer. ## Create a prediction --- Create a prediction of the propensity to buy a specific brand. The results of this prediction will be sent to DataLayer. 1. Go to AI Hub icon **(AI Predictions) Models > New prediction** and select **Propensity** as the prediction type. 2. Select the audience for the prediction. In our case, we will use segmentation of customers who have visited the website in the last 90 days. You can find the configuration of this segmentation [in this part](/use-cases/send-aggregate-to-datalayer#check-the-use-case-set-up-on-the-synerise-demo-workspace) of the use case. For more information, see the [Predictions quick start article](/docs/ai-hub/predictions/propensity#select-customers-to-be-analyzed). ### Define the item In this part of the process, define the brand(s) for which you want to calculate the prediction by defining the item filter conditions. 1. In the **Item selection** section, click **Define**. 2. Click **Choose item feed**. 3. Select the catalog that contains the items you want to make the prediction for. **Result**: The **Item filter** section appears. 4. Click **Define item filter**. 5. From the **Select attribute** dropdown list, select the `brand` attribute. You can use the search field. 6. From the dropdown list that appears, select the **Equal** operator. 7. Select the desired brand(s). 8. Click **Save**. 9. Save the item feed configuration by clicking **Apply**.
Item filter configuration
Item filter configuration
### Additional settings and saving Configure the [additional settings](/docs/ai-hub/predictions/propensity#additional-settings) (or leave them at default) and click **Save & Calculate**.
After the calculation, a `snr.propensity.score` event is saved in the profiles of each customer in the audience. The event data includes detailed results of the prediction.
Configuration of the prediction
Configuration of the prediction
## Create an aggregate --- In this part of the process, create an aggregate that returns the last propensity score obtained by each customer. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last**. 4. From the **Choose event** dropdown list, select the **snr.propensity.score** event. 5. As the event parameter, select **score_label**. 6. Click **+ where** button. 7. From the **Choose parameter** dropdown list, select the **modelId** parameter. 8. From the **Choose operator** dropdown list, select **Equal**. 9. Enter the ID of the propensity model created earlier in the process. In our case, it's `ihwfubimbnrg`. 10. Set the period from which the aggregate will analyze the results to the **Lifetime**. 11. Save the aggregate.
Decision Hub Last aggregate returning the score_label of the last snr.propensity.score event filtered by propensity model ID over a customer's lifetime
Configuration of the aggregate
## Create dynamic content --- 1. Go to **Experience Hub > Dynamic content > Create new**. 2. Enter the name of the dynamic content. 3. Choose **Insert Object** type. ### Define Audience 4. As the Audience select **New Audience** and click **Define conditions**. 1. From the **Choose filter** dropdown list, select the **snr.propensity.score** event. 2. Click **+ where** button. 3. From the **Choose parameter** dropdown list, select the **modelId** parameter. 4. From the **Choose operator** dropdown list, select **Equal**. 5. Enter the ID of the propensity model created earlier in the process. In our case, it's `ihwfubimbnrg`. 6. Set the period from which the aggregate will analyze the results to the **Lifetime**. 7. Apply all conditions. 8. Click **Apply** to save the audience.
Audience configuration
Audience configuration
### Define content 5. In the **Content** section, select **Simple message**, and specify the CSS selector where you want to insert your search. In our case, we use the following selector: `.srns-modal-wrapper` 6. In the **Content** tab, click **Create Message**. 7. From the list of template folders, select a folder with the predefined script templates. **Result**: You are redirected to the list of predefined templates.
Script templates folder
Script templates folder
8. Select the **Send aggregate to dataLayer** template. **Result**: You are redirected to the template builder.
You can edit the template in two ways, by editing the code of the template ([add snippets](/docs/campaign/dynamiccontent/creating-dynamic-content-templates/dynamic-content-template-builder#adding-a-snippet-to-the-template-code), [add variables](/docs/campaign/dynamiccontent/creating-dynamic-content-templates/dynamic-content-template-builder#adding-a-variable)) and/or by filling out the form in the Config tab. In this use case, we will use the capabilities of the predefined Config tab.
#### Edit the form in the Config tab The form in the **Config** tab is already filled in with default values. You can keep them or change them to fit your business needs. 1. From the **Aggregate ID** dropdown list, select the [aggregate you created in the previous step](/use-cases/send-aggregate-to-datalayer#create-an-aggregate). You can find it by typing its name or ID in the search box. 2. In the **Event parameter name** field, define the name of event parameter that stores the aggregate value pushed in event to DataLayer. You can leave the default name of the event parameter defined in the template or change its name to a different one you want to see in the DataLayer. 3. In the **Event name** field, define the name of event pushed to DataLayer. 4. If the template is ready, in the upper right corner, click **Save this template > Save as**. 5. On the pop-up: 1. In the **Template name field**, enter the name of the template. 2. From the **Template folder** dropdown list, select the folder where the template will be saved. 3. Confirm by clicking **Apply**. 6. To continue the process of configuring the dynamic content campaign, click **Next**. 7. To save your content changes, click **Apply**. ### Define schedule and display settings 1. In the **Schedule** section, click **Define** and set the time when the message will be active. 2. In the **Display Settings** section, click **Define**. 3. Specify circumstances for dynamic content to be displayed. Optionally, you can also define the Advanced options. In our case, we will define the frequency of dynamic content to be displayed to **Once per day**. 4. Click **Apply**. 5. Optionally, you can define the UTM parameters and additional parameters for your dynamic content campaign. 6. Click **Activate**. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of each step from this use case in our Synerise Demo workspace: - [Segmentation](https://app.synerise.com/analytics-v2/segmentations/11312171-ac93-4c81-a176-a096f7ec2538) - [Propensity prediction](https://app.synerise.com/ai-v2/predictions/propensity/sqkrtvagceac) - [Aggregate](https://app.synerise.com/analytics/aggregates/05775fe2-307f-3180-94d1-b7b9339f7c3f) - [Dynamic content](https://app.synerise.com/campaigns/create/6491e0aa-e0c0-4c8e-a5d1-8dd9f5970cea) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 2 events per profile that completes the flow: [`snr.propensity.score`](/docs/assets/events/event-reference/predictions#snrpropensityscore) (~1), [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Dynamic content](/docs/campaign/dynamiccontent) - [Dynamic content template builder](/docs/campaign/dynamiccontent/creating-dynamic-content-templates/dynamic-content-template-builder) - [Jinjava inserts](/developers/inserts) - [Snippets](/docs/assets/snippets) # Quick and easy transaction import to Synerise There are various methods available to import transactional data into Synerise. One of them is to send live data via API, collect it directly from the website, or set up cyclic data exchange processes between Synerise and external solutions. Another possible method is a simple import, which can be done through an intuitive wizard to guide you in importing data that meets all Synerise requirements. In this use case, we will walk you through the process of importing transactions to Synerise using a local `.csv` file. This straightforward method ensures a smooth and efficient import of your transactional data, allowing you to leverage it for robust analytics and impactful business decisions. ## Prerequisites --- Make sure you meet all [prerequisites](/docs/assets/imports/importing-transactional-data#requirements) for starting to work with Imports. You will also find valuable [tips](/docs/assets/imports/importing-transactional-data#tips-for-preparing-a-csv-file) for preparing the CSV file.
In this case, we will use data from a sample file, which can be downloaded during the [Select the file for import](/use-cases/import-transactional-data#select-the-file-for-import) step, using the **Get Sample File** button.
## Select the file for import --- In this part of the process, you will upload a file from your device. 1. Go to **Data Modeling Hub > Imports > New import**. 2. As the data type for import, select **Transactions**. 3. As the import method, to import a single `.csv` file to Synerise, select **Import a local file**. 4. Upload the `.csv` file by using the **+ Upload file or drag one here** field. 5. Optionally, you can customize the file metacharacters by clicking the arrow down icon next to **Customize file markup**. 1. From the **Delimiter** dropdown, select the character that marks the end of a column. 2. From the **Quotation mark** dropdown list, select the characters that contain the text. 3. From the **Escape character** dropdown lists, select the character which changes the default interpretation of a character or a string followed by the escape character. 6. You can preview the data output by clicking **Preview data**.
File download view
File download view
7. Click the **Next** button to upload the file. 8. When the file is uploaded click **Next** to proceed. ## Mapping the columns with parameters in Synerise --- In this part of the process, you will connect the columns from the file with their counterparts (the existing parameters) in Synerise. This way, you will point which parameters in Synerise will contain the event information from the imported file. Note that the revenue information is mandatory. If you have not previously included this information in the file, you can enable automatic calculation of the revenue (which is the multiplication of the item quantity by its price) in this part of the process by enabling the **Calculate revenue** option. In the **Product unit price** field, from the dropdown list select the name of the column that contains the price of a single piece of an item. The revenue will be calculated by multiplying price by item quantity. You can also exclude parameters from the import. During the mapping process, you can’t add new columns to the imported file. 1. Next to the file column name, from the dropdown list, select the corresponding parameter in Synerise. Perform this step for all columns in your file if needed.
In our case, we do not need to map the parameters, because the uploaded file meets all the requirements from the prerequisites.
Mapping the columns with parameters
Mapping the columns with parameters
2. To proceed to the summary of the import, click **Next** and **Continue**. **Result:** The summary of the import is displayed. 3. After checking the import summary, to start the import, click **Run import**. **Result:** The import results in `transaction.charge` and `product.buy` events generated on the profile cards of customers indicated in the imported file. Once you initiate the import process, you can conveniently monitor its progress. If data was added in the wrong format, all relevant details of these irregularities are available in the job list. Each stage of the import process is accompanied by its status and information on the level of success achieved. This allows you to easily identify any issues and take appropriate actions to fix them. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`transaction.charge`](/docs/assets/events/event-reference/items#transactioncharge) (~1), [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~2). ## Read more --- - [Imports](/docs/assets/imports/introduction-to-imports) - [Transactional data structure](https://hub.synerise.com/api-reference/profile-management#operation/ClientCompletedTransaction) # Back in stock campaign There are many reasons why products go out-of-stock. As an example, it can be caused by a sudden trend or seasonal demands. As a result, customers can get a bit frustrated as they cannot buy the product they want at the time they need it. Leaving customers with this feeling in this situation is a very bad idea, as it can trigger them to move on to a competitor in hopes of finding a substitute for the product they were unable to buy in your store. At that point it not only causes you to lose sales, but also makes a long-term impact on customer satisfaction that was caused by the frustrating experience. If you don't want to lose your customers, it's important to properly manage the out-of-stock situation and turn it into a positive customer interaction. One of the most effective actions in this regard is to allow the customer to sign up for a product availability notification list, so that when the product is back in stock, the customer receives an email notification about it. This simple action helps recover potentially lost revenue while keeping customers engaged with your brand. This use case describes an example of a back in stock campaign that you can implement in your business. The scenario described involves sending email communications to customers with products that they were previously interested in and signed up for notifications about those products, and which are now back in stock.
Back in stock campaign
## Prerequisites --- - Send an event when a customer signs up for a product availability notification. Such an event should contain the ID of the product that the customer signed up for in order to be notified when the product is back in stock. This event will appear on the profile of the customer who signed up for such notification. You can send this event using the [API](https://hub.synerise.com/api-reference/data-management#operation/CustomEvent) or [JS SDK](/developers/web/tracking-form-data/tracking-form-data-sdk#calling-the-sdk-directly).
In this use case, this event is named `form.submit`. We will use the nomenclature of this event in the subsequent steps of this use case. The name of the implemented event used in this case is just an example and depends on your implementation.
You can use the [dynamic content](/docs/campaign/dynamiccontent) to display a sign-up form for product availability notifications on the card of unavailable product and send an event to Synerise when the form is filled out using the [JS SDK](/developers/web/tracking-form-data/tracking-form-data-sdk#calling-the-sdk-directly) method.
- [Create an email template](/docs/campaign/e-mail/creating-email-templates) to be used in the back in stock campaign.
You can find an example of Jinjava code that you may use in your mailing in the [configuration of the Send Email node](/use-cases/back-in-stock#configure-the-send-email-node).
- [Configure email account](/docs/campaign/e-mail/configuring-email-account). - [Create item catalog](/use-cases/import-product-feed-to-catalog) containing information about product availability. ## Process --- 1. [Create a product.backInStock event](/use-cases/back-in-stock#create-a-productbackinstock-event) 2. [Create an aggregate with products for which the customer has signed up for notifications ](/use-cases/back-in-stock#create-an-aggregate-with-products-for-which-the-customer-has-signed-up-for-notifications) 3. [Create an aggregate collecting SKUs of products already received by the customer that are back in stock](/use-cases/back-in-stock#create-an-aggregate-collecting-skus-of-products-already-received-by-the-customer-that-are-back-in-stock) 4. [Create a workflow](/use-cases/back-in-stock#create-a-workflow) ## Create a product.backInStock event --- In this part of the process, add the **product.backInStock** event, which will later be generated in the workflow that checks whether the product is back in stock. In addition, this event must include the parameter **sku**, which contains the SKUs of all restocked products the customer signed up for. 1. Go to Data Modeling Hub icon **Data Modeling Hub > Events > Add event**. 3. In the **Name** field, enter `product.backInStock`. In the API and SDK, the name parameter is usually called `action` or `action name`. 4. Optionally, define a human-friendly display name that will be shown in the **Data Modeling Hub** and **Decision Hub**. 5. Optionally, in the **Description** field, enter the description of the event. 6. Enable the **Make this event available to anonymous profiles without JWT** toggle. 7. Click **Apply**. 8. In the list of events, find the event you just created. 9. On the right side of the screen, click **Add property**. 10. In the **Source parameter** field, enter `sku`. 11. In the **Property name** field, enter a human-readable label for display in the Synerise platform. 12. Optionally, in the **Description** field, you can add an explanation about the purpose of this parameter. 13. To complete the process, click **Save**. ## Create an aggregate with products for which the customer has signed up for notifications --- The aggregate created will later be used in workflow to check which products have returned to stock.
The event action name and the parameter name used in this use case are only demonstrative and may be different depending on the event implementation.
1. Go to Behavioral Data Hub icon> **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last multi** and in the **Size** field, enter `100`. 5. From the **Choose event** dropdown list, select the **form.submit** event. 6. As the event parameter, select **sku**. 7. Click **+ where** button. 8. From the **Choose parameter** dropdown list, select the **form type** parameter. 9. From the **Choose operator** dropdown list, select **Equal**. 10. Enter the name of the form. In our case it's `back in stock alert`. 11. Set the period from which the aggregate will analyze the results to the last **30 days**. 12. Save the aggregate.
Decision Hub Last Multi aggregate returning the last 100 product SKUs from form.submit back-in-stock-alert events in the last 30 days
Configuration of the aggregate
## Create an aggregate collecting SKUs of products already received by the customer that are back in stock --- This aggregate will be used later in the process to exclude products already sent to customers when sending the next notification email. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last multi** and in the **Size** field, enter `100`. 5. From the **Choose event** dropdown list, select the **product.backInStock** event. 6. As the event parameter, select **sku**. 7. Set the period from which the aggregate will analyze results to the last **30 days**. 8. Save the aggregate.
Decision Hub Last Multi aggregate returning the last 100 product.backInStock SKUs in the last 30 days to exclude already-notified products
Configuration of the aggregate
## Create a workflow --- Create a workflow that will check daily whether the products that customers have signed up for notifications have returned to stock. If so, the prepared workflow will send an email to the customer with the relevant information. 1. Go to **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Configure the trigger --- In this part of the process, select the segmentation for which you will run this campaign. In our case, these are those customers who have signed up for product availability notifications in the last 30 days and agreed to receive messages through the email channel. 1. Start the workflow with the **Audience** node. In the configuration of the node: 1. Set the **Run trigger** option to **repeatable**. 2. Set the interval at which you want to run the workflow. 3. Select the time zone. 4. Select the **New audience** tab. 5. Click **Define conditions**. 6. From the **Choose filter** dropdown list, select the **form.submit** event. 7. Click **+ where** button. 8. From the **Choose parameter** dropdown list, select the **form type** parameter. 9. From the **Choose operator** dropdown list, select **Equal**. 10. Enter the name of the form. In our case it's `back in stock alert`. 11. Define the time period for the **last 30 days**. 12. From the **Choose filter** drop-down list, select the **newsletter_agreement** parameter. 13. From the **Choose parameter** drop-down list, select the **Equal** operator and specify the condition as **enabled**. 14. Confirm by clicking **Apply**.
Automation Hub Audience node configuration checking back-in-stock alert signup and newsletter agreement
Configuration of the Audience node
### Configure the Generate Event node --- Before sending the email to the customer, an event must be generated on the customer's profile, which will be defined in this step. The event must contain the SKUs of restocked products (these are the products that will be sent to the customer in the email). The system will verify the restocking based on the availability parameter in the item catalog which was created as part of the prerequisites. Additionally, the [products for which notifications have already been sent to the customer previously](/use-cases/back-in-stock#create-an-aggregate-collecting-skus-of-products-already-received-by-the-customer-that-are-back-in-stock) are excluded. 1. Add the **Generate event** node. In the configuration of the node: 1. Enter the **Event name**. In our case, we are using `product.backInStock` event. 2. In the **Body** section, use the following Jinjava and modify it to your needs:
Jinjava inserted in **Generate event** body must have all empty spaces deleted.
{
    "sku":"
    {% set signedProducts = [] %}
    {% set receivedProducts = [] %}
    {% set finalSku = [] %}
      {% aggregate LAST-SKU-SIGNED %} {# aggregate collecting product sku #}
      {% for sku in aggregate_result|reverse %} {# saving sku from aggregate to signedProducts variable #}
        {% do signedProducts.append(sku) %}
      {% endfor %}
    {% endaggregate %}
      {% aggregate LAST-SKU-RECEIVED %} {# aggregate collecting product sku sended to user #}
      {% for sku in aggregate_result|reverse %} {# saving sku from aggregate to receivedProducts variable #}
        {% do receivedProducts.append(sku) %}
      {% endfor %}
    {% endaggregate %}
    {% for sku in signedProducts %}
      {% catalogvar.catalog(sku).availability %}
          {% if catalog_result == 'in stock' %}  {# condition to check if products are availability#}
              {% if sku in receivedProducts|join(',') %} {# condition that adds a comma to items #}
              {% else %}
                  {% do finalSku.append(sku) %}
              {% endif%}
          {% endif %}
      {% endcatalogvar %}
    {% endfor %}
    {% set counter = 0 %} 
    {% for sku in finalSku %} {# listing the final sku in the sku parameter #}
    {% set counter = counter + 1 %}
        {{sku}}
    {% if counter < finalSku|length%},{% endif %}{%endfor%}" 
   }
As a result is a `product.backInStock` event which in the `sku` parameter contains the SKUS of products that are back in stock. The list of the products will be sent in the email, separated by commas. If the event is empty, it means that none of the products have met the back in stock conditions. An example of a generated event:
An example of a generated product.backInStock event
An example of a generated product.backInStock event
### Configure the Event Filter node --- The workflow waits for the event generation from the previous step and sends the email based on it. 1. Add the **Event Filter** node. In the configuration of the node: 1. Check event **for period of time**. 2. Define the time range to **1 minute**. 3. From the **Choose event** dropdown list, select the **product.backInStock** event. 4. As the event parameter, select **sku**. 5. From the **Choose operator** dropdown list, select **Regular expression**. 6. As the value, enter `.+`
The `.+` value means any number of characters. We add this value to exclude from the communication customers for whom an empty SKU parameter was generated in the previous event. It happens when none of the products the customer signed up for were returned to stock.
7. Confirm by clicking **Apply**. 2. For the **not matched** path, select the **End** node. 3. For the matched path, select the **Send Email** node. ### Configure the Send Email node --- At this stage, an email is sent to customers, which contains the products returned in the event from the previous step. 1. In the email configuration, select the template you previously prepared for the back in stock campaign. In the template, you can retrieve event data from the **Event Filter** node. You can learn more how to reuse event parameters [here](/developers/inserts/automation). The following code is an example of how to do it:
Example Jinjava code
{% set sku_array = event.params.sku %} {% set sku_from_array = sku_array|split(',') %} <ul> {% for sku in sku_from_array %} <li data-snr-ai-product-id="{% catalog.Snrs-produktu-ogTag(sku).product:retailer_part_no %}"> <a class="snrs-AI--item-link" href="{% catalog.Snrs-produktu-ogTag(sku).og:url %}" title="{% catalog.Snrs-produktu-ogTag(sku).og:title %}"> <img src="{% catalog.Snrs-produktu-ogTag(sku).og:image %}" class="products-slider__item-image snrAI-product-image snrAI-product-image-{% catalog.Snrs-produktu-ogTag(sku).og:image %}" width="90" alt="{% catalog.Snrs-produktu-ogTag(sku).og:title %}" id="snrAI-image-{% catalog.Snrs-produktu-ogTag(sku).product:retailer_part_no %}"> <h3 class="snrs-AI-product--product-name"> <span class="snrs-AI-product--name-first">{% catalog.Snrs-produktu-ogTag(sku).og:title %}</span> </h3> </a> </li> {% endfor %} </ul>
In addition, you can retrieve, for example, images or other parameters from your [catalog](/developers/inserts/insert-usage#extracting-values-from-catalogs). 2. Confirm by clicking **Apply**. ### Add final setting to your workflow --- 1. Add the **End** node. 2. Launch the workflow by clicking **Save&Run**.
Automation Hub workflow for sending back-in-stock notifications
Configuration of the workflow
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of each step directly in the Synerise Demo workspace: - [Create an aggregate with products for which the customer has signed up for notifications ](https://app.synerise.com/analytics/aggregates/b4173b56-cf83-3ce8-90c8-f35f36a91368) - [Create an aggregate collecting sku's of products already received by the customer that are back in stock](https://app.synerise.com/analytics/aggregates/e55cae5e-2d48-3e29-a2a2-5122913e4e96) - [Create a workflow](https://app.synerise.com/automations/automation-diagram/14d5a2dc-3cc9-4fcf-97fc-d0d328004484) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 10 events per profile that completes the flow: [`form.submit`](/docs/assets/events/event-reference/web-and-app#formsubmit) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), `product.backInStock` (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Automation Hub](/docs/automation) - [Catalogs](/docs/assets/catalogs/introduction-to-catalogs) - [Email campaigns](/docs/campaign/e-mail) - [Product feed](/developers/product-feed) - [Reusing event context from preceding nodes](/developers/inserts/automation) - [Segmentation](/docs/analytics/segmentations) # WhatsApp abandoned cart message Businesses should understand the importance of personalized communication and aim to provide a seamless shopping experience for their customers. With Synerise, you can leverage your business using WhatsApp to send personalized messages to customers who have abandoned their shopping carts. Sending customized messages through WhatsApp may increase your sales and reduce cart abandonment rates. You can use this integration to ensure that your customers receive timely reminders about their abandoned carts, with personalized offers and incentives to encourage them to complete their purchase. In this use case, you will create a workflow sending a personalized message on WhatsApp encouraging customers who abandoned their cart to complete the transaction.
Abandoned cart WhatsApp message
## Prerequisites --- - Make sure you meet [all prerequisites](/docs/automation/integration/whats-app/send-template-message#prerequisites) to work with the **Send Template Message** node. - Implement the [transaction events](/developers/web/transactions-sdk) using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). - [Implement the `cart.status` event](/developers/web/cart), which stores the current status of the basket in the form of an event on the customer's card. The event has to be sent to Synerise after every change in the cart status. - Collect [product.addToCart event](/docs/assets/events/event-definitions). ## Process --- In this use case, you will go through the following steps: 1. [Create an aggregate](#create-an-aggregate) with abandoned products. 2. [Create a message template in the Meta portal](#create-a-message-template-in-the-meta-portal) 3. [Create a workflow to send message to customers on WhatsApp](#create-a-workflow-to-send-message-to-customers-on-whatsapp) ## Create an aggregate --- In this part of the process, create an aggregate that returns the list of the abandoned products. You will use the result of the aggregate as an insert to display products from the abandoned cart in your WhatsApp message. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last**. 5. From the **Choose event** dropdown list, select the `cart.status` event. 6. As the event parameter, select **products**. 7. Set the analyzed period to **Lifetime**. 12. Save the aggregate.
Decision Hub Last aggregate returning the products parameter of the last cart.status event over a customer's lifetime
Configuration of the aggregate
## Create a message template in the Meta portal --- Create a message template in the Meta portal that you will use in the next part of the process. In the body of the message, mark places where the dynamic elements will be added. In addition, if you would like to add a CTA at the end of the message, you can add a button and define its copy. The page to which the customer will be redirected after clicking the button can be defined in Synerise. The example message used in this use case: `*{{1}}* Hi {{2}}, it looks like you forgot something. Go on and complete your purchase!` Where `{{1}}` and `{{2}}` are markers that will be replaced with the dynamic values. This step will be done in Synerise. The screen below shows an example of creating a template message in the Meta portal:
The view of the message template configuration in the Meta platform
Configuration of the message
In the following screen, you can see how a button can be defined in the Meta portal:
The view of the button configuration in the Meta platfrom
An example of button section configuration in the Meta platform
## Create a workflow to send message to customers on WhatsApp --- The workflow will be triggered by the `product.AddToCart` event. The delay is defined up to 1 day. If a customer does not make a transaction within one day, we will send a WhatsApp message with a reminder to buy products left in the cart. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the trigger node --- 1. As the first node, add the **Profile Event**. In the settings of the node, select the **productAddToCart** event. 2. Click **Apply**. ### Configure the Delay node --- 1. Add the **Delay** node. In the node settings: 1. In the **Delay** field, type `1`. 2. From the dropdown list, choose **Day**. 2. Click **Apply**. ### Define the Profile Filter node --- As the next node, choose **Profile Filter** to check if a customer have made a transaction in the last 24 hours. 1. Add the **Profile Filter** node. In the node settings: 1. From the **Choose filter** dropdown, select the `transaction.charge` event. 3. Set the date range to the last 1440 minutes.
Use 1440 minutes instead of 1 day – use smaller granulation, as in this case 1 day would take the time from current hour till the midnight, so such an analysis would not take into consideration all customers who meet the meet the filter conditions.
2. Click **Apply**. ### Define the Send a template mesage node --- 1. To the **Not matched** path, add the WhatsApp **Send Template Message** node. 2. Click **Select connection**. 3. From the dropdown list, select the connection. - If no connections are available or you want to create a new one, see [Create a connection](/docs/automation/integration/whats-app/send-template-message#create-a-connection). - If you selected an existing connection, proceed to defining the integration settings. 4. In the **Sender ID** field, enter the phone number ID from which the message will be sent. [You can find more information about phone number ID here](https://developers.facebook.com/docs/whatsapp/cloud-api/get-started/add-a-phone-number). 5. In the **Receiver** field, enter the phone number of the customer who will receive this message. We recommend using the `{% customer phone %}` insert, which inserts the phone number of an individual customer who goes through this node. 6. In the **Message template** field, enter the name of the [message template](#create-a-message-template-in-the-meta-portal) you created earlier in the Meta portal. 7. From the **Language code** dropdown list, select the language used in the message. 8. In the **Message components** field, insert the object that contains the dynamic values in the order defined in the message template.   The example of object used in this use case:
The aggregate ID is used as examples for the purpose of this use case.
[  
            {    
                "type": "body",    
                "parameters": [      
                    {        
                        "type": "text",        
                        "text": "{% aggregate 17d214c4-5644-33b1-b0c6-9fab96b26b3e %}{% for item in aggregate_result %}{% catalog.store-1(item.sku).name %}{% endfor %}{% endaggregate %}"      
                        },      
                        {       
                            "type": "text",        
                            "text": "{% customer firstname %}"      
                            }    
                        ]
            },
            {
                "type": "button",
                "index": "0",
                "sub_type": "url",
                "parameters": [
                    {
                        "type": "url",
                        "text": "{% aggregate 17d214c4-5644-33b1-b0c6-9fab96b26b3e %}{% for item in aggregate_result %}{% catalogvar.store-1(item).url %}{{ catalog_result|replace('https://yourshop.com', '') }}{% endcatalogvar %}{% endfor %}{% endaggregate %}"
                        }
                        ]
            },
            {
                        "type": "header",
                        "parameters": 
                        [
                        {         
                        "type": "image",
                        "image": 
                        {
                        "link": "{% aggregate 17d214c4-5644-33b1-b0c6-9fab96b26b3e %}{% for item in aggregate_result %}{% catalogvar.store-1(item).image %}{{ catalog_result }}{% endcatalogvar %}{% endfor %}{% endaggregate %}"
                        }
                        }
                        ]
                }
            ]
9. Click **Apply**. The following table explains all the inserts used in the body, button and header sections shown above. | Section | Insert value | Insert explanation | |--------- |-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | body | `{% aggregate 17d214c4-5644-33b1-b0c6-9fab96b26b3e %}{% for item in aggregate_result %}{% catalogvar.store-1(item).image %}{{ catalog_result }}{% endcatalogvar %}{% endfor %}{% endaggregate %}` | The value of this insert is used as the value of `{{1}}` to return a product that the customer left in the cart and did not purchase within the estimated time period. | | body | `{% customer firstname %}` | The value of this insert is used as the value of `{{2}}`, so the name of a customer can be displayed in the message. | | button | `{% aggregate 17d214c4-5644-33b1-b0c6-9fab96b26b3e %}{% for item in aggregate_result %}{% catalogvar.store-1(item).url %}{{ catalog_result\|replace('https://yourshop.com', '') }}{% endcatalogvar %}{% endfor %}{% endaggregate %}` | The value of this insert is used to return product url. Here we specify the URL omitting the domain, because we define the domain in the Meta platform, as you can see in the screenshot with the [button creation](#create-a-message-template-in-the-meta-portal). | | header | `{% aggregate 17d214c4-5644-33b1-b0c6-9fab96b26b3e %}{% for item in aggregate_result %}{% catalogvar.store-1(item).image %}{{ catalog_result }}{% endcatalogvar %}{% endfor %}{% endaggregate %}` | The value of this insert is used to return the url to the product image in the header. | ### Add the finishing node --- 1. Add the **End** node to the **Send Template Message** node. 2. To the **Matched** path, add the **End** node. 3. In the upper right corner, click **Save & Run**. ## Check the use case set up on the Synerise Demo workspace --- You can check the [aggregate](https://app.synerise.com/analytics/aggregates/17d214c4-5644-33b1-b0c6-9fab96b26b3e) and [workflow](https://app.synerise.com/automations/automation-diagram/7ea1d166-3125-4f70-ae45-659e2bfef5a3) configuration directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 7 events per profile that completes the flow: [`product.addToCart`](/docs/assets/events/event-reference/items#productaddtocart) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`whatsapp.sendTemplateMessage`](/docs/assets/events/event-reference/integration#whatsappsendtemplatemessage) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Automation Hub](/docs/automation) - [Jinjava inserts](/developers/inserts) - [WhatsApp Send Template Message node](/docs/automation/integration/whats-app/send-template-message) # In-app QR Code Scanner In today’s retail environment, the boundaries between online and offline experiences are increasingly blurred. Mobile applications can bridge this gap by providing interactive tools that connect the physical store with digital personalization. One such solution is an **in-app QR code scanner** that directs customers to individualized promotions and recommendations based on their unique profile. By enabling users to scan QR codes placed in physical locations—such as shelves, displays, or posters—brands can drive engagement, gather valuable behavioral data, and deliver a seamless omnichannel experience. Each scan automatically appends the user’s UUID (unique identifier) to the destination link, ensuring that the landing page content is fully personalized to that individual. This use case demonstrates how to create an interactive in-app campaign featuring a built-in QR scanner that redirects customers to a personalized landing page with AI-driven recommendations. Using a **predefined template**, the setup process is quick and does not require building the scanner interface from scratch. You will use a predefined template with the resize option, which appears permanently in the application as a top or bottom bar, providing easy access to the QR code scanner and simplifying its implementation. The campaign targets users who interact with a brand in physical locations by scanning an in-store QR code to unlock exclusive discounts for the promoted brand and get product suggestions tailored to their preferences. After scanning the code, the users are directed to a landing page, where they will find the personalized recommendations from 3 specific, promoted brands, costing more than 50$. What is more, you can use this scanner in different scenarios by **letting the user scan QR codes in various placements** - in stores, on street banners, in magazines etc. Each time, you deliver personalized content and recommendations, avoiding sending the same content to everyone.
In-app with scanner
## Prerequisites --- - [Implement Synerise SDK in your mobile app](/developers/mobile-sdk). - If you plan to publish a landing page within your own domain, follow instructions from ["Requirements for custom domains" section](/docs/campaign/landing-page/creating-landing-page#requirements-for-custom-domains); if you choose to publish it on the Synerise domain, no additional requirements are necessary - [Configure AI engine](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations) to be able to add personalized AI recommendations to your landing. ## Process --- In this use case, you will go through the following steps: 1. [Create AI recommendations](#create-ai-recommendations) with personalized products. 2. [Create a landing page](#create-a-landing-page) 2. [Create an in-app campaign](#create-an-in-app-campaign) with QR code scanner using the predefined template. ## Create AI recommendations --- In this step, create an AI attribute recommendation campaign showing products from specific, promoted brands. 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. Enter the name of the recommendation (it is only visible on the list of recommendations). 3. In the **Type & Items feed** section, click **Define**. 4. From the **Items feed** dropdown list, select a product feed. 5. Select the **Attribute** recommendation type. 6. Confirm the recommendation type by clicking **Apply**. 6. In the **Items** section, click **Define**. 10. Click **Add slot**. 11. Define the minimum and maximum number of products that will be recommended to the user. In this example, it's from 3 to 5. 12. From the **Items attribute** dropdown menu, choose the **brand** attribute. 3. Click **Define filter** in the [Static filter](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#static-filters) section, and from the dropdown list choose **Visual Builder**. 4. From the **Select attribute** dropdown list, choose **brand**. 5. From the **Operator** dropdown list, select **In**. 7. From the **Select value** dropdown list, select the specific brands you want to promote. 8. Click **Apply**.
The view of the configuration of the static filter
Configuration of the static filter
9. Optionally, define [Elastic filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#elastic-filters). 10. Click **Apply**. 13. Click **Apply**. 14. In the top right corner, click **Save**. ## Create a landing page --- In this part of the process, you will create a landing page with personalized recommendations created in the [previous step](#create-ai-recommendations). 1. Go to Experience Hub icon **Experience Hub > Landing Page > Create new**. 2. Enter the name of the campaign. ### Define content --- 1. In the **Content** section, click **Create message**. 2. From the list of template folders, select the **Predefined templates** folder. **Result:** You are redirected to the list of predefined templates. 3. Select the **QR Code Scanner** template. **Result:** You are redirected to the code editor. The form in the **Config** tab is pre-filled with default values, which you can modify to suit your business needs. 5. In the **Main Recommendation ID** field, enter the ID of recommendations you created as a part of [previous step](#create-ai-recommendations). 6. Modify **Buttons, Hero, Footer** and other sections, and appearance of your landing page, including fonts, colors, and backgrounds, to ensure it matches your branding. 7. After you make changes to the template, you can check the preview. 1. Click the **Preview Contexts** button on the upper left side. 2. Enter the ID of a customer. 3. Click **Apply**. 8. If the template is ready, click **Use in communication** in the upper right corner. ### Define schedule settings --- 1. In the **Schedule** section, click **Define**. 1. Select the timezone. 2. Select the time when the landing page will be active - in this case, choose the start and end date. 6. Click **Apply** ### Define the SEO settings --- In this part of the process you may define technical details concerning search engine optimization and increase the chances of placing high in search results. ### Set up the URL --- In this part of the process, you will define the URL to your landing page. ### Adjust optional settings --- 1. In the **HTTP headers** section, you can add custom HTTP headers to your landing page. In the **Key** and **Value** fields, enter a header and its value, respectively. 2. In the **Customize** section: - you can add CSS and scripts to your landing page - you can define the URLs to external sources or paste the snippets - in the JS section under the **Advanced options** option, to enable additional tracking on your landing page, you can paste the [tracking code](/developers/web/installation-and-configuration#adding-the-tracking-code-to-your-site). ### Save your campaign --- 1. After you make changes to the campaign, you can check the preview. Click the **Preview** button on the upper right side. 2. When your landing page is ready you can **Save it as a draft** or directly click **Publish**. 3. Generate a QR code using any reliable online QR code generator. Use the link for the [landing page](#create-a-landing-page) created before. ## Create an in-app campaign --- In this part of the process, you will create an in-app campaign, which uses the resize feature, meaning it is displayed continuously in the app as a top or bottom bar, allowing quick and seamless access to the QR code scanner without additional steps. We will use a predefined template for the QR code scanner, so there is no need to create a template from scratch. 1. Go to Experience Hub menu icon **Experience Hub > In-app messages > Create new** 2. Enter a meaningful name for the in-app campaign. ### Define the audience --- 1. In the **Audience** section, click **Define**. 2. Select the **Everyone** tab. 3. Click **Apply**. ### Define content --- 1. In the **Content** section click **Define**. 2. Click **Create message** and from the list of template folders, select **Predefined templates**. 3. Select **QR code scanner**. **Result:** You are redirected to the code editor.
You can edit the template in two ways, by editing the code of the template ([add inserts](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-snippet-to-the-template-code), [add variables](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-variable)) and/or by filling out the form in the **Config** tab. In this use case, we will use the capabilities of the predefined **Config** tab.
#### Edit form in the Config tab --- The **Config** tab already has default values filled in. You can keep them or change them to fit your business needs.
In-app scanner message Config tab with bar and content settings
In-app configuration
1. In the **Bar settings** section set up the copy and style of the first banner. Choose the bar position (top or bottom bar). 2. In the **Content** section change the main title, subtitle and image. 2. In the **Button** section change the icon text, and style of the main button. 3. Fill the **Style** field, to personalize the visual of the in-app scanner. 4. Set up the **Message** section to personalize the success and the error message. 5. If you want to make it more personalized, you can use **HTML** tab to add changes directly in the code of the template. 8. After you make changes to the template, you can check the preview. 1. Click the **Preview** button on the upper left side. 2. Enter the ID of a customer or a product. 3. Click **Apply**.
Considering that the in-app is very interactive, the preview in the platform may not be enough to test the in-app performance. That's why we suggest checking how this campaign displays altogether directly in the mobile app.
9. If the template is ready, in the upper right corner, click **Save this template > Save as**. 10. On the pop-up: 1. In the **Template name** field, enter the name of the template. 2. From the **Template folder** dropdown list, select the folder where the template will be saved. 3. Confirm by clicking **Apply**. 11. Click **Next** to continue the process of configuring the in-app campaign. 12. Click **Apply** to save your content changes. ### Select events that trigger the in-app message display --- In this part of the process, define the event that triggers the display of the in-app message. In this, case it will be visible for all users, immediately after opening the application. 1. In the **Trigger events** section, click **Define**. 2. Select **Add event** and from the dropdown list, choose `screen.view` event. 3. Click the **+ where** button and select `source`. 4. As the logical operator, select **Equals**. 5. As the value add **MOBILE**. 5. Click **Apply**.
In-app message trigger configured with screen.view event filtered by MOBILE source
In-app trigger event configuration
### Schedule the message and configure display settings --- As the final part of the process, you need to set the schedule, display settings configuration, capping, priority of the message among other in-app messages. 1. In the **Schedule** section: 1. Click **Define**. 2. Choose **Run immediately** option. 3. Click **Apply**. 2. In the **Display settings** section: 1. Click **Define**. 2. Define the **Delay display** as **0** and **Priority index** as **1**. 5. Click **Apply**. 3. Optionally, you can define the UTM parameters in the **UTM & URL parameters** section. Otherwise, click **Skip step**. 4. Optionally, you can add the custom parameters in the **Additional parameters** section. Otherwise, click **Skip step**. 3. To start your campaign, click **Activate**. ## What's next --- After launching the campaign, when the user taps the in-app message, the device camera will automatically open and the QR scanning mode will be activated. Once the QR code is successfully scanned, the user will be redirected to the dedicated landing page created for this campaign. The system will automatically append the user’s UUID to the landing page link, allowing the platform to identify the customer. Based on this unique identifier, the AI engine will generate personalized product recommendations tailored specifically to that individual. As a result, each user will see a unique, personalized product view on the landing page — no two users will see the same product set. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of the campaign components directly in Synerise Demo workspace: - [AI recommendation configuration](https://app.synerise.com/ai-v2/recommendations/wyjzJ4o2TsRa), - [LP](https://app.synerise.com/campaigns/landing-pages/create/aaf21d3c-5c1f-4d7c-a780-a51f84a7b590:2025-10-24T11:47:37.992137883) - [In-app campaign](https://app.synerise.com/communications/in-app/c1822d86-6053-4458-a6c4-904605688904) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 7 events per profile that completes the flow: [`screen.view`](/docs/assets/events/event-reference/web-and-app#screenview) (~1), [`inApp.show`](/docs/assets/events/event-reference/inapp#inappshow) (~1), [`inApp.click`](/docs/assets/events/event-reference/inapp#inappclick) (~1), [`landingpage.visit`](/docs/assets/events/event-reference/landing-page#landingpagevisit) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [In-app messages](/docs/campaign/in-app-messages) - [Using in-app template builder](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template) - [Mobile campaigns](/docs/campaign/Mobile) - [Recommendations](/docs/ai-hub/recommendations-v2) # Import transactional data from Google Cloud Storage to Synerise Synerise allows you to collect data from any customer touchpoint. Using Synerise's seamless integration with Google Cloud Storage (GCS), you can transfer any data stored in the GCS directly to Synerise and use it in the platform. In this use case, we will import a file with transactional data and purchase history from Google Cloud Storage. ## Prerequisites --- - You must have a Google Cloud account. - Create a project in Google Cloud. ## Prepare a workflow --- Create a workflow which performs a single import of the file with transactional data and purchase history from Google Cloud Storage to Synerise. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Scheduled Run trigger node --- At this stage, we will configure conditions that launch the workflow. As a trigger, we will use the **Scheduled Run** node. 3. As the trigger node, add **Scheduled Run**. 4. In the configuration of the node: 1. Change the **Run trigger** option to **one time**. 2. Select **Immediately**. 4. Confirm by clicking **Apply**.
Automation Hub Scheduled Run node configuration for triggering Google Cloud Storage file retrieval
The configuration of the Scheduled Run node
### Configure the Get File node --- In this step, to allow the data exchange, establish a connection between Synerise and Google Cloud Storage. 1. Add **Google Cloud Storage > Get File** node. 2. Click **Select connection**. 3. From the dropdown list, select the connection. - If no connections are available or you want to create a new one, see [Create a connection](/docs/automation/integration/google-cloud-storage/get-file-from-gcs). - If you selected an existing connection, proceed with the integration settings. 1. In the **Project ID** field, enter the unique identifier of your project in Google Cloud. You can learn how to find the project ID [here](https://support.google.com/googleapi/answer/7014113). 2. In the **Bucket** field, enter the name of an existing bucket (container) from which you will download a file with data. 3. In the **Path to directory** field, enter the path from which the file will be downloaded. 4. In the **File name** field, enter the name of the file you want to download from the storage. If the file already exists, the contents of the file will be overwritten. 5. From the **File format** dropdown list, select the format of the file which will be downloaded. 6. Confirm by clicking **Apply**.
The configuration of the Get file from Google Cloud Storage node
The configuration of the Get File node
### Add Import Transactions node --- In this step, add the **Import Transactions** node to import the file with transactions directly to Synerise. 1. Choose **Synerise** node. 2. From the list that opens, select **Synerise > Import Transactions**. ### Add the finishing node 12. Add the **End** node. 13. In the upper right corner, click **Save & Run**.
Automation Hub workflow for retrieving a file from Google Cloud Storage
The workflow configuration
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of the [workflow](https://app.synerise.com/automations/automation-diagram/79b22158-ca02-4d10-8e03-e26bc7839b3a)in this use case on our Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 8 events per workflow execution: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~2), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), `googleCloudStorage.getFile` (~1), [`transaction.charge`](/docs/assets/events/event-reference/items#transactioncharge) (~1), [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~2). ## Read more --- - [Get File](/docs/automation/integration/google-cloud-storage/get-file-from-gcs) - [Workflows](/docs/automation) # Import transactions to Synerise With Synerise you can process transactional data in many different ways. You can prepare advanced analysis or build marketing scenarios basing on them. You can also use transactions as a data set for AI engine. This use case describes the process of transformation of a `.CSV` file with transactional data. The transformations performed on the file involve: - adding missing columns with currency code - creating eventSalt for the transactions
The `eventSalt` parameter enables to deduplicate transactions when two or more are sent with the same eventSalt and time as the original transaction.
After the transformation, the entries in the file will be imported to Synerise as transaction events. ## Prerequisites --- - Save the file with transactional data to your computer. You can find the general requirements for the `.CSV` file format [here](/docs/assets/catalogs/creating-catalogs#requirements). Make sure your file contains [required columns](/docs/automation/actions/synerise-integrations/import-transactions#requirements). If any column is missing, it needs to be added later in the Data Transformation rules. Values of columns need to meet requirements of the transactional data structure used in Synerise. - Make a copy of the data file and remove rows from the copy until few are left. This copy will be used only as a sample for configuring the Data Transformation rules.
Click to see a sample CSV file used in this use case

client.email,orderId,paymentInfo.method,products.finalUnitPrice.amount,products.quantity,products.sku,recordedAt,revenue.amount,value.amount,products.name test@test.pl,1234,cash,24,2,10000,2022-05-24T14:15:22Z,50,50,shoes test@test.pl,1234,cash,26,2,20000,2022-05-24T14:15:22Z,50,50,dress

## Process --- 1. [Prepare a data transformation diagram](/use-cases/import-transactions-dt#create-data-transformation-rules) that will transform data from the `.CSV` file. 2. [Prepare a workflow](/use-cases/import-transactions-dt#prepare-a-workflow) that imports transactions to Synerise. ## Create data transformation rules --- In this part of the process, you define the rules of modifying data. The data transformation diagram which is the output of this part of the process is used later to [automate sending the data](/use-cases/import-transactions-dt#prepare-a-workflow). The sample file is used to configure the data transformation diagram and preview its results. With a [library of nodes](/docs/automation/data-transformation-and-imports/transformations-and-data-operators), you can modify the file by adding, renaming, and merging columns, as well as editing the values in the rows, and so on. In this example, we will use the **Add column** node to add columns with currency code and **Merge columns** to create eventSalt for the transactions 1. Go to Automation Hub icon **Automation Hub > Data Transformation > Create transformation**. 2. Enter the name of the transformation. 3. Click **Add input**. ### Add file with sample data This node allows you to add a data sample. In further steps, you define how the data must be modified. Later, when this transformation is used in the workflow, the system uses the rules created with the sample data as a pattern for modifying actual data. 4. On the pop-up, click **Add example**. 5. Upload the file with the sample data. 6. Click **Generate**. **Result:** The **Data input** view is filled with data from the sample.
Data input of the sample file
Data input of the sample file
### Add columns You can use the **Add column** node to create a new column to the file, with a defined value. In this example, there are no columns with currency codes in the input file so, [following the transactions import requirements](/docs/automation/actions/synerise-integrations/import-transactions#requirements), we will add following columns: **products.finalUnitPrice.currency**, **revenue.currency**, **value.currency**. All of them will have the defined value: `PLN`. 1. On the canvas, click the right mouse button. 2. From the dropdown list, select **Add column**. 3. Click the Add column node. 4. In the configuration of the node: 1. In the **Add column** field, enter the unique column name. In our case: `products.finalUnitPrice.currency`. 2. Select the **Static value** option. The rows in the new column will be filled with the value you define. 3. As the value, enter `PLN` 4. Confirm by clicking **Apply**. 5. Before you save the settings, you can check the preview of the file after changes on the **Output data** tab. 5. Add two more **Add column** nodes by repeating steps 1-4 with the following changes: - as the second column, add `revenue.currency` and as the value to insert, enter `PLN` - as the third column, add `value.currency` and as the value to insert, enter `PLN`
Final configuration of the last Add column node, value.currency
Final configuration of the last Add column node that adds the value.currency column
### Merge columns You can use the **Merge columns** node to create a new column based on the values from other columns and to define the separator between the merged values. In this example, we want to add the `eventSalt` parameter to the transactions using this node. This parameter enables you to deduplicate transactions when two or more are sent with the same `eventSalt` and time as the original transaction. In our case, we will build this parameter by merging values of three columns: **orderId**, **client.email**, and **recordedAt**. We will add the `-` separator between the values.
We recommend to always use `eventSalt` parameter while importing transactional data.
1. Click **Add rule**. 3. Click **Add column**. 4. From the dropdown list, select the columns to be merged: **orderId**, **client.email** and **recordedAt**. 5. In the **New column name** field, enter `eventSalt`. 6. In the **Separator** field, enter `-`. 5. Before you save the settings, you can check the preview of the file after changes in the **Output data** tab. 5. Confirm the settings by clicking **Apply**.
Final configuration of the Merge column node
Final configuration of the Merge column node
### Add the finishing node This node ends the transformation and passes the modified data to the automation where the Data Transformation is used. 1. On the canvas, click the right mouse button. 2. From the dropdown list, select **Data output**. 3. In the upper right corner, click **Save and publish**. **Result**:
Data Transformation diagram for importing transaction data to Synerise
The diagram of data transformation
After the data transformation diagram is published, you can use it in the Data Transformation node while preparing a workflow that imports the files. ## Prepare a workflow --- The scenario for this use case involves a one-time transformation of a file uploaded from the user's local storage. The transformed data will be imported to Synerise as transaction events. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the launch date 3. As the trigger node, add **Scheduled Run**. 4. In the configuration of the node: 1. Change the **Run trigger** option to **one time**. 2. Select **Immediately**.
Automation Hub Scheduled Run node configuration for triggering transaction data import
The configuration of the Scheduled Run node
3. Confirm by clicking **Apply**. ### Select file to export 1. Add a **Local File** node. 2. In the configuration of the node: 1. Upload the file in which you want to perform the transformation.
Local ile transfer
Local File transfer
2. Confirm by clicking **Apply**. ### Select the data transformation rules 1. Add a **Data Transformation** node. 2. In the configuration of the node, select the [data transformation you have created before](/use-cases/import-transactions-dt#create-data-transformation-rules).
The configuration of the Data Transformation node
The configuration of the Data Transformation node
3. Confirm by clicking **Apply**. ### Import transactions 1. Add the **Import Transactions** node. 2. Confirm by clicking **Apply**. ### Add the finishing node 1. Add the **End** node. 2. In the upper right corner, click **Save & Run**. **Result**:
Automation Hub workflow for importing transaction data
The workflow configuration
You can monitor the flow of the workflow in the **Transformation logs** tab. It contains information about each execution of the workflow.
Automation Hub Transformation logs tab showing workflow execution history
The logs for the workflow
The imported transaction events will be visible in the customers' profiles.
The transaction event visible in the customer's profile
The transaction event visible in the customer's profile
This use case concerns one-time import of transaction events from the local storage. However, you can simply modify the flow and run import cyclically from external resource. Learn more how to set up the configuration of importing data from external resource at the following links: [import from SFTP](/docs/automation/integration/sftp-integrations/sftp-get-file), [import from HTTPS](/docs/automation/integration/http-integrations/http-get-file).
## Check the use case set up on the Synerise Demo workspace --- You can also check [the Data Transformation diagram](https://app.synerise.com/automations/data-transformation/b92a97c3-6da7-4f84-8650-871df834a9ab) and [the workflow configuration](https://app.synerise.com/automations/automation-diagram/f9ffbda5-2509-4dbe-a5c3-3686f5312247) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 8 events per workflow execution: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`transaction.charge`](/docs/assets/events/event-reference/items#transactioncharge) (~1), [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~2). ## Read more --- - [Data Transformation](/docs/automation/data-transformation-and-imports/introduction) - [Enriching events from catalogs](/docs/assets/events/adding-event-parameters#enriching-events-with-data-from-catalogs) - [Behavioral Data Hub](/docs/crm) - [Transactional data structure](https://hub.synerise.com/api-referenceClientManagement/ClientManagement.html#operation/ClientCompletedTransaction) # Find customers who are most likely to return items Each store can identify customers who return or exchange products more often than others. In this case, we are dealing with "serial returners" - shoppers responsible for excessive returns. Some of them may have insincere intentions, while the others may suffer from controlling their buying behavior. Typically, these customers cost sellers a lot of money, so it’s helpful to know which customers are likely to return and to plan the steps to prevent frequent returns and save the company time and money. This use case describes the process of creating a segmentation of customers with the highest propensity for returns. This segmentation can later be excluded from selected campaigns that provide promotional codes or other discounts, helping a company optimize the cost of planned campaigns that are oriented toward customers who will benefit from such a promotion and enjoy the purchase. ## Prerequisites --- - [Integrate JS SDK](/developers/web/installation-and-configuration) or implement Synerise SDK in your [mobile application](/developers/mobile-sdk) - greater data collection will allow the model to be better trained and produce better results. - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). - [Enable the Lookalike prediction type](/docs/ai-hub/predictions/enabling-predictions#enabling-lookalikes). - [Implement a custom event](https://hub.synerise.com/api-reference/data-management#operation/CustomEvent) that refers to the returned products. As an example, such an event could be named `product.return`. The exemplary event is available below:
SR.event.trackCustomEvent { "label": "The customer returned product", 
                              "client": { "email": "testDoc@synerise.com" }, 
                              "action": "product.return", 
                              "params": { "product_sku": "xxx", "orderId": "xxx", 
                              "reason_of_return": "shoes were too small" } }
## Process --- 1. Create a [target segmentation](/use-cases/predicting-returns#create-a-target-segmentation). 2. Create a [source segmentation](/use-cases/predicting-returns#create-a-source-segmentation). 3. [Create a prediction](/use-cases/predicting-returns#create-a-prediction). ## Create a source segmentation --- In this part of the process, create a source segmentation that contains customers who will be compared with the customers in the target segmentation. This segmentation includes customers who have made at least two returns in the last 30 days. The fastest way to make such a segmentation is to create a `product.return` event funnel. 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of the segmentation. 3. From the **Add condition** dropdown list, select the `product.return` event. 4. From the **and then** dropdown list, select the same event. 5. As the time range, set **Last 30 days**.
You can freely manage the number of events in the funnel and the selected time range to create conditions that suit your business objectives.
6. Save the segmentation.
Configuration of the target segmentation
Configuration of the target segmentation
## Create a target segmentation --- Create a segment of customers among whom you want to find those most likely to make a return. 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of the segmentation. 3. From the **Add condition** dropdown list, select the `product.buy` event. 4. As the time range, set **Last 30 days**. 5. Save the segmentation.
Configuration of the source segment
Configuration of the source segment
## Create a prediction --- In this part of the process, create a Lookalikes prediction which compares the two segmentations - the engine looks for customers in the target segmentation who are most similar to the customers in the source segmentation. On the profile cards of all customers from the target segmentation, a `snr.lookalike.score` event is generated. In the details of the event, you can find the **score_label** parameter that describes the similarity of a customer to the customers in the source segmentation. The **score_label** parameter for this particular prediction takes two values: low or high. 1. Go to AI Hub icon **AI Hub > (AI Predictions) Models > New prediction**. 2. In the **Select prediction type** window that appears, click **Lookalikes**. 3. Click **Apply**. 4. In the **Audience** section, click **Define**. 5. In the **Source segmentation** subsection, click **Choose segmentation**. 6. From the dropdown list, select the [source segmentation](/use-cases/predicting-returns#create-a-source-segmentation) you created before. 7. In the **Target segmentation** subsection, click **Choose segmentation**. 8. From the dropdown list, select the [target segmentation](/use-cases/predicting-returns#create-a-target-segmentation) you created before. 9. Confirm by clicking **Apply**. 10. In the **Settings** section, click **Change**. 11. Enable the **Set up recurring prediction calculation** option. 12. Set the recalculation of the prediction every 30 days. The segmentation is recalculated before a prediction is recalculated - recalculation of the segmentation concerns recurring predictions which intervals are longer than several hours.
You can define a different recalculation time that better fits your business goals.
13. Select the **2-point scale**. 14. Confirm by clicking **Apply**. 15. Click **Save & Calculate**. ## What's next --- Based on the `snr.lookalike.score` event, create a segmentation for cusomers with the highest lookalike score (customers who are most likely to return). To define the size of the recipient group, you can use the `score_label` parameter of the `snr.lookalike.score` with the `score` value set to `High`. Below you can find an example of the `snr.lookalike.score` event that appears in the customer profile.
Example of event `snr.lookalike.score`
Example of event `snr.lookalike.score`
An example of the segmentation of customers with the highest probability to return is shown in the following screen:
Example of segmentation based on lookalike prediction score
Example of segmentation based on lookalike prediction score
Later, you can use this segmentation to exclude it for example from email or SMS promotional campaigns, saving campaign costs on customers who are likely to return products purchased within these campaigns. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of each step from this use case in our Synerise Demo workspace. - [Source segmentation](https://app.synerise.com/analytics-v2/segmentations/77193186-ce52-499e-b490-e5d46653ad73) - [Target segmentation](https://app.synerise.com/analytics-v2/segmentations/18ded12e-5ffa-46de-a4a6-60e90beaf42a) - [Prediction](https://app.synerise.com/ai-v2/predictions/lookalike/tiaxsmgucdrg) Go to the Predictions tab, on the left menu select Lookalikes, and then paste the URL of [this prediction](https://app.synerise.com/ai-v2/predictions/lookalike/rugfywvfwijp). If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates 1 event per profile that completes the flow: [`snr.lookalike.score`](/docs/assets/events/event-reference/predictions#snrlookalikescore) (~1). ## Read more --- - [Email campaigns](/docs/campaign/e-mail) - [Predictions](/docs/ai-hub/predictions) - [Segmentation](/docs/analytics/segmentations) - [SMS campaigns](/docs/campaign/SMS) # Product Sets - Personalized Accessory Bundles with Ready-Made Template --- To enhance the shopping experience and increase the average order value, we can use product sets to recommend complementary accessories alongside a main product. With our ready-made template, setting up these sets becomes much easier. The template is based on a single recommendation campaign that allows you to configure multiple slots, each representing a different category of products. Each slot can be customized with specific settings, such as the number of displayed products, price ranges, colors, and other relevant attributes. This enables a highly personalized shopping experience, tailored to individual user preferences. This use case describes the process of implementing three accessory categories: glasses, plates, and vases, when a user visits the Glasses category. The recommendations will be dynamically adjusted based on the user’s behavior and preferences. Customers will have the flexibility to purchase the full set with a single click or manually select individual items from each category. This approach not only simplifies the decision-making process for customers but also drives higher engagement and conversions by presenting well-matched product combinations.
Product Sets Template
Product sets template
## Prerequisites --- - [Personalized model trained](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). - Color, brand and additional attributes in the product feed – as custom attributes - [Tracking code](/developers/web/installation-and-configuration#creating-a-tracking-code) on your website. - Implemented [OG tags](/developers/web/og-tags): - product:retailer_part_no which is the same as in the product feed - og:category which is also the same as in the product feed - We recommend that your website has the add to cart function that can be implemented in JavaScript, using the product IDs from the product feed.
This use case only explains how to create the campaign and adjust the template, and it is important to set up your e-commerce system to handle the "Add to Cart" button correctly for adding selected products or the entire set to the shopping cart. Additionally, the template allows you to apply a discount to the full set (either as a percentage or a fixed value), visible in the product set view. However, integrating this discount at checkout requires specific technical setup on your end, depending on your e-commerce system, and our template ensures the discount is accurately calculated and displayed.
## Process --- In this use case, you will go through the following steps: 1. [Preparation of AI recommendation](/use-cases/product_sets2#preparation-of-ai-recommendation). 2. [Preparation of dynamic content](/use-cases/product_sets2#preparation-of-dynamic-content). ## Preparation of AI recommendation --- 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. Enter the name of the recommendation (it is only visible on the list of recommendations). 3. In the **Type & items feed** section, click **Define**. 4. From the **Items Feed** dropdown list, select a product feed for which the model training is completed.
To use the selected item feed for a given recommendation type, the model that drives the recommendation type works must be trained using the selected item feed. If the recommendation type is not available yet for the recommendation type, you can check the model training status. To learn more about it, read the ["Model status"](/docs/settings/configuration/ai-engine-configuration/model-status) article.
5. Click **Select model** and on the pop-up, select **Personalized**.
AI Hub recommendation model Type and Items feed section with Personalized recommendation type selected for product sets
Configuraion of the catalog and recommendation type section
6. Confirm by clicking **Apply**. 7. In the **Items** section, click **Define**. 1. Define the minimum and the maximum number of products displayed in the slot according to your needs.
Learn more about the [recommendation settings](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#configure-item-slots).
2. In **Static filters**, set the following parameters: - `category` - and choose the category from which products should be presented. - additionally, you can use different filters based on your business needs. 3. Click **Add slot** and repeat steps b-d. In step d, select different category. 4. Confirm by clicking **Apply**. 8. Optionally, you can define the settings in the **Slots and items ordering**, **Boosting**, and **Additional settings** sections.
Learn more about [slots and items ordering](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#define-slot-and-item-ordering), [boosting](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#define-the-boosting-factors) and [additional settings](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#additional-settings)
9. Save the recommendation by clicking the **Save** button in the upper right corner. ## Preparation of dynamic content --- When you finish configuring your AI recommendation, it’s time to display the recommendation results (product sets) on the website. You can do it using our pre-defined template available on the [Demo Profile](https://app.synerise.com/campaigns/dynamic-content/content-manager/template/168756). The template is ready to use.
To fully use the recommendation, you must: - set up your e-commerce system to handle the add to cart actions and handle adding multiple items to the cart simultaneously - configure applying the discount on the checkout process. The template ensures only correct display and calculation of the discount.
1. Go to Experience Hub icon **Experience Hub > Dynamic content > Create new**. Choose **Insert** type of campaign. 2. Add meaningful name to your campaign. 3. In the **Audience** section, select the recipients of the dynamic content. 4. In the **Content** section, select **Create message**, then go to the Use Cases folder or just type the name of the template in the search box: **Product Sets**
Product Sets Template
Product sets template
5. In the **Config** tab: 1. In the **Product sku for preview field,** enter example product sku, that helps you see which products are displayed in the product set for this specific SKU. 2. In **Recommendation Id**, add the ID of [recommendation campaign](#preparation-of-ai-recommendation) created in the previous step. 3. If you want to give the user chance to add all the products together as a set, enable **Show add all products to cart button** . 4. If you want to apply discount, from the **Discount type** dropdown list, choose the discount type. The recommendation display reflects the item value after applying the promotion; however, the implementation of the discount during the checkout process is your responsibility. 4. In the upper right corner, click **Use in communication**. 5. Specify the CSS selector where you want to insert recommendations. 6. Click **Apply**. 7. In the **Schedule** section define the period when the dynamic content is active. 7. In **Display settings**, define the circumstances when the dynamic content will be triggered and the URLs on which it will be displayed. In this case, the dynamic content will be displayed on the URLs with the **Glasses** category. 8. In the upper right corner, click **Activate**. ## Check the use case set up on the Synerise Demo workspace --- In the Synerise Demo workspace, you can check: - [AI recommendation](https://app.synerise.com/ai-v2/recommendations/RKFGRSy1UV5k) - [Dynamic content campaign](https://app.synerise.com/campaigns/dynamic-content/create/b7ead34c-5450-4ba9-92f8-93847278cb18) - [Template](https://app.synerise.com/campaigns/dynamic-content/content-manager/template/168756) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 11 events per profile that completes the flow: [`page.visit`](/docs/assets/events/event-reference/web-and-app#pagevisit) (~1), [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~3), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1), [`product.addToCart`](/docs/assets/events/event-reference/items#productaddtocart) (~3). ## Read more Learn how to build [AI recommendations](/docs/ai-hub/recommendations-v2) # Boost High-Margin Products in Personalized Recommendations It's hard to disagree that the ultimate goal of business is to make a profit. To achieve specific profit margin targets, marketers need to create an effective plan to achieve these goals. One of the ways to increase profits is to recommend higher-margin items to customers than the average margin of items typically purchased by customers while personalizing the results of product recommendations. This approach can streamline sales efforts without involving high costs. ## Prerequisites --- - [Create items catalog](/docs/ai-hub/recommendations-v2/item-feed-requirements). The item catalog must include an attribute which will be used to denote (in this use case, it's the `margin` attribute, which contains the margin value for each product). - [Configure an item catalog for recommendations](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). Enable personalized recommendations. - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). When implementing transaction events, remember to add a `margin` parameter, which will contain the value of the margin on the sold product. ## Process --- 1. [Create an aggregate](/use-cases/boost-higher-margin-products#create-an-aggregate). 2. [Create recommendation](/use-cases/boost-higher-margin-products#create-a-recommendation). ## Create an aggregate --- In this part of the process, create an aggregate that returns the average margin value of the products bought by an individual customer. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Average**. 4. From the **Choose event** dropdown list, select the **product.buy** event. 5. As the event parameter, select **margin**. 6. Define the period from which data will be analyzed. 7. Save the aggregate.
Decision Hub Average aggregate returning the average margin value from product.buy events
Configuration of the aggregate
## Create a recommendation --- 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. In the top left corner, enter the name of your recommendation. 3. In the **Type & Items feed** section, click **Define**. 4. From the **Items feed** dropdown menu, choose the provided feed. 5. Choose the **Personalized** recommendation type.
AI Hub recommendation model Type and Items feed section with Personalized recommendation type selected
Configuraion of the catalog and recommendation type section
6. Click **Apply**. 7. In the **Items** section, click **Define**. 1. Click **Add slot**. 2. Define the minimum and maximum number of items that will be recommended to the user in each slot. 3. Confirm by clicking **Apply**. 8. In the **Boosting** section: 1. Click **Define**. 2. Click **Add rule**. 3. Click **Define rule** and select **Visual Builder**. **Result**: The Visual Builder window opens. 4. From the **Select attribute** dropdown list, select the **margin** attribute. You can use the search field. 5. From the **Operator** dropdown list, select **More than**. 6. Click the value type icon (Value icon) and choose **Aggregate**. 7. From the **Choose aggregate** dropdown list, select an aggregate created in [the previous step](/use-cases/boost-higher-margin-products#create-an-aggregate). The configured filter allows you to boost items with a margin higher than the one returned in the created aggregate. 8. Click **Apply**.
Boosting items with margins higher than the average margin of products purchased by the customer
Boosting items with margins higher than the average margin of products purchased by the customer
9. In the **Promote/Demote** selector, select **Promote** (default value). 10. Use the slider to adjust how much you want the rule to affect the results. 11. Save the **Boosting** section settings by clicking **Apply**. 12. Optionally, you can define the settings in the **Additional settings** section. 13. Save the recommendation. ## What's next --- You can display the recommendation to customers in several ways, for example by using the [recommendation insert](/developers/inserts/recommendations-v2) in [dynamic content](/docs/campaign/dynamiccontent/creating-dynamic-content) or in a mobile app using documents - [iOS SDK](/developers/mobile-sdk/displaying-recommendations/content-widget/ios), [Android SDK](/developers/mobile-sdk/displaying-recommendations/content-widget/android). If you decide to implement recommendations through dynamic content then you need to implement [Synerise JS SDK](/developers/web/installation-and-configuration) and [OG tags](/developers/web/og-tags) into your website. Alternatively, you can also implement campaigns through [API](https://hub.synerise.com/api-reference/ai-recommendations#operation/GetRecommendationsByCampaignV2). ## Check the use case set up on the Synerise Demo workspace --- You can also check the [aggregate](https://app.synerise.com/analytics/aggregates/f8a165a0-1deb-3ab8-8e20-9b1a520ebe72) and [AI recommendation](https://app.synerise.com/ai-v2/recommendations/Pk2EKr9IlyTw) configuration directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Creating aggregates](/docs/crm/aggregates/creating-profile-aggregates) - [Creating recommendations](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign) - [Filters in recommendations](/docs/ai-hub/recommendations-v2/recommendation-filters) - [Requirements for item feed](/docs/ai-hub/recommendations-v2/item-feed-requirements) # Email with last viewed products Encourage your customers to buy the products they have looked at and potentially found interesting. Sometimes what they need to finalize the transaction is a reminder of their previous activity. Use email communication to remind customers about their last-viewed product. If the customers entered the store and viewed many products from your offer but in the end, they did not buy any of them and they left the site, you can wait for the selected period of time (for example, 3 hours) and send an email with pictures of the products they viewed. Sending the email an hour after the customer closes the session, can encourage them to return. You can also include information about things like free delivery, information about the product. ## Example of use - Retail industry A client from the retail industry (fashion) sent a communication with last seen products to customers who were on the site but did not make a transaction. In this email they could find products that they have recently viewed.
Screenshot presenting email with last viewed products
Email with last viewed products
**Results** Results from email: - 3,18% CTR, - 29,44% CTOR. ## Prerequisites --- To be able to implement this use case, check out articles: - [Implement a tracking code](/docs/settings/tool/tracking_codes). - [Create a sender account](/docs/campaign/e-mail/configuring-email-account). ## Process --- Creating an email with last viewed products, perform the steps in the following order: 1. [Prepare an aggregate](/use-cases/last-viewed-products#prepare-an-aggregate). 2. [Prepare the email template](/use-cases/last-viewed-products#prepare-the-email-template). 3. [Configure automation](/use-cases/last-viewed-products#configure-automation). ## Prepare an aggregate --- Build an aggregate which collects the SKUs of recently viewed products. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 1. Set **Analyze profiles by** to **Last Multi**. 2. In the **Size** field, enter the number of recent events (for example, 10). 3. Select the **Consider only unique occurrence of the event parameter** option. 4. Select the event **page visit** and the aggregate - in this case it will be the product id, which is stored in the OG tag called **retailer_part_no**.
Screenshot presenting aggregate
Configuration of the aggregate
## Prepare the email template --- Prepare an email template and include the ID of the catalog that contains items and the ID of the aggregate you prepared in the previous step. Those two ID will let you display last seen products by an individual customer in the email. 1. Go to **Experience Hub** > **Email**. 2. Click the Email template icon icon. 3. To create a new template, click Create new. 4. To create a template out of an existing template, click From template. 5. Select the template. 6. Select the form of template, more information about create template you will find [here](/docs/campaign/e-mail/creating-email-templates): 1. **Drag&drop builder** - Create email templates with ready-made components. 2. **Code editor** - Create email templates in CSS and HTML.
**Snrs-product-ogTag** catalog is built in Synerise by default if you have og tags on product page. Depending what OG tags you have, you can collect information like product id, title, price, brand etc. in the catalog, every time somebody visits a product.
## Configure automation --- To start sending emails to customers you will have to prepare a workflow, which in basic configuration may look like the one below - let’s take a closer look at each node. 1. Start with the **Profile Event** trigger and in the settings of the node, select the **page.visit** event. 2. As the event parameter, select **retailer_part_no** - this way, the workflow starts only when a customer visits a product page.
Use "." in a regular expression to accept a valid value of this parameter (except for null). This way, you know that this event has the **retailer_part_no** parameter.
Screenshot presenting automation
Profile Event
3. Add **Delay** and define the lag between the page visit and sending the message, in our example it is 2 hours.
Screenshot presenting automation
Configuration of the Delay node
4. Using the **Profile Filter** node, exclude users who have made a transaction in the last 2 hours – it's important to use minutes instead of hours.
Screenshot presenting automation
Configuration of the Profile Filter node
5. Configure the **Send Email** node by selecting the appropriate email account, choosing the template that you prepared in the previous step.
Screenshot presenting automation
Configuration of the Send Email node
6. Prepare the final settings - Add **End** nodes where the workflow should finish for users. - Specify capping (here 1 for 1 day). - Optionally add titles to each node so the workflow will be more understandable to your colleagues. - Name the workflow and Save it or Save & Run.
Screenshot presenting automation
Workflow
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of use case in Synerise Demo workspace: - [Aggregate](https://app.synerise.com/analytics/aggregates/892528ec-12d5-3e7b-987f-f3e2f79ed349) - [Workflow configuration](https://app.synerise.com/automations/workflows/automation-diagram/24cab624-aaa3-4d5a-a60f-6b0c4e963920) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 9 events per profile that completes the flow: [`page.visit`](/docs/assets/events/event-reference/web-and-app#pagevisit) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1). ## Read more --- - [Creating aggregates](/docs/crm/aggregates/creating-profile-aggregates) - [Creating workflow](/docs/automation) - [Email templates](/docs/campaign/e-mail/creating-email-templates) # Send an email with promotions labeled with a specific tag This use case describes the process of sending promotions through the email channel. The email template contains a predefined HTML block with promotions which retrieves a Synerise promotion you indicate in the configuration of this block. The promotions can be easily adapted for different communication channels, but in this scenario, we will focus on email campaigns. Our target audience consists of active users who have made at least one purchase in the past year. The campaign will dynamically deliver the list of active promotions available for a specific user, presenting only offers with a specific tag. This approach is especially important when managing multiple active promotions from different areas but intending to send only those that are tagged with the `home` label within your campaign. With the power of dynamic HTML blocks, we can seamlessly integrate these promotions into the email templates, ensuring that each recipient receives relevant offers. ## Prerequisites --- - [Create an email account](/docs/campaign/e-mail/configuring-email-account). - [Import your product feed to catalog](/use-cases/import-product-feed-to-catalog). - Implement mobile pushes in your mobile application: [iOS](/developers/mobile-sdk/configuring-push-notifications/ios), [Android](/developers/mobile-sdk/configuring-push-notifications/android). - [Implement a tracking code](/docs/settings/tool/tracking_codes). - Implement the [transaction events](/developers/web/transactions-sdk) using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). ## Process --- In this use case, you will go through the following steps: 1. [Create promotions](/use-cases/promotions-in-email#create-promotions) with specific tag. 3. [Create a segmentation](/use-cases/promotions-in-email#create-a-segmentation) of customers who have made a transaction last year, this group will be the recipients of the email campaign. 4. [Create an email template](/use-cases/promotions-in-email#create-an-email-template). 5. [Create an email campaign](/use-cases/promotions-in-email#create-an-email-campaign). ## Create promotions --- In this part of the process, create a promotion (or more) which you will insert in the email template. You can create a promotion with the following scopes: - [For selected items](/docs/ai-hub/promotions/creating-promotions) - you can select items to which you want to apply a discount - [For entire basket](/docs/ai-hub/promotions/creating-promotions-for-entire-basket) - you can reduce the value of the whole shopping cart if its value matches the fixed price limit, Regardless of the selected promotion scope, in the configuration of the promotion, in the **Content** section, find the **Add tag** field and add a `home` tag.
Example of tag
Example of tag
## Create a segmentation --- In this part of the process, we will create a group of customers who have made a transaction during the last year. This group will serve as the recipients of an email campaign. It’s important to clarify that these customers will receive the email, rather than being the target audience for a promotion. Additionally, ensure that the conditions set for the Audience in the promotion do not conflict with those of the Audience for the email recipients, to avoid any discrepancies between the two groups. 1. Go to Decision Hub icon**Decision Hub > Segmentations > New segmentation**. 3. Enter the name of the segmentation. 4. Click **Add condition**. 4. From the dropdown list, select the `product.buy` event. 6. From the **Choose operator** dropdown, choose **Boolean**, and then select **Is true**. 7. Using the date picker in the lower-right corner, set the time range to **Relative time range > Last 365 days**. Confirm by clicking **Apply**. 6. Save the segmentation.
Decision Hub segmentation configuration filtering customers who made a purchase in the last 365 days
Segmentation configuration
## Create an email template --- To distribute the promotions, you need to prepare an email template that includes the promotion created in the previous step of the process. This step involves incorporating Jinjava code into the email template to fetch the details of the promotion labeled with the `home` tag for which an email recipient is eligible. The instructions for this step include the necessary code. 1. Go to **Experience Hub > Emails > Templates > Drag&drop builder**. 2. From the **Content** section, click **HTML BLOCKS** and add pull it to the chosen place in your template. 2. Click the **Configure** button. 3. Choose the **Predefined blocks** folder where you will find the **Promotions** block. 4. You must edit the template of the predefined block. It already contains a universal reference to a promotion, but we need to narrow down the promotion scope to those which are labeled with the **home** tag. The following changes must be added to the code of the block in the **HTML** section: - to `{% set fieldsVar = ["code", "params", "name", "status", "images", "params", "description", "headline"] %}`, add `, "tags"` - replace `{%- if count < noOfItems -%}` with `{%- if count < noOfItems && i.tags|selectattr("name", "equalto", "home")|length > 0 -%}` and if you're using other tag than home, replace `"home"` with the name of your tag
**Below, you can compare the code before and after changes:**
{% set fieldsVar = ["code", "params", "name", "status", "images", "params", "description", "headline", "tags"] %}
   {% promotions fields=fieldsVar %} 
   {% set count = 0 %} {%- for i in promotions_result -%}
   {%- if count < noOfItems && i.tags|selectattr("name", "equalto", "home")|length > 0 -%}
{% set fieldsVar = ["code", "params", "name", "status", "images", "params", "description", "headline"] %} 
   {% promotions fields=fieldsVar %} 
   {% set count = 0 %} {%- for i in promotions_result -%} {%- if count < noOfItems -%}
4. When you finish customizing the block, to use proceed to saving changes in templates, click **Next**. If you want to save the block for future use, click **Save as**, in **Block name**, enter the name of the block and in **Block folder**, select the folder in which your block will be saved. 5. Save the template by clicking **Save as**. 6. In **Template name**, enter the name of the template. 7. In **Template directory**, select the folder in which the template will be saved.
Screenshot presenting email template for anniversarie coupon
Prepare an email template
## Create an email campaign --- In this part of the process, you will create an email campaign with the list of the promotions available for the recipient. 1. Go to Experience Hub icon **Experience Hub > Email campaign > Create new**. 2. In the **Audience** section, choose the [segmentation created in the previous step](/use-cases/promotions-in-email#create-a-segmentation).
Please remember that the predefined HTML block with promotions works for a given customer only if they are in the audience of at least one promotion. If none of the selected promotions are available for the user, the email will not be sent.
4. To confirm you choice, click **Apply**. 3. Configure the **Content** section. 1. In **From email address*, select the email account from which you want to send your message. 2. In **From name**, enter the sender name that is displayed in the mailbox. 2. In the **Subject** field, enter your message subject. 2. Click **Create message** and choose an email template created in the [previous step](/use-cases/promotions-in-email#create-an-email-template). 3. Apply changes. 4. In the **Schedule** section, specify the time when you want to send your communication. 4. You can optionally define **UTM & URL parameters**. 4. Confirm by clicking **Apply**. ## Check the use case set up on the Synerise Demo workspace --- In the Synerise Demo workspace, you can check: - [segmentation](https://app.synerise.com/analytics-v2/segmentations/c39f2834-3f44-4f1d-96d8-0ed6fb272221) - [example promotion](https://app.synerise.com/campaigns/promotions/dad398ae-ca99-421f-88d3-e21dcdf83564) - [email campaign](https://app.synerise.com/campaigns/email/create/1dd5c37d-da50-42dc-a0aa-7eb48755bab6) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1). ## Read more --- - [Creating email templates](/docs/campaign/e-mail/creating-email-templates) - [Creating emails](/docs/campaign/e-mail/creating-email-campaigns) - [HTML blocks](/docs/campaign/e-mail/creating-email-templates/creating-custom-html-block-basic-builder) - [Promotions](/docs/ai-hub/promotions) - [Segmentation](/docs/analytics/segmentations) - [Workflows](/docs/automation). # Recommendations with items in customer's favorite color Color is one of those features that significantly affects the purchase decisions in the fashion industry, but should not limit the choice. You can recommend items which are similar to the currently viewed by a customer, but you can add a little twist to that by elastically filtering the items in the recommendation based on the favorite color of your customer. For further details read the instruction in this use case. ## Prerequisites --- - Enable the [similar recommendation model](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). - Supplement customer profiles with the favorite color attribute. ## Create a recommendation --- 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. Enter a meaningful name of the recommendation. 3. In the **Type & Items feed** section, click **Define**. 1. From the **Items feed** dropdown list, select the catalog that contains items for the recommendation. 2. As the type, select **Similar**. 3. Click **Apply**. 4. In the **Items** section, click **Define**. 5. Click **Add slot**. You can name the slot for later reference. 5. In the **Number of items** subsection, set the minimum and maximum number of items to `2`.
Setting the minimum and maximum number of items to the same number ensures that exactly this many items will appear in the slot.
6. Click **Elastic filter**.
Learn about the difference among [elastic, static filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#select-conditions-of-displaying-items), and [distinct filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#distinct-filter).
7. From the dropdown list, choose **Visual Builder**. 7. Click **Select attribute**. 7. From the dropdown list, choose the item color attribute. 8. Click **Operator**. 9. From the dropdown menu, choose **Equals**. 9. Click the Text value icon icon and keep clicking until you get the Select value icon option. 10. Click **Select value**. 11. From the dropdown list, choose the attribute that contains the customer's favorite color.
The final configuration of the filters
The final configuration of the filters
11. At the bottom of the elastic filter pop-up, click **Apply**. 12. In the **Items** section, click **Apply**. 1. In **Boosting**, you can enable [boosting](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#define-the-boosting-factors). 13. In **Additional settings**, optionally you can exclude already bought products and set a metric to sort by. 14. Save the recommendation by clicking **Save**. ## What's next --- You can display the recommendation to customers in a number of ways, for example by using the [recommendation insert](/developers/inserts/recommendations-v2) in [dynamic content](/docs/campaign/dynamiccontent/creating-dynamic-content). ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Creating recommendations](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign) - [Filters in recommendations](/docs/ai-hub/recommendations-v2/recommendation-filters) - [Requirements for item feed](/docs/ai-hub/recommendations-v2/item-feed-requirements) # Adding Gmail Promotions Annotation Gmail allows highlighting your messages in the “Promotions” tab with Gmail Promotions Annotation. Those annotations let you enhance the visibility of your emails and engage your recipients more effectively. With this feature, you can include a header, image, your company logo, the promotion's end date, and a variety of other details to make your emails stand out. This use case demonstrates how to integrate the Gmail Promotions Annotation feature into email communication sent from Synerise. It provides a predefined HTML insert, making it easier to customize the Promotions Annotation in the Config tab in the code editor.
Gmail Promotions Annotation
This feature is supported only for mailboxes associated with the gmail.com domain for individual users. This feature will work if the following conditions are met: - The recipient opens the message using the Gmail mobile app. - The message is delivered to the 'Promotions' tab. - Annotations will only appear for one-time emails; subsequent messages with the same subject will be grouped into a thread and may not display properly.
## Prerequisites --- - Configure a [sender account](/docs/campaign/e-mail/configuring-email-account). - The domain must have SPF, DKIM, and DMARC configured. - [Create an email etmplate](/docs/campaign/e-mail/creating-email-templates). ## Updating the template --- 1. Go to Experience Hub icon **Experience Hub > Email**. 2. On the left pane, click **Templates** and search for the template you prepared as a part of prerequisites. **Result:** You are redirected to the code editor. 3. In the code editor, go to the **HTML** section and in the head section after the `` tag, add the code below:
<!--[if mso ]><style>sup, sub { font-size: 100% !important; } sup { mso-text-raise:10% } sub { mso-text-raise:-10% }</style> <![endif]-->
           <!-- Start Gmail Promo Tab annotations code -->
           <div itemscope itemtype="http://schema.org/Organization">
               <meta itemprop="name" content="#### type: "string", groupName: "Promotion tag", groupId: "promotion-tag", defaultValue: "Synerise Demo Shop", id: "promotion-tag__company-name", label: "Company name" !####" />
               <meta itemprop="logo" content="#### type: "string", groupName: "Promotion tag", groupId: "promotion-tag", defaultValue: "https://demoshop.synerise.com/media/athlete2/Demos/ca/logo-ca.png", label: "Company image", id: "promotion-tag__img-link" !####" />
           </div>

           <div itemscope itemtype="http://schema.org/EmailMessage">
               <meta itemprop="subjectLine" content="#### type: "string", groupName: "Promotion tag", groupId: "promotion-tag", defaultValue: "Free shipping", label: "Subject line", id: "promotion-tag__subject-line" !####" />
           </div>

           <div itemscope itemtype="http://schema.org/DiscountOffer">
               <meta itemprop="description" content="#### type: "string", groupName: "Promotion tag", groupId: "promotion-tag", defaultValue: "Free shiping", label: "Description", id: "promotion-tag__description" !####" />
               <meta itemprop="discountCode" content="#### type: "string", groupName: "Promotion tag", groupId: "promotion-tag", id: "promotion-tag__code", label: "Code", defaultValue: "WELCOME20" !####" />
               <meta itemprop="availabilityStarts" content="#### type: "string", groupName: "Promotion tag", groupId: "promotion-tag", defaultValue: "2024-10-15T00:00:00+00:00", label: "Start date", id: "promotion-tag__start-date" !####" />
               <meta itemprop="availabilityEnds" content="#### type: "string", groupName: "Promotion tag", groupId: "promotion-tag", defaultValue: "2024-10-17T23:59:59+00:00", label: "End date", id: "promotion-tag__end-date" !####" />
           </div>

           <div itemscope itemtype="http://schema.org/PromotionCard">
               <meta itemprop="image" content="FILL BANNER IMG" />
           </div>
           <!-- End Gmail Promo Tab annotations code -->
This will add the following fields in the **Config** section:
The view of config form for adding Gmail Promotions Annotation
The config form for adding Gmail Promotions Annotation
### Edit the form in the Config tab The form in the Config tab is pre-filled with default values, which you can modify to suit your business needs. 1. In the **Company name** field, enter the name of your company. 2. In the **Company image** field, you can provide a link to an image. 3. In the **Subject line** field, you can type the subject you want to display. 4. In the **Description** field, you can type the text that displays with the deal badge. 5. In the **Code** field, you can type the discount or promotion code for the offer. 6. In the **Start date** field, you can type the date and time when the offer begins in [ISO 8601 format](https://support.google.com/merchants/answer/7055760). 7. In the **End date** field, you can type the end date and time of the promotion in [ISO 8601 format](https://support.google.com/merchants/answer/7055760). 8. If the template is ready, click **Save** in the upper right corner.
The view of the configured Gmail Promotions Annotation with corresponding fields from the config form
Configured Gmail Promotions Annotation with corresponding fields from the config form
## What's next --- Now you can use this template in emails you sent through the Experience Hub and Automation Hub. ## Check the use case set up on the Synerise Demo workspace --- You can check the [template configuration](https://app.synerise.com/campaigns/email/content-manager/template/153289) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1). ## Read more --- - [Email campaigns](/docs/campaign/e-mail) - [Google's Guide](https://developers.google.com/gmail/promotab/overview) to the Gmail Promotions Annotation function # Dynamic Content Scratch Card Interactive dynamic content formats can increase engagement and make promotional communication less intrusive. A scratch card mechanic adds a simple game-like interaction — users reveal an offer themselves, which often increases attention and memorability compared to static banners. In this use case, you’ll create a predefined dynamic content scratch card template displayed to users who visit a specific product category (for example, the Women category). After scratching the card, users reveal a promotion code that gives them 25% off products from that collection. The scratch card can be revealed with a finger or cursor, making the experience more interactive while still serving a clear promotional purpose. The template is predefined, so no coding is required — configuration happens through the template form and campaign settings.
Scratc
## Prerequisites --- - Create [item feed](/docs/ai-hub/recommendations-v2/item-feed-requirements) - Create a specific category filter in the product catalog to be reused while preparing the promotion.
Click here to see how to build the filter
  1. Go to Data Modeling Hub > Catalogs.

  2. On the list, find the catalog in which you want to create the filter.

  3. On the right side of the screen, click

    Clicking the filter icon

  4. Click Define.

  5. On the pop-up, define the conditions by clicking Choose filter. The list contains all parameters from the product feed. In our case category should contain WOMEN.

    The view of filter configuration for category
    Filter configuration for category
  6. Name and save the filter by clicking Save filter.

## Process --- In this use case, you will go through the following steps: 1. [Create a promotion](/use-cases/dc-scratch#create-a-promotion) with discount for specific category. 2. [Create a dynamic content campaign](/use-cases/dc-scratch#create-a-dynamic-content-campaign) with a scratch card. ## Create a promotion --- Create a promotion for a specific product category with a discount rate (for example, 25%). 1. Go to AI Hub icon **AI Hub > Regular promotions > Add promotion**. 2. Enter a name for the promotion. 3. Select the **For selected items** type of promotion. 4. In the **Audience** section, choose **Everyone**. 5. In the **Content** section: 1. Define the name, descriptions, thumbnail, and image of the promotion. 3. Optionally, you can add tags to the promotion and JSON code with additional promotion parameters. 2. Confirm the settings by clicking **Apply**.
The view of Content configuration
Content configuration
6. In the **Type and limits** section: 1. Leave **General** in the **Type section**. 1. In the **Type section** field, select **General** (default option). 2. In the **Priority**, enter a number that defines the priority of the promotion.
Priority defines the order of display in the customer’s view. 1 is the highest priority. If two or more promotions applicable to a customer have the same priority, the order of display is determined by the date of creation. The one that was created earlier takes the priority over the other promotion.
3. Select the **Single** tab (default choice). 4. In the **Limit per profile** field, type `1`. 5. From the **Discount type** dropdown list, select **Percentage**. 6. In **Discount mode**, leave the default option (**Static**). 7. In the **Value** field, type `25`. 8. Confirm the settings by clicking **Apply**.
AI Hub promotion Type and limits section with single 25% percentage discount limited to one per profile
Type and limits configuration
7. In the **Schedule** section: 1. In the **Display time** section, choose **Scheduled**. 2. Pick the dates in the **Start** and **End** fields. 3. In the **Activity time** section, deselect **Same as display time**. 4. Set a date range when the promotion can be activated. Pick the dates in the **Start** and **End** fields. 3. In the **Lasting** field, you can enter the time (in seconds) that a promotion remains redeemable after it is activated. `0` is interpreted as infinity. 4. Confirm the settings by clicking **Apply**. 8. In the **Items** section: 1. From the **Source catalog** dropdown list, select a catalog of items. 2. In the **Include items** section, choose **Filtered items**. 3. From the **Select filter** dropdown list, select [the filter created as a part of the prerequisites](#prerequisites). In our case, women category.
AI Hub promotion Items section showing filtered items from the women category
Type and limits configuration
9. To apply configuration and run the promotion, click **Publish**. ## Create a dynamic content campaign --- In this part of the process, you will create a dynamic content campaign with a scratch card, presented after the user visits the category **Women**. 1. Go to Experience Hub menu icon **Experience Hub > Dynamic Content > Create new** 2. Enter a meaningful name for the campaign. 3. Choose the **web layer** type of campaign. ### Define the audience --- 1. In the **Audience** section, click **Define**. 2. Select the **Everyone** tab. 3. Click **Apply**. ### Define content --- 1. In the **Content** section, click **Define**. 2. Click **Create message** and from the list of template folders, select **Predefined templates**. 3. Select **Scratch card**. **Result:** You are redirected to the code editor.
You can edit the template in two ways, by editing the code of the template ([add inserts](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-snippet-to-the-template-code), [add variables](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-variable)) and/or by filling out the form in the **Config** tab. In this use case, we will use the capabilities of the predefined **Config** tab.
#### Edit form in the Config tab --- The **Config** tab already has default values filled in. You can change them to fit your business needs.
In-app dynamic content Config tab settings for a scratch card campaign
Dynamic content configuration
1. In the **Content** section: 1. Fill out **Main Title**, **Subtitle**, **Scratch Surface Text**, and **Button Text** with specific description displayed on the scratch card. 2. Add also your personalized copy for **Copied Confirmation Text** and **Footer Text** where you can add info for example about the validation date. 2. In the **Prize** section: 1. In the **Discount Value** field, enter the value of the prize. 2. In **Prize Text**, add the copy which will be displayed as the description for the prize amount. 3. In **Promo Code**, enter the discount code displayed, created in the ["Create a promotion" part of the process](#create-a-promotion). 2. In the **Settings** section: 1. Set up the **Scratch Threshold** (in percentage) - what percentage of the card's surface does the customer need to scratch off to see its value. 2. Set up the **Brush Size** - in pixels. 5. In the **Colors** section, define your color scheme. 9. If the template is ready, in the upper right corner, click **Save this template > Save as**. 10. On the pop-up: 1. In the **Template name** field, enter the name of the template. 2. From the **Template folder** dropdown list, select the folder where the template will be saved. 3. Confirm by clicking **Apply**. 11. Click **Next** to continue the process of configuring the in-app campaign. 12. Click **Apply** to save your content changes. ### Schedule the message and configure display settings --- As the final part of the process, you need to set the schedule. 1. In the **Schedule** section, click **Define** and set the time when the campaign will be active. 3. Click **Apply**. 2. In the **Display Settings** section, click **Define**. If you want the countdown bar to be displayed to all users continuously across the website upon landing, keep the default settings. 3. Click **Apply**. ### Set up the display settings 1. In the **Display settings** section, define the circumstances the dynamic content will be shown: - **Always on landing**. - **On a specific URL** which indicates a product page (for example, if a URL contains product). 4. Optionally, you can define the UTM parameters and additional parameters for your dynamic content campaign. 5. Click **Activate**. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of the campaign components directly in Synerise Demo workspace: - [promotion configuration](https://app.synerise.com/campaigns/promotions/9d67af84-ab72-4b3b-ad07-e349af9d1382), - [Dynamic content](https://app.synerise.com/campaigns/dynamic-content/create/d5193acb-db56-45f8-b8e7-2b95ddd6da5d) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1), [`client.activatePromotion`](/docs/assets/events/event-reference/loyalty#clientactivatepromotion) (~1). ## Read more --- - [Dynamic content](/docs/campaign/dynamiccontent) - [Promotions](/docs/ai-hub/promotions) # Recommendation with last seen items When providing product recommendations on the page displaying the cart summary or during the checkout process, it’s essential to avoid suggesting items the customer has just added to their cart — otherwise, the experience can feel redundant and irrelevant. In this use case, we build a recommendation that suggests from 1 to 10 products based on **last seen activity**, while using a **static filter to exclude the last 20 items added to the cart**. This setup ensures that: - The recommendation is grounded in the shopper’s actual behavior (last seen), - Redundancy is avoided by excluding what was just added to cart, - The experience feels intentional and clean, encouraging further discovery.
You can further enhance the experience by using item context (e.g. showing products in the same style, size, or color as those already viewed) — all directly supported through product feed attributes.
## Prerequisites --- - Implement a [tracking code](/developers/web/installation-and-configuration) into your website. - [Configure AI engine](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). Enable last seen recommendation model. - Implement the [transaction events](/developers/web/transactions-sdk) using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). ## Process --- In this use case, you will go through the following steps: 1. [Create an aggregate returning IDs of the 10 last seen products](#create-an-aggregate-returning-last-seen-products). 2. [Create an aggregate returning SKUs of the last 20 products added to cart](#create-an-aggregate-returning-last-20-products-added-to-cart). 3. [Prepare an AI recommendation](#prepare-an-ai-recommendation) which excludes recently bought and items which are currently in the cart. ## Create an aggregate returning last seen products --- In this part of the process, create an aggregate that returns the ID of the last 10 products a customer had visited. The recently viewed product itself will not display in the template, but will serve as a context for recommendations. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last Multi**. In **Size**, enter `10`. You can also add more results. 4. From the **Choose event** dropdown list, select the **Visited page** event. 5. As the event parameter, select **product:retailer_part_no**. 6. Click the **+ where** button. 7. From the **Choose parameter** dropdown list, select the **product:retailer_part_no** parameter. 8. From the **Choose operator** dropdown list, select **Is true (Boolean)**. 9. Using the date picker in the lower-right corner, set the time range to **Last 7 days**. Confirm your choice with the **Apply** button. 7. Click **Save**.
Decision Hub Last Multi aggregate returning the product IDs of the last 10 visited pages in the past 7 days
Configuration of the aggregate returning the IDs of the last seen products
## Create an aggregate returning last 20 products added to cart --- In this part of the process, create an aggregate returning SKUs of the last 20 products added to cart in the last 30 days. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last Multi**. In **Size**, enter `20`. You can also add more results. 4. From the **Choose event** dropdown list, select the **product.addToCart** event. 5. As the event parameter, select **$sku**. 9. Using the date picker in the lower-right corner, set the time range to **Last 30 days**. Confirm your choice with the **Apply** button. 7. Click **Save**.
Decision Hub Last Multi aggregate returning the SKUs of the last 20 products added to cart in the past 30 days
Configuration of the aggregate returning the SKUs of the last 20 items added to cart
## Prepare an AI recommendation --- In this part of the process, you will configure Last Seen AI Recommendations which excludes 10 recently visited items and last 20 products that have been added to cart. This will ensure that we do not recommend products that a customer has most recently interacted with. 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. Enter the name of the recommendation (it is only visible on the list of recommendations). 3. In the **Type & Items Feed** section, click **Define**. 4. From the **Items Feed** dropdown list, select an item feed. 5. In the **Type** section, choose the **Last seen** recommendation type. 6. Confirm the settings by clicking **Apply**. 7. In the **Items** section, click **Define**. 2. Define the minimum and maximum number of items that will be recommended to the customer in each slot. 3. Define [Static filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#static-filters) and [Elastic filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#elastic-filters). 4. In our case, in the **Static filter** section, click **Define filter**. 5. Select **Visual Builder**. 6. Click **Select value**. 5. Choose **itemId**. 6. As an operator, choose **Not in**. 7. Click the icon which appeared next to the field with operator and from the dropdown list, select **Aggregate**. 8. From the list, choose the [aggregate, with 20 products added to the cart, created in the previous step](#create-an-aggregate-returning-last-20-products-added-to-cart). 4. Confirm by clicking **Apply**.
AI Hub recommendation static filter excluding the last 20 products added to cart using the cart SKU aggregate
Configuration of the static filter
4. In the **Elastic filter** section, click **Define filter**. 5. Select **Visual Builder**. 6. Click **Select value**. 5. Choose **itemId**. 6. As an operator, choose **In**. 7. Click the icon which appeared next to the field with operator and from the dropdown list, select **Aggregate**. 8. From the list, choose the [aggregate, with last seen products, created in the previous step](#create-an-aggregate-returning-last-seen-products). 4. Confirm by clicking **Apply**.
AI Hub recommendation elastic filter including only last seen product IDs using the last viewed product aggregate
Configuration of the elastic filter
8. Additionally define the boosting rules by clicking **Define** in the **Boosting** section. 9. In the **Additional settings** section, choose **Exclude already bought products**. If your company sells replenishable products, you can set exclusion for specific number of days, for example, exclude products bought not later than 30 days ago. 9. In the right upper corner, click **Save**. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of each step directly in our Synerise Demo workspace: - [Aggregate returning last seen products](https://app.synerise.com/analytics/aggregates/1162c599-338f-32f7-ba20-b1bb64fcaed0) - [Aggregate returning last 20 products added to cart](https://app.synerise.com/analytics-v2/aggregates/72e0076e-8076-38a5-8bc1-29c3aa9c8013) - [AI Recommendation](https://app.synerise.com/ai-v2/recommendations/nNL1ec4aj19V) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Recommendations](/docs/ai-hub/recommendations-v2) # Offer Installment Payments with Dynamic Price Calculation Many e-commerce stores offer their customers installment purchases. This is especially helpful in case of expensive products. It is very important to have this mechanism under control and be able to manage it effectively and dynamically calculate the installments and prices displayed on the site. We created a dedicated mechanism for one of our clients which helps to do it effectively and be sure that errors are replaced with the proper element of dynamic content. This case shows our flexibility and approach to managing many different problems that occur on the website. ## Example of use - Retail Industry **Challenge** It all started when a customer came to us with a pricing problem. They had displayed the offer in the wrong way in the product pages with 0% installments. **Solution** We helped with this problem by covering the prices with our dynamic content. Knowing the actual price of the products from their product feed, we used jinjava to automatically calculate the amount of the installment that should be displayed on product pages. All we needed to know was the amount of installments per a certain product. Then we prepared a separate catalog in which we put the information about how many installments a certain product had. ![Screenshot presenting installments](/api/docs/image/f8a57079df9dd82ae8b22dc747691385d7d51d29/use-cases/all-cases/_gfx/installments.png) ## Prerequisites --- **General** - [OG:tags](/developers/web/og-tags) implemented (especially retailer part number). - [Product feed](/use-cases/import-product-feed-to-catalog) with actual product prices. - Data about the number of installments we can implement to the catalog. ## How to do it --- ### Create catalogs --- 1. This mechanism is based on our catalogs so we have to create two of them. First of all, we need to know the actual prices of products and place it in the product feed. We need to import those prices to the product catalog. You can do it using a shovel and proper mapping. It’s best if you create a dynamic import that works once an hour (e.g.), because prices change constantly. ![Screenshot presenting installments](/api/docs/image/f8a57079df9dd82ae8b22dc747691385d7d51d29/use-cases/all-cases/_gfx/catalogs.png) 2. We need to have information about how many installments are for a certain product. You should create the catalogue and add the ID of the product in the first column and the number of installments in the second. ### Create a dynamic content --- Create dynamic content based on those two catalogues which counts the values of both of them and the actual number of installments. Remember to have OG:TAG product retailer part number implemented on the website. Thanks to this we can recognize which product the user is viewing at the moment. So the mechanism takes this retailer part number and we then search for it in both catalogs and then we can see that, for example, this product has 6 installments, we take the price of this product from the catalog and we are divide it by the amount of installments and present the results on the product page.
Our dynamic content campaign can not only add something but also alter some content on the website. So, with the proper selector and inner position (in the Content TAB in campaign creator) we can receive this effect. This is especially useful in cases when prices on our customers’ websites were incorrect.
Such cases can show our flexibility and ability to manage the problems of our clients with simple solutions. ## Generated events This use case generates 1 event per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1). ## Read more --- - [Adding Product feed](/developers/product-feed) - [Catalogs](/docs/assets/catalogs) - [Dynamic content campaigns](/docs/campaign/dynamiccontent) # Discount for entire basket Increasing average order value is one of the most important KPI's in commerce activities. Promotion for entire basket with minumum cart value can trigger a boost in spending across whole loyalty base. While creating such a promotion, additional assumptions need to be taken into consideration: - A discount should be granted only when a transaction value exceeds the minimum amount in order to incentivize a customer to increase their basket size. - The value of certain items (like alcohol or cigarretes) should not be included in basket value while calculating minimum threshold (for legal purposes). In this use case, we will create a basket promotion with 10% discount on all items (except for alcohol products) with 25$ minimum basket value trigger.
Basket promotion
Basket promotion
## Prerequisites --- - Point of sales must be integrated with Synerise promotion engine to calculate discounted values of basket items. - Product feed must be uploaded to catalog. ## Security configuration --- Before you start working with this hub, if you are a Synerise customer or partner, consider reading [the section about denylisting events](/docs/settings/tool/api#denylist). This natively accessible configuration will allow you to manage the restrictions in points management that may help you prevent fraud. ## Process --- In this use case, you will go through the following steps: 1. [Create a list of excluded items](/use-cases/promotion-for-entire-basket#create-a-list-of-excluded-items). 2. [Create a promotion](/use-cases/promotion-for-entire-basket#create-a-promotion). ## Create a list of excluded items --- In order to exclude forbidden items from calculating basket value, you need to create a filter in a product catalog, which will contain all items you would like to exclude from this promotion. 1. Go to **Assets > Catalogs** and find your product catalog. 2. Click the Filter icon icon. 3. Click **Define**. 4. Enter the name of the filter and define the conditions of the filters as presented in the image below:
Setting up product filters
Setting up product filters
The filter will be automatically updated once you add new products to the catalog.
## Create a promotion --- Once you've defined filter with alcohol products, create a promotion for entire basket. 1. Go to AI Hub icon **AI Hub > Regular Promotions > Add promotion**. 2. Select the **For entire cart** option. 3. In the **Audience** section, select a group of customers for whom the promotion will be activated. Confirm your selection, by clicking **Apply**. 4. In the **Content** section, define the name, description, and an image of the promotion. Confirm the settings by clicking **Apply**. 5. In **Type & limits** section: 1. As a Discount type, choose **Percentage**. 2. In the Cart section, as the minimum value, enter `25`. 6. In the **Schedule** section, define the distribution period. 7. In **Exclude items** section choose previously created filter from the dropdown in **Filtered items** section. 8. To apply all changes and run the promotion, click **Publish**. Once the promotion is published, it will be visible immediately to all customers defined in thw **Audience** section in every distribution channel.
Excluding products from promotion
Excluding products from promotion
Each item in the basket will be discounted by amount you defined as **Value** in **Type & limits** section. This does not apply to items which have been selected in **Exlude items** section - their price will not be changed.
## Check the use case set up on the Synerise Demo workspace --- Check the promotion settings in Synerise Demo workspace at this [link](https://app.synerise.com/campaigns/promotions/a0c5024e-a657-47bb-99a3-657e8fb38576). If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 4 events per profile that completes the flow: [`client.activatePromotion`](/docs/assets/events/event-reference/loyalty#clientactivatepromotion) (~1), [`transaction.charge`](/docs/assets/events/event-reference/items#transactioncharge) (~1), [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~2). ## Read more --- - [Promotions](/docs/ai-hub/promotions) # Analyze customer’s preferred item category You can use expressions to examine the most frequently visited category of items for every customer. This expression can be used later in an analytical dashboard to monitor the results for the expression. ## Prerequisites --- - Implement [tracking code](/developers/web/installation-and-configuration#creating-a-tracking-code) on your website. ## Process --- In this use case, you will go through the following steps: 1. [Create aggregates](/use-cases/most-visited-category#create-aggregates) that count the number of page visits of items in two specific categories - each aggregate calculates page visits to one category. 2. [Create an expression](/use-cases/most-visited-category#create-an-expression) that returns values: `women`, `men`, and `unknown` depending on the number of page visits in the categories selected in the aggregates. 3. [Create an analytical dashboard](/use-cases/most-visited-category#create-an-analytical-dashboard). ## Create aggregates --- In this part of the process, create two aggregates that count the number of page visits of items in two specific categories - each aggregate calculates page visits to one category. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Set **Analyze profiles by** to **Count**. 3. Click **Choose event**. 4. From the dropdown list, select **page.visit**. 5. Click **+ where**. 6. Find the **category** parameter. 7. From the logical operator dropdown list, select **Equal**. 8. In the text field, enter `women`.
Modify this name of the parameter according to the actual values of the category parameter you send to Synerise.
9. As the time range, select **Lifetime**. 10. Click **Save**.
The construction of the first aggregate
The construction of the first aggregate
11. Repeat steps from 1 to 11. In step 8, replace `women` with `men`.
The construction of the second aggregate
The construction of the second aggregate
## Create an expression --- In this part of the process, create an expression that returns values: `women`, `men`, and `unknown` depending on the number of page visits in the categories selected in the aggregates.
Expression that returns the most frequently visited item category
1. Go to **Behavioral Data Hub > Expressions > New expression**. 2. Enter the name of the expression. 2. Leave the selection of the **Expression for** option at default (**Attribute**). 3. Create the following formula:
The construction of the expression
The construction of the expression
Explanation of the expression logic

The expression creates the following logic:

  • If the number of page visits in the `women` category is higher, return `women`.
  • If the above condition is not met:
    • If the number of page visits in the `men` category is higher, return `men`.
    • If the above condition is not met, return `unknown`.
4. To complete the expression, click **Save**. 5. To check the result of the expression for individual customers, click the **Preview tab**. In the search box, enter the email of a customer. ## Create an analytical dashboard --- You can add this expression to the analytical dashboard and monitor the result of the expression for individual customers. 1. Go to **Decision Hub > Dashboards > New dashboard**. 2. Click the Expression icon icon on the dashboard. 2. Double-click the expression added to the dashboard. 3. On the right side, from the dropdown list, select the expression you created. 5. Click the Dynamic key icon icon. 6. Enter the ID of a customer. 7. Click **Apply**.
The result of the expression in the analytical dashboard for an example customer
The result of the expression in the analytical dashboard for an example customer
## Check the use case set up on the Synerise Demo workspace --- Check the configuration of analyses created in this expressions on Synerise Demo workspace: - [Aggregate that returns the number of page visits to women's category](https://app.synerise.com/analytics/aggregates/150a51cd-c175-3b33-94cb-c2e778330576). - [Aggregate that returns the number of page visits to men's category](https://app.synerise.com/analytics/aggregates/f23889e9-b915-3c40-b97f-2662660d9c0a). - [Expression that returns preferred item category](https://app.synerise.com/analytics/expressions/a9f8f10b-f25c-4ecd-88cf-96e2068dc6e3). - [Analytical dashboard that uses the expression](https://app.synerise.com/analytics/dashboards/839d3cea-4da9-4927-b343-be1cc59df31b?clientId=11111111111). If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case does not generate any events. ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Expressions](/docs/crm/expressions) # In-app message with a reminder about a promo code In-app messages are another efficient way to reach your customers in the mobile app. By providing targeted and relevant messages to users who are actively using your app, in-app messages can assist you in retaining their attention. They can be used, for example, to remind your customers they have a promo code they can use for their cart. This use case describes the process of creating a reminder that a customer received a promo code and sending it through an in-app message. In this case, we assume that the promo code was sent by an email and the customer hasn't redeemed it yet. In this use case we provide you with a ready-made campaign code that can be used 1:1 in a business scenario.
The view of an in-app message in the mobile application
## Prerequisites --- - [Implement Synerise SDK in your mobile app](/developers/mobile-sdk). - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction).
Transactions that were made using a promo code must have an additional parameter that will store the code content. In this case, `coupon`.
- [Send an email campaign](/docs/campaign/e-mail/creating-email-campaigns) with a promo code to customers.
It can be any channel, in this use case we assume that the voucher was sent by an email. [Learn more about Experience Hub in Synerise](/docs/campaign).
Optionally, you can implement [coupons](/docs/assets/code-pools) which you can import and add to your email template as an [insert](/developers/inserts/insert-usage#code-pools).
## Create an in-app message --- 1. Go to Experience Hub icon **Experience Hub > In-app messages> Create in-app**. 2. Enter the name of the in-app. ### Define the audience --- As the first step, define the target group of customers for the in-app message. In this case, the group will consist of the customers who received an email with a promo code and didn't redeem it in the last 30 days. 1. In the **Audience** section, click **Define**. 4. Click **New Audience** and then **Define conditions**. 5. Click **Add condition**, from the dropdown list, select the `message.send` event. 2. Click the **+ and where** button and select `id` as the parameter. 4. As an operator, choose **Equal** and enter the ID of the email campaign that was sent to customers as a part of [prerequisites](#prerequisites). 6. Click **and then...**. **Result**: A dropdown menu and an input field appear below. 7. From the dropdown, select `transaction.charge` event. 8. Click the **+ and where** button and select a parameter assosciated with promo codes. In this case, `coupon`. 10. As an operator, choose **Regular expression** and in the text field, enter `.`. 11. Change **Performed** to **Not performed**. 12. Click **Add condition**, and from the dropdown list, select the `message.send` event. 2. Click the **+ and where** button and select `id` as the parameter. 4. As an operator, choose **Equal** and enter the ID of the email campaign that was sent to customers as a part of [prerequisites](#prerequisites).
This way the audience will exclude customers who made the transactions using the promo codes. To include purchases from a specific campaign with codes, you can use a fixed prefix or suffix for every promo code.
6. In the calendar in the right bottom of the page, define the period from which the segmentation will return the customers. In this case, last 30 days. 7. Click **Apply**.
The view of In app campaign configuration
In app campaign configuration
8. To save the audience, click **Apply**. ### Define content --- In this part of the process, you will create the content of the in-app message that will appear in the mobile application. 1. In the **Content** section, click **Define**. 2. Click **Create Message** and select **Code Editor** to create the code for your in-app message. 3. Style the message according to your design assumptions by using the HTML, CSS, and JS sections. Below you can find an example of the code that you can use to create in-app message.
HTML
<div class="in-app-wrapper"> <div class="in-app-wrapper-inner"> <div class="in-app__upper"> <div class="in-app-close"></div> <p class="in-app-title"> Hello {% customer firstname %}</p> <p class="in-app__upper--text">We've sent you an email with the promo code.</strong></p> </div> <div class="in-app__lower"> <p class="in-app__lower--text changeDate">20% discount!</p> <p class="in-app__lower--text--second">You haven't used it yet,</br>maybe you can redeem it now?</p> </div> </div> </div>
CSS
.in-app-wrapper * { font-family: sans-serif; } .in-app-wrapper { text-align: center; position: relative; background: #00000045; box-shadow: 0 30px 80px 0 rgba(35, 41, 54, 0.2); width: auto; height: 100vh; display: flex; flex-direction: column; flex-wrap: nowrap; align-content: center; justify-content: center; align-items: center; } .in-app-title { font-size: 20px; font-weight: normal; font-stretch: normal; font-style: normal; line-height: 1.5; letter-spacing: -0.67px; text-align: center; color: white; margin: 0; padding-top: 20px; } .in-app-subtitle { font-size: 16px; font-weight: normal; font-stretch: normal; font-style: normal; line-height: 1.43; letter-spacing: -0.47px; text-align: center; color: #13171e; } .in-app-close { position: absolute; z-index: 1; width: 50px; height: 50px; border: 0; top: 10px; right: 10px; cursor: pointer; background-color: transparent; } .in-app-close:after, .in-app-close:before { content: ''; position: absolute; height: 2px; width: 50%; top: 50%; left: 12px; margin-top: -1px; background: white; } .in-app-close:after { -webkit-transform: rotate(-45deg); -moz-transform: rotate(-45deg); -ms-transform: rotate(-45deg); -o-transform: rotate(-45deg); transform: rotate(-45deg); height: 2px; margin-top: -2px; } .in-app-close:before { -webkit-transform: rotate(45deg); -moz-transform: rotate(45deg); -ms-transform: rotate(45deg); -o-transform: rotate(45deg); transform: rotate(45deg); height: 2px; margin-top: -2px; } .in-app-wrapper-inner { background: #fff; border-radius: 6px; position: relative; border-radius: 20px; margin-left: 20px; margin-right: 20px; width: 300px; } .in-app__upper { background-color: #0b68ff; border-radius: 4% 4% 50% 50% / 4% 4% 15% 15%; height: 170px; } .in-app__lower { height: 200px; } .in-app__upper--text { font-size: 20px; color: white; word-spacing: 2px; } .in-app__lower--text { font-size: 17px; color: black; padding-top:20px; } .in-app__lower--text--second{ font-size: 17px; color: black; margin-top:50px; }
JS
(function () { var closeButton = document.querySelector(".in-app-close"); closeButton.addEventListener("click", function () { SRInApp.close(); SRInApp.trackCustomEvent( "inapp.custom", { action: "close", }, "Custom event from In-App message" ); }); var modalBackground = document.querySelector(".in-app-wrapper"); modalBackground.addEventListener("click", function (event) { if (event.target.getAttribute("class") == "in-app-wrapper") { SRInApp.close(); SRInApp.trackCustomEvent( "inapp.custom", { action: "click outside modal", }, "Custom event from In-App message" ); } }); })();
4. Click **Next**. 5. Click **Apply**. ### Select events that trigger the in-app message display --- In this part of the process, you will define the event triggering the display of the in-app message. 1. In the **Trigger events** section, click **Define**. 2. Select **Add event** and from the dropdown list, choose `session.start` event. 3. Click the **+ and where** button and select `mobile`. 4. As the logical operator, select **Is true**. 5. Click **Apply**.
The view of In app trigger event configuration
In app trigger event configuration
### Schedule the message and configure display settings --- As the final part of the process, you will set the display settings of the in-app message such as schedule, capping, priority of the message among other in-app messages. 1. In the **Schedule** section, click **Define** and set the time when the message will be active. 2. In the **Display Settings** click **Change**. 3. Define the **Delay display**, **Priority index** and enable the **Frequency limit** toggle to manage the frequency of in-app message display in the application. In our case, we want to display the massage to the customer a maximum of 1 time in period of 7 days.
You can additionaly enable the **Capping limit** toggle to limit the amount of time the in-app message can be displayed to a user in general.
16. Click **Apply**.
The view of In app schedule and display configuration
In app schedule and display configuration
17. Optionally, you can define the **UTM parameters** and **Additional parameters** for your in-app campaign. 18. Click **Activate**. ## Check the use case set up on the Synerise Demo workspace --- You can check the [In-app message configuration](https://app.synerise.com/communications/in-app/502bf3a3-827a-4c93-828d-1f8d58ffc25a) directly in the Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 4 events per profile that completes the flow: [`session.start`](/docs/assets/events/event-reference/web-and-app#sessionstart) (~1), [`inApp.show`](/docs/assets/events/event-reference/inapp#inappshow) (~1), [`inApp.click`](/docs/assets/events/event-reference/inapp#inappclick) (~1), `inapp.custom` (~1). ## Read more --- - [Email campaigns](/docs/campaign/e-mail) - [In-app messages](/docs/campaign/in-app-messages) - [Jinjava inserts](/developers/inserts) # In-app survey Understanding user preferences from the start is essential for creating a personalized app experience. A well-timed in-app survey after a user's first visit can capture valuable insights into their interests, expectations, and reasons for downloading the app. This direct engagement helps businesses tailor their offerings, improve user satisfaction, and foster long-term engagement. In this specific use case, we plan to introduce a first-time user survey triggered after the app's introductory tour. This use case provides instructions on how to implement a ready-made survey template designed to gather key user insights and enhance the overall experience. ## Prerequisites --- - [Implement Synerise SDK in your mobile app](/developers/mobile-sdk). - Implement a dedicated custom event that is sent to the customer's profile when they first enter the mobile app. This event should be sent only one time, during the first visit to the mobile application. In this use case, we use the `app.firstVisit` event. ## Create an in-app message --- Create an in-app campaign triggered by the `app.firstVisit` event for customers who logged into the mobile application for the first time. We will use a predefined template for this message, so there is no need to create a template from scratch. 1. Go to Experience Hub icon **Experience Hub > In-app messages> Create in-app**. 2. Enter the name of the in-app. ### Define the audience --- As the first step, define the target group of customers for the in-app message. In this use case, segmentation based on the [`inApp.show` event](/docs/assets/events/event-reference/inapp#inappshow) acts as an additional security measure that helps to include only people who have never seen this in-app message before.
The accuracy of this segmentation depends on the retention set for the **inApp.show** event.
1. In the **Audience** section, click **Define**. 2. Click **New Audience** and then **Define conditions**. 3. Click **Add condition**, from the dropdown list, select the **inApp.show** event. 4. Next to the **inApp.show**, click **+where**. 5. From the dropdown list, select **id**. 6. As the operator, choose **Equal**. 7. Enter the In-app campaign ID in the text field. You can locate the ID in the campaign's URL link. For instance, in the URL https://app.synerise.com/communications/in-app/d7c03448-a586-4f18-ad9b-cff063c65aef the ID is `d7c03448-a586-4f18-ad9b-cff063c65aef`. 8. Change **matching** condition to **not matching** to find all profiles that don't meet the defined condition. 9. Use the time filter to define analysed time period. 10. Click **Apply**. 11. To save the audience, click **Apply**.
Audience configuration
Audience configuration
### Define content --- In the next step, you will create the content of the in-app message that will appear in the mobile application with the help of ready-made template. 1. In the **Content** section, click **Define**. 2. Click **Create message** and from the list of template folders, select **Predefined templates**. 3. Select the **Survey form** template. **Result:** You are redirected to the code editor. 4. Edit the template according to your needs. In the Configuration panel, you'll find a comprehensive list with descriptions of the core components that make up your survey.
Config panel
Config panel
The configuration of the questions and answers themselves happens in JavaScript panel. There is an object that you have to fill, according to the example given. It is an array of questions, where each question has its answers and settings depending on the type.
Javascript object with questions and answers
Javascript object with questions and answers
**Example:** You want to add/edit question To add an additional question to the **QUESTIONS** array, you'll want to follow the pattern established by the existing questions. Each question is an object that may contain different properties depending on its type (single, multi, scale, text). Here's a step-by-step guide on how to do it: Decide on the question you want to add and the type of question it will be. The type determines what properties the question object should have. For instance: - `single` and `multi` types need question, `answers`, and `type`. - `scale` needs `question`, `type`, and `length`. - `text` needs `question`, `type`, and optionally `limit` for the character limit. Construct the question object according to the type you've chosen. Add the new question object to the `QUESTIONS` array. Here's an example of how you can add a new question that asks about a favorite color (a single type question with predefined answers):
const QUESTIONS = [
              {
                  "type": "single",
                  "question": "What motivated you to download our app?",
                  "answers": [
                      "To browse products",
                      "To make a purchase",
                      "To explore exclusive offers",
                      "To compare prices",
                      { "answer": "Other (please specify):", "options": { "isOpen": true, "limit": 20 } },
                  ],
                  "shuffleAnswers": false,
                  "required": true
              },
              {
                  "type": "multi",
                  "question": "What types of products or services are you most interested in?",
                  "answers": [
                      "Fashion",
                      "Electronics",
                      "Home and Kitchen",
                      "Health and Beauty",
                      "Sports and Outdoors",
                      { "answer": "Other (please specify):", "options": { "isOpen": true, "limit": 20 } }
                  ],
                  "shuffleAnswers": false,
                  "required": true
              },
              {
                  "type": "single",
                  "question": "How do you prefer to shop?",
                  "answers": [
                  "I like to browse and explore new products",
                  "I prefer targeted recommendations based on my preferences",
                  "I usually know what I want and search directly",
                  "I’m mainly looking for deals and offers",
                  ],
                  "shuffleAnswers": false,
                  "required": true
              },
              {
                  "type": "multi",
                  "question": "What factors influence your purchasing decisions the most?",
                  "answers": [
                  "Product quality",
                  "Price",
                  "Brand reputation",
                  "Customer reviews",
                  "Sustainability",
                  { "answer": "Other (please specify):", "options": { "isOpen": true, "limit": 20 } }
                  ],
                  "shuffleAnswers": false,
                  "required": true
              },
              {
                  "type": "scale",
                  "question": "How likely would you recommend our company to your friends and known ones?",
                  "length": 10,
                  "required": true,
              },
          ];
5. After customising your survey, save the template. ### Select events that trigger the in-app message display --- In this part of the process, you will define the event triggering the display of the in-app message. 1. In the **Trigger events** section, click **Define**. 2. Select **Add event...** and from the dropdown list, choose `app.firstVisit` event. 3. Click the **+ where** button and select `source`. 4. As the logical operator, select **Equal**. 5. In the text field enter **MOBILE_APP**. 5. Click **Apply**. ### Schedule the message and configure display settings --- As the final part of the process, you will set the display settings of the in-app message such as schedule, capping, priority of the message among other in-app messages. 1. In the **Schedule** section, click **Define** and set the time when the message will be active. 2. In the **Display Settings** section, click **Define**. 1. Define the **Delay display**, **Priority index**, **Frequency limit** and/or **Capping limit**. 2. In our case, we want to display the message once per user. To do this, switch on **Capping limit**, and in the **Show maximum** section text field type `1`. 4. Click **Apply**. 5. Optionally, you can define the UTM parameters, additional parameters or test your in-app campaign. 6. Click **Activate**. ## Check the use case set up on the Synerise Demo workspace --- You can check the [in-app message](https://app.synerise.com/communications/in-app/6d39ca33-542c-4c18-950c-0620ca5c486e) configuration directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 4 events per profile that completes the flow: `app.firstVisit` (~1), [`inApp.show`](/docs/assets/events/event-reference/inapp#inappshow) (~1), [`inApp.click`](/docs/assets/events/event-reference/inapp#inappclick) (~1), [`form.submit`](/docs/assets/events/event-reference/web-and-app#formsubmit) (~1). ## Read more --- - [In-app messages](/docs/campaign/in-app-messages) - [Mobile campaigns](/docs/campaign/Mobile) - [Using in-app template builder](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template) # Personalized menu The navigation menu serves as a roadmap for category discovery, allowing customers to explore important site areas. However, sometimes, if the menu is not personalized, it can highlight items that are not interesting for to them. Optimizing and reorganizing the menu items based on a customer's previous visits and preferences not only eases the website navigation but also can reduce the time it takes to reach the desired categories and drive conversions more effectively. This use case describes an example of menu personalization for a sports company's website. When the customer clicks the hamburger menu and selects a list of all sports, the list of categories is displayed in an alphabetical order. Above the list, a recommendation with six personalized categories (based on visits and interactions) is added to facilitate navigation and promote the most frequently viewed categories.
Personalized menu implemented on the website
## Prerequisites --- - A [tracking code](/developers/web/installation-and-configuration#creating-a-tracking-code) implemented in the source of your website. - Implement [OG Tags](/developers/web/og-tags) on your website. - Create [items feed](/docs/ai-hub/recommendations-v2/item-feed-requirements). - Activate basic menu with all product categories on your website. - Enable [the Attribute recommendation model](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations).
Attribute recommendations settings
Attribute recommendation settings
## Process --- In this use case, you will go through the following steps: 1. [Prepare metadata catalog](/use-cases/personalized-menu#prepare-metadata-of-categories). 2. [Import metadata of categories to a catalog](/use-cases/personalized-menu#import-metadata-of-categories-to-a-catalog). 3. Create [attribute recommendation campaign](/use-cases/personalized-menu#create-recommendation-campaign). ## Prepare metadata of categories --- 1. Go to **Data Modeling Hub > Catalogs**. 2. Create a new catalog with meaningful name, for example `Metadata catalog`. It will be necessary during the import process. 3. Prepare a file (CSV, JSON Lines or XML Google Merchant format) with all product categories available in your menu on the website. Include 4 parameters: `itemId`, `title`, `link` and `imageLink`. You can add more additional parameters if you want.
`itemId` values must correspond with the same values of the `category` attribute in your general product feed. In metadata catalog, all values must start with lower case letter.
## Import metadata of categories to a catalog --- Create the workflow that imports the metadata of categories into the Synerise catalog. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 3. Enter the name of the workflow. 4. As the trigger node, add **Scheduled Run**. 5. In the configuration of the node: 1. In the **Run trigger** dropdown, leave the default option **One time**. 2. Choose option **Immediately**. 3. Confirm by clicking **Apply**. 4. Add the **Local File** node. 7. In the configuration of the node, add your file prepared in previous step. 8. Add the **Import to Catalog** node. 9. In the configuration of the node: 1. Select [the catalog created in previous step](/use-cases/personalized-menu#prepare-metadata-of-categories) to which the data will be imported. 2. As the primary key, enter the name of the file column which contains the unique identifiers of the items (in this case: `itemId`). 3. Confirm by clicking **Apply**. 4. Add the **End** node.
Automation Hub workflow for importing metadata of categories to a catalog
The workflow configuration
## Create recommendation campaign --- Create an attribute recommendation for the `0` level category. Such recommendation will return personalized categories for customers based on their behavior on the website and browsing history. 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation** 2. Enter the meaningful name of the recommendation. 3. In the **Type & Items feed** section, click **Define**. 1. From the **Items feed** dropdown list, select the main catalog with all products and categories. 2. As the type, select **Attribute**. 3. As the **Metada catalog**, choose the catalog created in [this step](/use-cases/personalized-menu#import-metadata-of-categories-to-a-catalog) that contains additional information about categories. 4. Click **Apply**.
Attribute recommendations settings
Attribute recommendation - Type&Source settings
4. In the **Items** section, click **Define**. 5. Click **Add slot**. You can name the slot for later reference. 6. In the **Number of items** subsection, set the minimum and maximum number of items to `6`.
Setting the minimum and maximum number of items to the same number ensures that exactly this many items will appear in the slot.
7. From the **Item attribute** dropdown, choose **category**. Remember, that this attribute must have the same values as itemId in the metadata catalog. 8. Additionally, if you want to, you can use [additional filters](/docs/ai-hub/recommendations-v2/recommendation-filters) to make this recommendations more personalized. 9. In the **Items** section, click **Apply**. 10. In **Boosting**, you can enable [boosting](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#define-the-boosting-factors). 11. In **Additional settings**, optionally you can add metrics or filters to increase the chances of conversion and to put your recommendations in a favorable order. 12. Save the recommendation by clicking **Save**.
Attributes recommendations - final settings
Attributes recommendations - final settings
## What's next --- We recommend to implement this recommendation campaign on your website through [API](https://hub.synerise.com/api-reference/ai-recommendations#operation/GetRecommendationsByCampaignV2).
Example of API response
{ "data": [ {"imageLink": "https://contents.demoshop.com/s568172/k$?format=auto&?f=220x220", "itemId": "surfing", "link": "/browse/c0-sporty/c1-surfing/_/N-vfplmx", "title": "Surfing" }, { "imageLink": "https://contents.demoshop.com/s568173/k$?format=auto&?f=220x220", "itemId": "basketball", "link": "/browse/c0-sporty/c1-basketball/_/N-1krujl5", "title": "Basketball" }, { "imageLink": "https://contents.demoshop.com/s568123/k$?format=auto&?f=220x220", "itemId": "snorkeling", "link": "/browse/c0-sporty/c1-snorkeling/_/N-1hhjr0v", "title": "Snorkeling" }, { "imageLink": "https://contents.demoshop.com/s568159/k$?format=auto&?f=220x220", "itemId": "swimming", "link": "/browse/c0-sporty/c1-swimming/_/N-1tkzd7k", "title": "Swimming" }, { "imageLink": "https://contents.demoshop.com/p2097249/k$?format=auto&?f=220x220", "itemId": "bushcraft", "link": "/browse/c0-sporty/c1-bushcraft/_/N-1a5bddf", "title": "Bushcraft" }, { "imageLink": "https://contents.demoshop.com/s567762/k$?format=auto&?f=220x220", "itemId": "aquafitness", "link": "/browse/c0-sporty/c1-aquafitness/_/N-1o54845", "title": "Aquafitness" } ], "extras": { "contextItems": null, "correlationId": "5ea91ef7-64de-49ad-bb6d-7eddb8abcce9", "slots": [ { "id": 0, "itemIds": [ "surfing", "basketball", "snorkeling", "swimming", "bushcraft", "aquafitness" ], "name": "Unnamed slot"}]}}
However, as an alternative option you can display the recommended categories to your customers using the [recommendation insert](/developers/inserts/recommendations-v2) in [dynamic content](/docs/campaign/dynamiccontent/creating-dynamic-content). ## Check the use case set up on the Synerise Demo workspace --- You can check the [recommendation configuration](https://app.synerise.com/ai-v2/recommendations/iTt1yuoP0l6B), and [workflow](https://app.synerise.com/automations/workflows/automation-diagram/4de44dca-a712-4a89-a518-45597207e8ee) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 7 events per profile that completes the flow: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~2), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Catalogs](/docs/assets/catalogs/introduction-to-catalogs) - [Dynamic content](/docs/campaign/dynamiccontent) - [Jinjava inserts](/developers/inserts) - [Recommendations](/docs/ai-hub/recommendations-v2) - [Recommendation filters](/docs/ai-hub/recommendations-v2/recommendation-filters) # Customers who have their birthday in the current month Synerise allows you to organize your customers into groups in terms of similarity. One of them may be the month of their birthday. Such segmentation can later be used for sending out birthday coupons to those customers who celebrate birthday in the current month to engage customers and strengthen your relationship with them. ## Prerequisites --- - Implement [tracking code](/developers/web/installation-and-configuration#creating-a-tracking-code) on your website. ## Process --- In this use case, you will go through the following steps: 1. [Create an expression](/use-cases/month-of-birth-expression#create-an-expression) which will function as the attribute of customers who have birthday in the current month. 2. [Create a segmentation](/use-cases/month-of-birth-expression#create-a-segmentation). ## Create an expression --- In this part of the process, you create an expression which will function as the attribute of customers who have birthday in the current month.
Birthday persons from the current month
1. Go to **Behavioral Data Hub > Expressions > New expression**. 2. Enter the name of the expression. 2. Leave the selection of the **Expression for** option at default (**Attribute**). 3. Create the following formula:
Behavioral Data Hub expression formula for extracting the month of birth from a customer attribute
The formula of the expression
4. To complete the expression, click **Publish**. 5. To check the result of the expression for individual customers, click the **Preview tab**. In the search box, enter the email of a customer.
Preview of the expression: a customer has birthday in the current month
Preview of the expression: a customer has birthday in the current month
## Create a segmentation --- In this part of the process, you create a segment of customers for whom the value of the expression you created in the previous part of the process is `true`. 1. Go to **Decision Hub > Segmentation > New segmentation**. 2. Enter the name of the segmentation. 3. Click **Choose filter**. 4. Select the **Clients** tab. 6. Select the **Expressions** tab. 7. Search for the expression you created. 8. From the logical operators dropdown list, click the Boolean icon icon. 7. Select **is true**. 8. Click **Save**.
Final configuration of the segmentation
Final configuration of the segmentation
## What's next --- You can use this segmentation as the audience of a message in the following channels: - email - SMS - mobile push - web push - dynamic content
The segmentation selected as the recipient group of a message with a coupon
The segmentation selected as the recipient group of a message with a coupon
## Check the use case set up on the Synerise Demo workspace --- Check the [expression](https://app.synerise.com/analytics/expressions/c85239da-6546-40b7-81db-e78ad768f795) and [segmentation](https://app.synerise.com/analytics/segmentations/8ffae6c2-96bd-42aa-86c2-abd2c57612f9) settings in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case does not generate any events. ## Read more --- - [Creating campaigns](/docs/campaign) - [Expressions](/docs/crm/expressions) - [Segmentation](/docs/analytics/segmentations) # Check distribution of sources of traffic on a website In this scenario, you will create a segmentation that allows you to understand the distribution of traffic to your website, in this example - mobile vs desktop visits. This scenario assumes the default setup, in which a `page.visit` event has a **source** parameter that equals `WEB_DESKTOP` or `MOBILEWEB` depending on the client device. ## Prerequisites --- - Add a [tracking code](/developers/web/installation-and-configuration) to your website. ## Create segmentation --- Create a segmentation that organizes customers by sources from which they visited the website. 1. Go to **Decision Hub > Segmentations > New segmentation**. 2. Enter a meaningful name of the segmentation. 3. Add three segments by clicking **Add segment**. 4. Name the segments as follows: `Mobile and Desktop`, `Mobile`, and `Desktop`. 5. Define the conditions for each segment:
Mobile and Desktop
  1. Click Performed event....
  2. From the dropdown list, select page.visit.
  3. As the event parameter, select source.
  4. As the logical operator, select EQUAL.
  5. In the text field, enter `WEB_DESKTOP`.
  6. Click Performed event....
  7. From the dropdown list, select page.visit.
  8. As the event parameter, select source.
  9. As the logical operator, select EQUAL.
  10. In the text field, enter `MOBILEWEB`.
  11. Join the two conditions with the `And` logical operator.
Mobile
  1. Click Performed event....
  2. From the dropdown list, select page.visit.
  3. As the event parameter, select source.
  4. As the logical operator, select EQUAL.
  5. In the text field, enter `MOBILEWEB`.
Desktop
  1. Click Performed event....
  2. From the dropdown list, select page.visit.
  3. As the event parameter, select source.
  4. As the logical operator, select EQUAL.
  5. In the text field, enter `WEB_DESKTOP`.
11. Save your segmentation.
Conditions of the segmentation
Conditions of the segmentation
### Preview segmentation 1. Switch the **Multi-match** option on. 2. Click **Show preview**. You receive the number of customers in each segment and the percentage of each segment in relation to the whole population in the segmentation. Additionally: - You can change the chart type - pie chart and column chart - You can also export the information to CSV/XLSX (data) or JPEG/PNG/PDF (chart)
Preview of the segmentation
Preview of the segmentation
## Check the use case set up on the Synerise Demo workspace --- You can check the [segmentation configuration](https://app.synerise.com/analytics-v2/segmentations/e02acab7-a40f-4004-8a1d-703491d704d7) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case does not generate any events. ## Read more --- - [Segmentation](/docs/analytics/segmentations) # Promotions for customers with high propensity to purchase As customer expectations grow, they expect personalized experiences and customized content, promotions, and recommendations to help them find what they are looking for quickly and easily. This challenge can be met by using algorithms that can predict customer behavior using propensity scores. Such insight into customers' future actions allows you to deliver hyper-personalized messages at the right time for the right users. This use case describes how to create a promotion for customers who have the highest propensity to buy products from the wireless headphones category. ## Prerequisites --- - Implement promotions in your [mobile application](/developers/mobile-sdk/loyalty) or website, [API](https://hub.synerise.com/api-reference/loyalty-and-engagement#operation/profileLogin). - [Import your product feed to catalog](/use-cases/import-product-feed-to-catalog). - [Enable the Propensity prediction type](/docs/ai-hub/predictions/enabling-predictions#enabling-propensity-and-best-fit-predictions). - The `category` attribute must be added to [filterable attributes](/docs/ai-hub/ai-search/define-attributes#filterable-attributes). ## Security configuration --- Before you start working with this hub, if you are a Synerise customer or partner, consider reading [the section about denylisting events](/docs/settings/tool/api#denylist). This natively accessible configuration will allow you to manage the restrictions in points management that may help you prevent fraud. ## Process --- 1. [Create a prediction](/use-cases/propensity_based_promotion#create-a-prediction) to find customers with the highest propensity to buy wireless headsets. 2. [Prepare a segmentation](/use-cases/propensity_based_promotion#prepare-a-segmentation) of customers who have the highest propensity to buy wireless headsets. 3. [Create a filter in the product catalog](/use-cases/propensity_based_promotion#create-a-filter-in-the-product-catalog) with wireless headphones that will be used in the promotion. 4. [Create a promotion](/use-cases/propensity_based_promotion#create-a-promotion) for the customers with the highest propensity. ## Create a prediction --- 1. Go to AI Hub icon **(AI Predictions) Models > New prediction** and select **Propensity** as the prediction type. 2. Define the prediction name. 3. Select an audience for the prediction. For more information, see the [Predictions quick start article](/docs/ai-hub/predictions/propensity#select-customers-to-be-analyzed). ### Define the item In this section, you define the category for which you want to calculate the prediction. This is done by creating a filter that matches the category in the catalog. 1. In the **Item selection** section, click **Define**. 2. Click **Choose item feed**. 3. Select the catalog that contains the items you want to make the prediction for. **Result**: The **Item filter** section appears. 4. Click **Define item filter**. 5. From the **Select attribute** dropdown list, select the `category` attribute. You can use the search field. 6. From the dropdown list that appears, select the **Equal** operator. **Result**: The **Select category** button and **Level range** field appear. 7. Click **Select category** and select the desired product category - `headphones>wireless headphones`. You can use the search field. 8. In the **Level range** field, enter `0`. Enter `0` for wireless headphones or `1` for the entire headphone category.
Screenshot: filter matches wireless headphone category
The filter matches wireless headphone category
9. Click **Save**. 10. Save the item feed configuration by clicking **Apply**. ### Additional settings and saving Configure the [additional settings](/docs/ai-hub/predictions/propensity#additional-settings) (or leave them at default) and click **Save & Calculate**.
After the calculation, a `snr.propensity.score` event is saved in the profiles of each customer in the audience. The event data includes detailed results of the prediction.
## Prepare a segmentation --- In this part of the process based on the `snr.propensity.score` event, create a segmentation of customers with the highest propensity score. 1. Go to Behavioral Data Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of segmentation. 3. From the **Choose filter** dropdown list, select the `snr.propensity.score` event. 4. From the **Choose parameter** dropdown list, select **modelId**. 5. From the dropdown list that appears, select the **Equal** operator. 6. Enter the ID of the propensity model that was created in [this part of the process](/use-cases/propensity-product#creating-the-prediction). 7. Click **Add condition**. 8. From the **Choose parameter** dropdown list, select **score_label**. 9. From the dropdown list, select the **Equal** operator. 10. Enter the **Very high** score.
If you selected a 2-point scale in the settings of the prediction, enter `High` instead of `Very high`.
11. Click **Save**.
An example of a segmentation of customers with the highest propensity score
An example of a segmentation of customers with the highest propensity score
The conditions used in the segmentation will vary depending on your business needs (for example, the score level may be different).
## Create a filter in the product catalog --- In this part of the process, create a filter with wireless headphones in the catalog with the product feed you will use as a source in the promotion. 1. Go to **Data Modeling Hub>Catalogs**. 2. Select product feed. 3. On the upper right, click Filter icon **> Define.** 4. Click **Choose filter**. 5. Choose **Category>equal>**`wireless headphones`. 6. To save the filter, click **Save filter**. 7. Enter the name of the filter. 8. To only save the filter, click **Save**. 9. To save the filter and filter out promotions on the list, click **Save and Apply**. **Result**: The filter is available in the Filter folder icon folder ## Create a promotion --- In this part of the process, create a promotion for the group of customers with the highest propensity to purchase. These customers will be entitled to a 15% discount on the wireless headphones. 1. Go to AI Hub icon **AI Hub > Regular Promotions > Add promotion**. 2. Select the **For selected items** option. 3. In the **Audience** section, select the segmentation created in [this step](/use-cases/propensity_based_promotion#prepare-a-segmentation). 4. In the **Content** section: 1. Define the name, description, and image of the promotion. 2. In the **Price** field, enter `0`. 3. Confirm the settings by clicking **Apply**.
AI Hub promotion Content section with name, description, image, and zero price for a propensity-based promotion
Example of promotion content
5. In the **Type and limits** section: 1. As the **Type**, choose **General**. 2. Select the **Single** tab. 3. In the **Limit per profile** section, enter `1`. 4. From the **Discount type** dropdown list, choose **Percentage**. 5. From the **Discount mode** dropdown list, choose **Static**. 6. In the **Value** field, enter `15`. 7. Leave the rest of the settings in this section at default.
The configuration of the Type and limits section
The configuration of the Type and limits section
6. In the **Schedule** section, define the promotion distribution period according to your business needs. 7. *Optionally*, in the **Stores** section, specify stores where the promotion is available.
This is possible only if the list of stores is imported into a [catalog](/docs/assets/catalogs).
8. In the **Items** section: 1. In the **Source catalog** field, select an item catalog from which the items will be discounted. 2. Select **Filtered items**. 3. From **Select filter** dropdown list, select the filter that includes the wireless headphone product group you created [earlier in the catalog](/use-cases/propensity_based_promotion#create-a-filter-in-the-product-catalog). 9. To apply configuration and run the promotion, click **Publish**. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of each step from this use case in our Synerise Demo workspace: - [Propensity prediction](https://app.synerise.com/ai-v2/predictions/propensity/pngsuydybpkq), - [Segmentation](https://app.synerise.com/analytics-v2/segmentations/15226481-541f-4ad0-8293-cc508a223d08), - [Promotions](https://app.synerise.com/campaigns/promotions/c71bdcfc-8573-4f44-884c-f84e01bd7f13). If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 2 events per profile that completes the flow: [`snr.propensity.score`](/docs/assets/events/event-reference/predictions#snrpropensityscore) (~1), [`client.activatePromotion`](/docs/assets/events/event-reference/loyalty#clientactivatepromotion) (~1). ## Read more --- - [Promotions](/docs/ai-hub/promotions) - [Propensity predictions](/docs/ai-hub/predictions) - [Segmentations](/docs/analytics/segmentations) # Promote 'Product of the Day' to Boost Sales with Dynamic Content --- To boost your sales in your e-commerce, you can use many different useful tactics. One of them is to **promote special, selected products** visited by customers as products of the day. It’s obvious that the important part here is to show users the necessity of fast decision (not a lot of products left, the promotion lasts only during a particular day etc.). You can use this kind of campaign to promote selected products and not only boost sales but especially the sales of specific products. ## Example of use - Retail industry **Challenge** Campaigns displayed to all users on the customer homepage. This consisted of one product chosen by the customer, which is designated as the best offer of the day + additionally displaying a frame of recommendations with personalized products. The frame with the special offer is additionally supplemented with information on the number of remaining products, progress bar and counter. These elements are intended to convince the customer to buy the product now. ![Screenshot presenting product of the day](/api/docs/image/f8a57079df9dd82ae8b22dc747691385d7d51d29/use-cases/all-cases/_gfx/product-of-the-day.png) ## Requirements --- - Tracker Key - Integration with AI campaigns - personalized AI campaigns - Properly configured dynamic content campaigns - Collecting transaction events ## How to do it --- 1. Create AI campaign with personalized recommendations. 2. Prepare the necessary metric **with the number of products purchased** ![Screenshot presenting product of the day](/api/docs/image/f8a57079df9dd82ae8b22dc747691385d7d51d29/use-cases/all-cases/_gfx/product-of-the-day2.png) - Add the SKU of the product that should be displayed as the product of the day - Select the campaign start and end dates to measure sales levels accordingly 3. Create the metric that **calculates the percentage of products sold** (percentages rounded to full tens to make it easier to set the progress bar display). ![Screenshot presenting product of the day](/api/docs/image/f8a57079df9dd82ae8b22dc747691385d7d51d29/use-cases/all-cases/_gfx/product-of-the-day3.png) - Here, you have to describe how many pieces of the product are available for purchase - Multiply the right values ​​to get the full dozens 4. Prepare a dynamic content campaign that combines the product of the day and the recommendations. - All dynamic elements such as counters, number of pieces and progress bar are prepared using Synerise and calculated on the basis of metrics, collecting transaction events relevant metrics. 5. Remember that the link of the product of the day will have the right marker thanks to which you will be able to create analytics. ## Check the use case set up on the Synerise Demo workspace --- In the Synerise Demo workspace, you can check: - [Metric one](https://app.synerise.com/analytics/metrics/be1c44ed-30fa-4865-9d87-00cf85d23fbc), - [Metric two](https://app.synerise.com/analytics/metrics/d32ffe36-9762-4e5f-ac73-3ccdf44f3f56), - [Dynamic content](https://app.synerise.com/campaigns/dynamic-content/create/c4efc9b8-5abd-451b-bfad-9da1da7f060e). If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 5 events per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - Read more about [creating metrics](/docs/analytics/metrics) - Read more about [creating dynamic content campaigns](/docs/campaign/dynamiccontent) # Promoting new items when a certain phrase is searched AI Search Engine enables creating rules which can help you promote items with specific attributes, based on the searched phrase. One of the applications is to create a rule which shows new products to customers based on selected phrases. This use case will help you create a rule in AI Search that promotes new models of TVs when the customer is searching for a TV. ## Prerequistes --- - An item feed must be provided. - Enable [the search engine](/docs/ai-hub/ai-search/introduction-to-ai-search) for your workspace and create an [index](/docs/ai-hub/ai-search/create-index). - Add an attribute which marks items as new in your items catalog and add this attribute to filterable attributes. In this example, the attribute is the value "new" in the `G:adwords_labels` attribute. - [Implement AI search](https://hub.synerise.com/api-reference/ai-search#tag/Search) in any of your channels (mobile app, website etc.). ## Create a rule --- 1. Go to AI Hub icon **AI Hub > Indexes**. 2. Select an index from the list. 3. Go to the **Rules** section. 4. Click **Add Rule**. 5. Name the rule. In this case, it's "Promote new TVs". 6. To adjust the query conditions, in the **Conditions** section, click **Define**. 1. On the **Query** tab, to define the method of checking the query, choose **If query is**. 2. Click **Add phrase**. 3. Enter a phrase. You can do it in two ways: - In text field, type a word (or a phrase) in a singular form. - Next to the text field, click the Facet icon in Query rules button. From the dropdown list, select a facet. It is different from defining an exact query: you can define an attribute whose values the query looks for. For example, if you choose _brand_ as the facet, the query rule will apply its consequence whenever any brand name is detected in the query.
Example of phrases
Example of phrases
4. If you want to add more phrases, repeat steps **b** and **c**. 5. Confirm the settings by clicking the **Apply** button. 7. To define how the search engine reacts to the defined conditions, in the **Consequences** section, click **Define**. 1. Click **Add consequence**. 2. From the dropdown list, select a consequence, in this case **Filter query results**. 3. Add filter and choose attribute **G: adwords_labels**.
The attribute can have a different name in your workspace, the above is an example.
4. In the next field choose **new**. 5. Enable the **Mark as elastic** option.
Example of condition consequences
Example of condition consequences
6. Confirm by clicking **Apply**. 8. To define when the query rule applies, in the **Schedule** section, click **Define**. 1. Select an option: - To launch query rules immediately, click **Active immediately**. - To schedule the rules at specific time, click **Scheduled**. Set the schedule according to your business needs. 3. Confirm by clicking **Apply**. 8. To complete working on the query rule, you can either: - Save it as a draft by clicking **Finish later**. - Save and activate it by clicking **Publish**. **Result:** If you chose **Publish** the rule will take effect in those areas where AI search has been implemented, according to the schedule you set. ## Check the use case set up on the Synerise Demo workspace --- You can check the [rule configuration](https://app.synerise.com/ai-v2/search/indices/2891e883b914a485c4f3f98b37b652271657484874/query-rules/14434) directly in Synerise demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 2 events per profile that completes the flow: [`item.search`](/docs/assets/events/event-reference/search#itemsearch) (~1), [`item.search.click`](/docs/assets/events/event-reference/search#itemsearchclick) (~1). ## Read more --- - [Configuring AI Search](/docs/ai-hub/ai-search/introduction-to-ai-search#configuring-ai-search) - [Rules in AI Search](/docs/ai-hub/ai-search/query-rules) # Dynamic SMS campaign with promotion at customer's preferred stationary store You can use SMS channel to effectively inform your customers about upcoming or ongoing promotions both in online or brick-and-mortar stores. The key to the success of these campaigns is personalization. Imagine you have a large customer base and you want to notify them about an exciting promotion in specific stores. Instead of creating multiple campaigns for each store, you can achieve this with just one campaign using Synerise. With Jinjava, you can effortlessly customize your message content. You can dynamically change store names, locations, and other crucial details with a simple Jinjava code. This means less work for you and more personalized experience for your customers.
Dynamic SMS campaign
This use case describes a scenario that begins by explaining how to assign IDS of customers' top-choice stores as attributes to their profiles. The further part of the process outlines how to create a dynamic SMS campaign targeting customers from the selected stores. Additional assumptions used in this use case: - The promotion is created on the client side, - The created catalog contains only those stores where the promotion is implemented, - Information about the current promotion is sent to users who have assigned a store ID to their profile. ## Prerequisites --- - Permissions that allow access to Catalogs section and adding new catalogs. - Prepare a CSV file with the stores where the promotion you are creating a campaign for will be available. The file used in this use case contains the following columns: `StoreId`, `StoreName`, `Street`, `City`.
Example file
Sample file
Sample file
- Implement the [transaction events](/developers/web/transactions-sdk) using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). Implement a custom parameter to the event that refers to the store where the transaction occurred. In this case, we will use the `StoreId` parameter. - Meet all requirements listed in the [introduction to SMS](/docs/campaign/SMS/introduction-to-sms#requirements). - Promotion must be implemented on the client side. ## Process --- 1. [Create an aggregate](/use-cases/dynamic-sms-campaign#create-an-aggregate) that identifies the top store for customers based on their transactions. 2. [Create a workflow](/use-cases/dynamic-sms-campaign#create-a-workflow-that-assigns-a-store-id-to-customer-profile) that assigns a store ID to customer profile. 3. [Create a catalog](/use-cases/dynamic-sms-campaign#create-a-catalog) with the store details. 4. [Prepare an SMS message template](/use-cases/dynamic-sms-campaign#prepare-an-sms-message-template). 5. [Create a workflow for the SMS campaign](/use-cases/dynamic-sms-campaign#create-a-workflow-for-the-sms-campaign). ## Create an aggregate --- Create an aggregate to find the top store for customer based on transaction history. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Top**. 4. From the **Choose event** dropdown list, select the **transaction.charge** event. 5. As the event parameter, select **StoreId**. 6. Using the date picker in the lower-right corner, set the time range to **Lifetime**. Confirm your choice with the **Apply** button. 7. Click **Save**.
Final configuration of the aggregate
Final configuration of the aggregate
## Create a workflow that assigns a store ID to customer profile --- Create a workflow that assigns a **StoreId** attribute to customers who do not have this attribute yet and update it for the customers who have switched to another store over time. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the trigger node --- 1. Add the **Profile Event** node. 2. From the **Choose event** dropdown list, select the **transaction.charge** event. 3. Click **Apply**. ### Define the Update Profile node --- In this part of the process, you will add an attribute **StoreId** to the customers who do not have this attribute yet and update it for the customers who have switched to another store over time. 1. Add the **Update Profile** node. 2. From the left dropdown list, select **Attributes > StoreId**. 3. From the right dropdown list, select **Change**. 4. In the text field, add a Jinjava with the ID of the aggregate [created earlier](/use-cases/dynamic-sms-campaign#create-an-aggregate). This Jinjava will return the top StoreId for the individual customer. Jinjava used in the use case:
{% aggregate 6b686d01-758f-328a-859b-91e3542c5bbe %} {{ aggregate_result[0] }} {% endaggregate %}
The above Jinjava contains the ID of the aggregate created in this use case. Make sure to replace this ID with the ID of your aggregate.
5. Click **Apply**. ### Add the final node --- 1. Add the **End** node. 3. Save and activate the automation by clicking **Save&Run**.
Automation Hub workflow for assigning the top-choice store ID as a customer profile attribute
Final configuration of the workflow
## Create a catalog --- In this part of the process, create a catalog and import there your CSV file you prepared as a part of prerequisites. 1. Go to **Data Modeling Hub > Catalogs > New Catalog**. 2. Enter the name of the catalog and confirm it by clicking **Apply**.
Don't use diacritical letters and spaces.
3. Click the catalog on the list and click **Import Local File**. If you prepared a CSV file in Excel, open it in a text editor to check whether commas are used as separators. If not, replace them with commas. 4. Click the **Upload a new file** button and select the file to be uploaded, then click the **Next** button. 5. You will see the information that your file has been successfully uploaded. To continue the import process, click the **Next** button. 6. In the **Primary key** field, type the name of the column whose values are treated as the key. In this case, it will be `StoreId`. To continue the process, click the **Next** button .
Catalog primary key configuration
Catalog primary key configuration
7. In the next screen you will find the summary of your import. If no changes are needed, click **Run import** button.
Import success
Import success
## Prepare an SMS message template --- Create a dynamic SMS template using Jinjava that customizes the store details for each customer. 1. Go to **Experience Hub > SMS**. 2. In the menu on the left, click **Templates**. 3. Click **Create new**. 4. Click **Text editor**. The text editor and SMS preview open. 5. In the text box on the right, enter the contents of your message. This use case uses the following content:
{% set mainShop = customer.StoreId %}
   {% catalogitemv2.UC-ShopsSale11092023(mainShop) %}
   Get ready for shopping at your favorite local spot, {{ catalog_result.StoreName }}! 🌟
   🎁 Enjoy jaw-dropping discounts of up to 30% off on absolutely everything in-store!
   📍 Find us at {{ catalog_result.Street }} in the heart of {{ catalog_result.City }}.
   {% endcatalogitemv2 %}
Where: - `StoreId` - the name of the attribute assigned to the user profile reflecting the store ID, - `UC-ShopsSale11092023` - is the name of the created catalog, - `StoreName`, `Street`, `City` - are the names of the columns defined in the catalog.
SMS template example
Example of a SMS template
6. Save the template. ### Create a workflow for the SMS campaign --- Create a workflow that sends a personalized SMS message to a selected segment of customers, informing them of a promotion at a store of their choice. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Audience node --- Choose the **Audience** node as the trigger. In this scenario, we are creating a group of customers who have agreed to receive SMS messages and have assigned StoreId attribute to their profile.
The audience should consist of users who have an attribute used as the **Primary key** in the catalog, otherwise the message will have an **sms.notSent** event with **Jinava rendering failed** as the parameter.
1. Start the workflow with the **Audience** node. 2. In the configuration of the node, leave the **Run trigger** as **one time**. 3. Choose the day and time when the process starts. 4. In **Define audience**, choose **New Audience** and define the conditions according to your needs. The following screen shows the audience configuration used in this use case.
Audience configuration
Audience configuration
### Define the Send SMS node --- 1. Add the **Send SMS** node. In the node settings: 1. In the **Content** section, choose the phone number from which the message will be sent. 2. From the **SMS template** drop-down, select [the template you created earlier in the process](/use-cases/dynamic-sms-campaign#prepare-an-sms-message-template). 2. Click **Apply**. ### Add the finishing node and set capping --- 1. Add the **End** node. 2. In the upper right corner, click **Save & Run**.
Automation Hub workflow for sending a personalized SMS campaign about store promotions
Final configuration of the workflow
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of each step directly in the Synerise Demo workspace: - [Aggregate](https://app.synerise.com/analytics/aggregates/6b686d01-758f-328a-859b-91e3542c5bbe) - [Workflow to assign StoreId to customer profile](https://app.synerise.com/automations/workflows/automation-diagram/73ee4841-ffc1-48b1-a273-3f3e58415aac) - [Catalog](https://app.synerise.com/assets/catalogs/182901) - [Workflow for the SMS campaign](https://app.synerise.com/automations/automation-diagram/4c02a16a-4455-4f31-bc50-1b2a2f563281) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 9 events per profile that completes the flow: [`transaction.charge`](/docs/assets/events/event-reference/items#transactioncharge) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~2), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~2), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~2), [`profile.updated`](/docs/assets/events/event-reference/profiles#profileupdated) (~1), [`sms.send`](/docs/assets/events/event-reference/sms#smssend) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Automation Hub](/docs/automation) - [Catalogs](/docs/assets/catalogs/introduction-to-catalogs) - [SMS campaigns](/docs/campaign/SMS) # Calculating items purchased within a campaign Thanks to the parameters in the URL, we can track the behavior of customers after interacting with a given campaign. In this use case, we will show an example of analyses related to AI recommendations, but in general, the same principles can be applied to create an analysis for any campaign where these parameters in the URL are placed. It helps us check the effectiveness of recommendations and monitor the purchases (exact number of products bought after clicking and their total value). This use case describes the process of creating aggregates, metrics and other analyses that count purchases based on the URL parameter with the ID of the AI recommendation. ## Prerequisites --- - A [tracking code](/developers/web/installation-and-configuration#creating-a-tracking-code) implemented in the source of your website. - Send information about transactions through [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction) or [SDK](/developers/web/transactions-sdk). - Implement [OG Tags](/developers/web/og-tags) on your website. - Implement [AI recommendation](/docs/ai-hub/recommendations-v2) on your website or, in case you want to analyze different type of campaign, add unique parameters to the URL after clicking it, which will allow you to analyze the campaign results. ## Process --- This use case contains the following steps which must be performed in the given order: 1. [Getting the list of clicked products](/use-cases/items-bought-after-clicking#getting-the-list-of-clicked-products). 2. [Getting the timestamp of the first visit to the product page](/use-cases/items-bought-after-clicking#getting-the-timestamp-of-the-first-visit). 3. [Getting the list of the order IDs after clicking the recommendation](/use-cases/items-bought-after-clicking#getting-the-list-of-the-order-ids-after-clicking-the-recommendation). 4. [Multiply the product price by the product quantity](/use-cases/items-bought-after-clicking#multiply-the-product-price-by-the-product-quantity). 5. [Create metrics that calculate](/use-cases/items-bought-after-clicking#create-metrics): - The number of products bought after clickng the recommendation - The value of products bought after clicking the recommendation - The number of transactions with the products bought after clicking the recommendation - The value of transactions with the products bought after clicking the recommendation ## Getting the list of clicked products --- Create an aggregate that returns the SKUs of the clicked items (from a particular recommendation campaign). You will use these SKUs later to check if they occured in the transactions that occurred after clicking at a certain time. In this use case, we analyze clicking a product from a given AI recommendation based on the `page.visit` event and `uri` parameter (URL of the website). This parameter contains `?snrai_campaign=XXX` part, where `XXX` is the ID of AI recommendation that was clicked. The `?snrai_campaign` parameter it is added to the URL automatically when implementing AI recommendation. The analysis is also based on the ID of the clicked product which is stored in the `retailer_part_no` parameter. However, sometimes clicking a product does not transfer directly to the product page, so it is not possible to add parameters to the URL, especially in the case of "Add to cart" buttons placed directly in the product frame. In such case instead of relying on the `page.visit` event, you should implement a [custom event](/developers/web/event-tracking#declarative-tracking-custom-events). Such an event must contain the AI recommendation ID and the product ID that was clicked in its parameters. Then you will be able to rely your analyses on this custom event. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Click **Analyze profiles by** and select **Last Multi**. 3. Select **Consider only distinct occurrences of the event parameter**. 3. In the **Size** field, enter the number of returned SKUs. 4. Select the **page.visit** event. 5. Select the **product:retailer_part_no** parameter. 6. Select the **url** parameter. 7. Select the **Contain** logical operator. 8. In the text field, enter the ID of the recommendation campaign.
You can find it in the URL of the product from the recommendation:
Product page URL showing the snrai_campaign parameter used to identify the AI recommendation campaign ID
ID of recommendation campaign in URL
9. Save the aggregate.
Last visited recommendation aggregate
Last visited recommendation aggregate
## Getting the timestamp of the first visit --- You must get the time of the first click at the product from recommendation campaign. To do so, we use the `TIMESTAMP` parameter and the ID of the recommendation campaign which is visible in the clicked link. Timestamp allows you to define the period from which transactions should be taken into account, and also those transactions which occurred after clicking the campaign. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Click **Analyze profiles by** and select **First**. 4. Select the **page.visit** event. 5. Select the **TIMESTAMP** parameter. 6. Select the **url address** parameter. 7. Select the **Contain** logical operator. 8. In the text field, enter the ID of the recommendation campaign. 9. Save the aggregate.
Decision Hub First aggregate returning the TIMESTAMP of the first page.visit event matching the AI recommendation campaign URL
Time of the first visit to the product of the recommendation campaign
## Getting the list of the order IDs after clicking the recommendation --- Create an aggregate that returns the order IDs of the products included in the [first aggregate you prepared](/use-cases/items-bought-after-clicking#getting-the-list-of-clicked-products). It allows you to identify the transactions that included the products clicked from the specific campaign and those transactions which took place just after the click. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Click **Analyze profiles by** and select **Last Multi**. 3. Select **Consider only distinct occurrences of the event parameter**. 4. Select the **product.buy** event. 5. Select the **$orderID** parameter. 6. Select the **$sku** parameter. 7. Select the **IN ARRAY** logical operator. 8. Select the aggregate you created in the [Getting the list of visited products](/use-cases/items-bought-after-clicking#getting-the-list-of-clicked-products) step. 9. Save the aggregate.
Decision Hub Last Multi aggregate returning the distinct product.buy order IDs for items previously clicked in the AI recommendation campaign
The list of products clicked in the recommendation
## Multiply the product price by the product quantity --- Create [an event expression](/docs/crm/expressions/creating-event-expression) that multiplies the final price of the product and its quantity. At the same time you enrich the parameters of the `product.buy` event. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expressions**. 2. From the **Expression for** list, select **Events**. 3. Select the **product.buy** event. 4. On the dashboard, click the **Select** button and select **Event attribute**. 5. On the list, find **$finalUnitprice** or other parameter that signifies the actual transaction value. 6. Click the plus button and select **Event attribute**. 7. On the list, find **$quantity** or other parameter that signifies the quantity of the product. 8. Change the mathematical sign between the attributes from the plus sign to times sign (`x`). 9. Save the expression.
Configuration of the expression
Configuration of the expression
## Create metrics --- Prepare metrics based on the three aggregates you created in previous steps. Including the aggregates in metrics lets you calculate: - the number of products purchased after clicking in the campaign, - the total value of products purchased after clicking in the campaign, - the number of transactions that include the products bought after clicking the campaign, - the total value of transactions that include the products bought after clicking the campaign.
Click to see the metric for the number of products bought after clicking the campaign

In this metric, you check the number of products by using in the metric formula the aggregate that returns the SKU of the products viewed within a campaign.

Additionally, narrow down the results by using the timestamp parameter. Set the time stamp to include the purchases after the first click at the product in the campaign. For that purpose, use the aggregate that calculates the timestamp of the first product visit.

  1. Go to Decision Hub icon Decision Hub > Metrics > New metric.
  2. Enter the name of the metric.
  3. Leave the Aggregator at default (Count).
  4. Select the product.buy event.
  5. Add the following parameters:
    1. Add the $sku parameter.
      1. Select the In operator.
      2. Keep clicking the icon next to the logical operator until you get Choose value icon.
      3. Select the aggregate that returns the list of visited products.
    2. Add the TIMESTAMP parameter.
      1. Select the Date operator.
      2. Select the More than option.
      3. Keep clicking the icon next to the logical operator until you get Choose value icon
      4. Select the aggregate that returns the timestamp of the first product visit.
  6. Select the date range of the metric (for example, last 30 days).
  7. Save the metric by clicking Save.
Configuration of the metric
Configuration of the metric
Click to see the metric for the sum of products bought after clicking a campaign

This metric returns the total sum of products bought after clicking a campaign. The metric uses the expression that multiplies the product price by the product quantity.

You can duplicate the metric that calculates the number of products bought after clicking a product, change the aggregator from Count to Sum and use the expression that multiplies the price by the quantity.

  1. Go to Decision Hub icon Decision Hub > Metrics > New metric.
  2. Enter the name of the metric.
  3. As the aggregator type, select Sum.
  4. Select the product.buy event.
  5. Add the following parameters:
    1. The expression that multiplies the product price by product quantity.
      1. Select the $sku parameter.
      2. Select the In operator.
      3. Keep clicking the icon next to the logical operator until you get Choose value icon.
      4. Select the aggregate that returns the list of visited products.
    2. Add the TIMESTAMP parameter.
      1. Select the Date operator.
      2. Select the More than option.
      3. Keep clicking the icon next to the logical operator until you get Choose value icon
      4. Select the aggregate that returns the timestamp of the first product visit.
  6. Select the date range of the metric (for example, last 30 days).
  7. Save the metric by clicking Save.
Configuration of the metric
Configuration of the metric
Click to see the metric for the number of transactions with the products bought after clicking a campaign

This metric is based on the `transaction.charge` event (this event collects an array of products included in the transaction). The metric reuses the aggregate that returns the list of products bought after clicking the campaign to check if the order ID of the product is included in the transaction. The scope of the metric is narrowed down by the aggregate that returns the timestamp of the first visit at the product page.

  1. Go to Decision Hub icon Decision Hub > Metrics > New metric.
  2. Enter the name of the metric.
  3. Leave the Aggregator to default (Count).
  4. Select the transaction.charge event.
  5. Add the following parameters:
    1. Add the $orderID parameter.
      1. Select the In operator.
      2. Keep clicking the icon next to the logical operator until you get Choose value icon
      3. Select the aggregate that returns the list of the order IDs after clicking the recommendation.
    2. Add the TIMESTAMP parameter.
      1. Select the Date operator.
      2. Select the More than option.
      3. Keep clicking the icon next to the logical operator until you get Choose value icon
      4. Select the aggregate that returns the timestamp of the first product visit.
  6. Select the date range of the metric (for example, last 30 days).
  7. Save the metric by clicking Save.
Configuration of the metric
Configuration of the metric
Click to see the metric for the sum of transactions with the products bought after clicking a campaign

This metric is based on the `transaction.charge` event (this event collects an array of products included in the transaction). The metric reuses the aggregate that returns the list of products bought after clicking the campaign to check if the order ID of the product is included in the transaction. The scope of the metric is narrowed down by the aggregate that returns the timestamp of the first visit at the product page.

If you have already created a metric for the number of transactions with the products bought after clicking a campaign, you can duplicate it and change the aggregator type and use the `totalAmount` parameter.

  1. Go to Decision Hub icon Decision Hub > Metrics > New metric.
  2. Enter the name of the metric.
  3. As the Aggregator type, select Sum.
  4. Select the transaction.charge event.
  5. Add the following parameters:
    1. Add the $totalAmount parameter.
      1. Select the In operator.
      2. Keep clicking the icon next to the logical operator until you get Choose value icon
      3. Select the aggregate that returns the list of the order IDs after clicking the recommendation.
    2. Add the TIMESTAMP parameter.
      1. Select the Date operator.
      2. Select the More than option.
      3. Keep clicking the icon next to the logical operator until you get Choose value icon
      4. Select the aggregate that returns the timestamp of the first product visit.
  6. Select the date range of the metric (for example, last 30 days).
  7. Save the metric by clicking Save.
Configuration of the metric
Configuration of the metric
## What's next --- You can display created metrics on the [dashboard](/docs/analytics/analytics-dashboard), which help you present them in useful and readable form. ## Check the use case set up on the Synerise Demo workspace --- You can check the created metrics directly in Synerise Demo workspace: - [Number of products bought after clicking the campaign](https://app.synerise.com/analytics/metrics/2603b814-57e6-4bfd-ad4f-f73677003117) - [The sum of products bought after clicking a campaign](https://app.synerise.com/analytics/metrics/cada2f5c-5295-4b88-9a29-be74f0cf2044) - [The number of transactions with the products bought after clicking a campaign](https://app.synerise.com/analytics/metrics/7c105ed8-1c55-438c-bebb-40cdaf06d792) - [The sum of transactions with the products bought after clicking a campaign](https://app.synerise.com/analytics/metrics/e0058e97-b130-4632-b4aa-5500c369cda9) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case does not generate any events. ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Recommendations](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign) # Email with a promotion for products in the customers' size Reuse the collected data about your customers in order to send personalized communication and help your customers find the best products for them. For this purpose you can use the size of a customer (you can collect it through transactions events) and send a message to the customers with the link to the discounted products in their size. ## Example of use - Retail industry A client from the retail industry decided to increase the personalization of their communication. Using aggregates, we can find the size of the individual customer’s last purchased product to prepare a special offer. When the customer made a purchase, the size he was interested will be collected in to the system, and in subsequent mailings would receive a personalized messages with a link to the products of the selected size. - Email communication contained the size of the customer's shoes in the subject of the message: Check before they disappear! Shoes in size 39. - The email contained a link to a listing with the sizes adjusted to size of every individual customer. Other customers who have not made any transaction so far, received a general email with the promotion and all available sizes, and they could specify which they are interested in. In this way, **2 groups of customers** received an email with the same promotion, but with a completely different message.
Screenshot presenting email with promotion
Email with a promotion based on a customer's size
**Results** - **21,64%** open rate for the emails with the personalized size in the title. - **12,94%** open rate for the emails without the personalized size. The customer had 10% more transactions from emails in which he indicated a specific customer size. ## Prerequisites --- To be able to implement this use case, you must: - Add [tracking code](/docs/settings/tool/tracking_codes) to your website. - Implement [transaction events](/developers/web/transactions-sdk) where you send size of bought products. - [Create an email account](/docs/campaign/e-mail/creating-email-campaigns). - [Integrate forms](/developers/web/tracking-form-data). ## Process --- To prepare an email with a promotion for the products in the customers' size, perform the following steps: 1. [Prepare an aggregate](/use-cases/email_with_a_promotion_for_products_in_the_customers_size#prepare-an-aggregate). 2. [Configure email communication](/use-cases/email_with_a_promotion_for_products_in_the_customers_size#configure-email-communication). ## Prepare an aggregate --- Prepare the aggregate with the size of the last bought product. 1. To do it, create new [aggregate](https://app.synerise.com/spa/modules/analytics/aggregates/new). 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Click **Analyze profiles by** and select **Last**. 3. Select **product.buy** event, and specify the **size parameter.**
The name of the size parameter can be different for every Synerise user - check the name of the size parameter you use in the transaction events.
Screenshot presenting aggregate conditions
Aggregate conditions
In Synerise every **transaction.charge** event generates additionally **product.buy** event, which store information about particular product which was bought – that's why in this use case we can use size parameter from such event.
## Configure email communication --- For this scenario, you have to configure an email message which will use the aggregate you prepared in the previous step. To configure the email communication you have to define the audience, create the content and set up the final settings. ### Define Audience of email communication Selecting the right audience is a necessary step of preparing an email. 1. Prepare such segment in [segmentation](https://app.synerise.com/spa/modules/analytics/segmentations/new) or create new segment directly in the **email message**. 2. Choose users who will get email.
In this use case our client wanted to send email to every user, who has ever made a transaction so such segment should contain of transaction.charge event which occured in lifetime period.
Screenshot with define audience mode
Define audience
### Create content After you selected the audience, create the content of your email message.
In this example, you can create email for 2 groups of customers. One for customers who have made the transaction, and second for customers who have not made the transaction with the promotion and available sizes. We will provide you with the first scenario and the second you can made by using [email](/docs/campaign/e-mail/creating-email-campaigns) instruction.
1. At the beginning, select the email account from which the email will be sent. 2. In the **Email subject** field the enter the aggregate. For example:
{% aggregate a1872106808667667%} Check before they disappear! Shoes in size {{aggregate_result [0] | float | round (0)}} {% endaggregate%}
As a result, customer will see: **Check before they disappear! Shoes in size [size number of the customer]**. 3. To create the content of the email, click **Create message**. In the email template include the Jinajava code that contains the link to the listing of products in the customers' size:
Check the Jinjava code
<!-- Opening the tag that retrieves the value from the aggregate prepared in point 1--> {% aggregate xxx %} <!--Creating link to website with params to filter to client's size, link below is only an example --> {% set link = "your_link_to_listing.com/listing?size="+aggregate_result[0] %} <!--Adding Synerise tracking parameters --> <a href="{% preparelink %}{{link}}{% endpreparelink%}"> <!-- Adding yours banner link --> <img src="your_image.jpg" /> </a> <!--Closing of the tag that gets the value from the aggregate prepared in point 1 --> {% endaggregate %}
Screenshot present creating aggregate
Create aggregate
To find the aggregate ID to replace XXX in the code, simply navigate to the aggregate in the Synerise application. The ID is the part of the URL that comes after /aggregates/, for example: **bfba46b4-e0d6-3ea9-8ae6-c7a2495c54c7** in the URL `https://app.synerise.com/analytics-v2/aggregates/bfba46b4-e0d6-3ea9-8ae6-c7a2495c54c7`. Copy this ID and use it in your code where needed.
### Prepare the final settings 1. Add the title of the email. 2. In the **Schedule tab**, decide when your email is sent. 3. In the UTM & URL parameters section, add the parameters to track the email performance. 4. Send tests of your message to verify if the content of the email is displayed correctly.
Screenshot with final setings
Set up settings page
Test message can only be sent when the email has a title.
## Generated events This use case generates approximately 3 events per profile that completes the flow: [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Email communication](/docs/campaign/e-mail/creating-email-campaigns) - [Jinjava](/developers/inserts/exptest) - [Segmentation](/docs/analytics/segmentations/introduction-to-segmentations) # Creating Segments Based on Quantiles for Targeted Marketing Quantiles are often used to describe the distribution of data. Segmenting customers based on quantiles is a powerful way to identify groups of customers with similar characteristics. This can be useful for a variety of business purposes, such as targeted marketing, product development, and customer service. In this use case you will create three segments of around 500, 700 and 1250 customers with marketing agreement with the help of quantiles in metrics. Customers will be assigned to a segment based on how their Client ID value meets the condition of quantiles. It is a simple way to create fixed size segments according to your business needs, for example to divide base into specific groups when sending emails, or when a 3rd party tool accepts a fixed maximum number of users. ## Prerequisites --- Implement solutions that collect marketing agreements from various touch points with your customers. ## Process --- In this use case, you will go through the following steps: 1. [Create a segmentation](#create-a-segmentation) of customers with enabled newlsetter agreement. 2. [Create a metric](#create-a-metric) that returns the Client ID value which meets the condition of set quantile. 3. [Create a segmentation of 500 customers](#create-a-segmentation-of-500-customers). 4. [Create a segmentation of 700 customers](#create-a-segmentation-of-700-customers). 5. [Create a segmentation of 1250 customers](#create-a-segmentation-of-1250-customers). ## Create a segmentation --- In this part of the process, we create a group of customers with enabled newlsetter agreement. This segmentation will be used in a metric in the next step, and later divided into smaller segments of 500, 700 and 1250 customers. 1. Go to Decision Hub icon**Decision Hub > Segmentations > New Segmentation**. 2. Enter the name of the segmentation. 3. From the **Add condition** dropdown list, select the **Email agreement** attribute. 4. Click the **Choose** button, and from the list of operators, choose **Equal**, and then select **enabled**. 5. Save the segmentation.
Decision Hub segmentation configuration for customers with email marketing agreement
Email marketing agreement segmentation configuration
6. In the **Preview** section, check the number of customers in the segmentation and make a note of it. In our case it is 2564. ## Create a metric --- In this part of the process create a metric with quantile that returns the value of client's Custom ID which meets the condition of this quantile. The metric reuses as a filter [the segmentation you created in the previous part of the process](#create-a-segmentation). A quantile is a value that divides a ranked set of data into equal parts. In this case, we get the quantile value by dividing the desired number of customers in the segment by all customers with the email agreement enabled. In our case, we want to have a segment of 500 customers from [the segmentation you created in the previous part of the process](#create-a-segmentation), which consists of 2564 customers: `500/2564≈0,19` `0,19` is the value of our quantile. 1. Go to Decision Hub icon **Decision Hub > Metrics > New metric**. 2. Enter the name of the metric. 3. As a metric kind, select **Simple metric**. 4. As **Type**, select **Profile**. 5. As the **Aggregator**, set **Quantile**. As the value, set the quantile for the first group which will be ~ `0,19`. 6. From the **Choose value** dropdown list, select **CLIENT_ID**. 7. Click **Enable filter**. 1. Click **Choose filter** and from the dropdown list, select [the segmentation you created in the previous part of the process](#create-a-segmentation). 2. Click **Choose operator** and from the dropdown list, select **Is true**. 3. Click **Apply**. 8. Click **# Format** and deselect **Use 1000 separator**. 9. Save the metric. 10. In the **Preview** section, check the **CLIENT_ID** value, it is approximately the client ID of the 500th customer with an email agreement enabled. Make a note of it. In our case it is `2527582910.8`. For further use, remove numbers after the dot. ## Create a segmentation of 500 customers --- Using the [the segmentation](#create-a-segmentation) and [the metric](#create-a-metric) you created in the previous part of the process, you will create a segmentation of 500 customers from the initial segmentation. This segment contains all customers with Client ID values below the the client ID's value of the 500th customer. 1. Go to Decision Hub icon**Decision Hub > Segmentations**. 2. Duplicate [the segmentation you created in the previous part of the process](#create-a-segmentation). 3. Rename the segmentation. 4. Click **Add condition**, and from the dropdown list, select **CLIENT_ID**. 5. Click the **Choose** button, and from the list of operators, choose **Less or equal to**. 6. As the **Value**, type the CLIENT_ID value from [the metric you created in the previous part of the process](#create-a-metric), in our case `2527582910`. 7. Save the segmentation.
Decision Hub segmentation configuration for the first 500 customers with email marketing agreement
500 customers with email marketing agreement segmentation configuration
## Create a segmentation of 700 customers --- Using the [the segmentation of 500 customers](#create-a-segmentation-of-500-customers) you created in the previous part of the process, and a modified metric, you will create a segmentation of 700 customers [from the initial segmentation](#create-a-segmentation). This segment contains all customers with Client ID numbers below the value of the 1200th Client's ID with the exclusion of the segmentation of 500 customers. We want to have a segment of 700 customers from [the initial segmentation you created in the previous part of the process](#create-a-segmentation), and we don't want to include the customers from [the segmentation of 500 customers](#create-a-segmentation-of-500-customers). To calculate the quantile: `(700+500)/2564≈0,46` `0,46` is the value of our quantile. ### Create a metric 1. Go to Decision Hub icon **Decision Hub > Metrics**. 2. Duplicate [the metrics you created in the previous part of the process](#create-a-metric). 3. Rename the metric. 4. Change the value of quantile to two groups summed, which in our case is `~0,46`. 5. Save the metric. 6. In the **Preview** section, check the **CLIENT_ID** value, and make a note of it. In our case it is `2660654991.9`. For futher use, remove the commas and numbers after the dot. ### Create a segmentation 1. Go to Decision Hub icon**Decision Hub > Segmentations**. 2. Duplicate [the segmentation of 500 customers you created in the previous part of the process](#create-a-segmentation-of-500-customers). 3. Rename the segmentation. 4. Change the CLIENT_ID value to [the metric result you created in in this step](#create-a-segmentation-of-700-customers), in our case `2660654991`. 4. Click **Add condition**, and from the dropdown list, select [the segmentation of 500 customers you created in the previous part of the process](#create-a-segmentation-of-500-customers). 5. Click the **Choose** button, and from the list of operators, choose **Is false**. 7. Save the segmentation.
Decision Hub segmentation configuration for 700 customers with email marketing agreement
700 customers with email marketing agreement segmentation configuration
## Create a segmentation of 1250 customers --- Using the [the segmentation of 700 customers](#create-a-segmentation-of-700-customers) you created in the previous part of the process you will create a segmentation of 1250 customers [from the initial segmentation](#create-a-segmentation). This segment contains all customers with Client ID numbers above the value of the 1200th Client's ID with the exclusion of previously created segmentations. 1. Go to Decision Hub icon**Decision Hub > Segmentations**. 2. Duplicate [the segmentation of 700 customers you created in the previous part of the process](#create-a-segmentation-of-700-customers). 3. Rename the segmentation. 4. Change the **CLIENT_ID** operator to **More than**. 5. Save the segmentation.
Decision Hub segmentation configuration for 1250 customers with email marketing agreement
1250 customers with email marketing agreement segmentation configuration
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of each step directly in the Synerise Demo workspace: - [Segmentation of customers with marketing aagreement](https://app.synerise.com/analytics-v2/segmentations/2bc65c4b-6995-48d5-bd62-54b58cf1456f) - [Metric for 500 customers](https://app.synerise.com/analytics/metrics/b4a537e9-ba5a-4a23-ba07-bac195d47d01) - [Segmentation of 500 customers with marketing agreement](https://app.synerise.com/analytics-v2/segmentations/3ef7ceab-6dc3-42e8-bda8-524106e10083) - [Metric for 700 customers](https://app.synerise.com/analytics/metrics/f4a403cd-f7a7-4f11-93c4-00bb2821cbcf) - [Segmentation of 700 customers with marketing agreement](https://app.synerise.com/analytics-v2/segmentations/47422b14-4842-4b27-a109-ea8d1e0c7d40) - [Segmentation of 1250 customers with marketing agreement](https://app.synerise.com/analytics-v2/segmentations/b28da5bc-10ee-418f-9b14-5e707853ea73) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case does not generate any events. ## Read more --- - [Metrics](/docs/analytics/metrics) - [Segmentation](/docs/analytics/segmentations) # Integration with Accredible You can integrate a full-service digital credentialing solution, Accredible, with Synerise to issue digital certificates, diplomas, badges, and many other credentials to the users based on their profiles and activity in Synerise. This use case presents the integration used for the purposes of user certification in Synerise. The workflows include sending data of users who reached a certification level in Synerise to Accredible in order to issue their certificate and badge.
In this use case, we cover only the part of issuing the digital credentials.
Accredible integration
Accredible integration
## Prerequisites --- - Access to Accredible. - If you want to [trigger the workflow](/use-cases/integration-with-accredible#create-a-workflow) by occurrence of a custom event, you must add one in Synerise in **Data Modeling Hub > Events** and implement it in your application. You can read more about adding events [here](/docs/assets/events/event-definitions). - Create a schema that stores the certification questions in [Schema Builder](/docs/assets/schema-builder). ## Process --- In this use case, you will go through the following steps: 1. [Create credentials in Accredible](/use-cases/integration-with-accredible#create-credentials-in-accredible). 3. [Create a catalog](/use-cases/integration-with-accredible#create-a-catalog). 4. [Create a workflow](/use-cases/integration-with-accredible#create-a-workflow). 5. [Test](/use-cases/integration-with-accredible#testing) your integration. ## Create credentials in Accredible --- In this part of the process, in your Accredible account, create a group of credentials.
Groups in Accredible
Groups in Accredible
You can find the full documentation [here](https://help.accredible.com/how-do-i-create-a-group).
A group receives a unique identifier.
ID of the group
ID of the group
## Create a catalog --- In this part of the process, prepare a CSV file that contains Accredible group identifier and Synerise ID of the certificate level. Next, create a catalog to which you import the file. 1. Go to **Data Modeling Hub > Catalogs > Create new**. 2. Enter the name of the catalog.
Don't use diacritical letters and spaces.
3. Click **Import CSV**. If you prepared a CSV file in Excel, open it in a text editor to check whether commas are used as separators. If not, replace them with commas. 4. Upload the file by clicking **Upload file**. 5. In the **Order key** field, type the name of the column which values are treated as the key - `syneriseID`.
The value of `syneriseID` is the ID of the schema created as a part of [prerequisites](#prerequisites).
6. Complete the process by clicking **Import**. **Result**:
CSV file imported to catalog
CSV file imported to catalog
## Create a workflow --- In this part of the process, create a workflow that is triggered by receiving a certification. Then, a request is sent to Accredible to issue credentials for the user who received the required score. 1. In Synerise, go to **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. 3. As the first node, add **Profile Event**. In the configuration of the node, select the event that triggers the workflow. In this use case, it's a custom event - `certification.acquired`.
If it suits your business scenario, you may use default Synerise events, or instead of **Profile Event**, you may use the **Audience** node to trigger the workflow for the selected group.
4. Confirm the settings by clicking **Apply**. 4. Add the **Outgoing integration** to the workflow. In the configuration of the node: 1. Change the webhook type to **Custom**. 2. As the connection type, select **No authentication**. 3. Click **Select connection** and select a connection. If you want to create a connection, click **Add connection** and [create it](/docs/automation/actions/webhook-node#set-up-a-connection). 1. Select **Custom** and **no authentication**. 1. Enter the name of the node. 2. In the **Webhook name** field, enter the value of the `name` parameter of the event generated by this node. 3. In **Webhook event name**, click **Create event** and create a new event: 1. As **Name**, enter `accredible.userSent` 2. As **Display name**, enter `User sent to Accredible` 3. Select the **POST** method. 4. In the **URL** field, enter `https://api.accredible.com/v1/credentials`
You can find more information about this endpoint [here](https://docs.api.accredible.com/#tag/Credentials).
5. In the **Headers** section, use the following headers: - Set `Content-type` to `application/json`. - Set `Authorization` to `Token token=YOUR ACCREDIBLE API_KEY` 6. Enter the request body, you may reuse and modify the example request below according to your needs:
{
               "credential": {
                   "recipient": {
                       "name": "{{ event.params.firstName }} {{ event.params.lastName }}",
                       "email": "{% customer email %}",
                   "group_id":"{% set key = event.params.certificationId %}{% catalogitem.certificationList(key) %}{% set object = catalog_result %}{{ object.get('accredibleid')}}{% endcatalogitem %}"
               }
           }}
The example request contains three Jinjava inserts: 1. Customer's name sourced from Profile Event node, [read more about reusing information in nodes](/developers/inserts/automation) 2. Customer's email address according to the context 3. Reference to the catalog column You can read more about inserts in Automation [here](/developers/inserts/automation).
Configuration of the Outgoing Integration node
Configuration of the Outgoing Integration node
8. Confirm by clicking **Apply**. 9. Add the **End** node. 10. Click **Save&Run**.
Automation Hub workflow for sending certificates via Accredible integration
Final configuration of the workflow
## Testing --- 1. Use the API to send a test event and simulate a user completing a certification 2. Open the **Statistics** tab available in your workflow. 3. Click the **Outgoing Integration** node. If the **Entered** and **Executed** counters have incremented after you sent the test certification, your survey triggered the workflow and completed it. 4. Go to the profile of the test user, look for the `automation` event. Double-click it to see the details. If the `status` parameter is `200`, the workflow works.
Event generated on the customer's profile
Event generated on the customer's profile
You can use this webhook response to trigger further campaigns to the user as well as create analytical dashboards with clear information on how many users received their credentials. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of use case in Synerise Demo workspace: - [Catalog](https://app.synerise.com/assets/catalogs/200765) - [Workflow](https://app.synerise.com/automations/workflows/automation-diagram/d62c7285-1698-48a7-b5be-a6238679c78e) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 5 events per profile that completes the flow: `certification.acquired` (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), `accredible.userSent` (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Integration](/docs/automation/integration) # Mobile Push Campaign Targeting Local Customers for New Store Opening In this use case, mobile push campaign in the application is sent to customers located in a specific city (in our case Warsaw) to inform them about the opening of a new offline store. The message includes details about an exclusive, limited-time promotion: an extra 20% off for the first 50 customers who visit the store. This targeted approach not only builds excitement around the new location but also encourages immediate foot traffic by rewarding early visitors with a special discount. ## Prerequisites --- - [Implement Synerise SDK in your mobile application](/developers/mobile-sdk). - Implement mobile push notifications in your mobile application: - [iOS](/developers/mobile-sdk/configuring-push-notifications/ios), - [Android](/developers/mobile-sdk/configuring-push-notifications/android). - [Create a mobile push template](/docs/campaign/Mobile/creating-mobile-push). ## Process --- 1. [Create geoanalysis](/use-cases/mobile-push-offline-store#create-geoanalysis) that groups customers based on the specific location (in our case - Warsaw). 2. [Create a mobile push campaign](/use-cases/mobile-push-offline-store#create-a-mobile-push-campaign). ## Create geoanalysis --- As the first part of the process, create a geoanalysis that returns a list of customers who generated a [`session.start` event](/docs/assets/events/event-reference/web-and-app#sessionstart) (opened a mobile application) in a specific location (Warsaw). 1. Go to Decision Hub icon **Decision Hub > Geoanalytics**. 2. In the upper right corner of the map, click the **Add selection** button. **Result**: A box appears on the map. 3. To select the location for analysis, drag the box to a place on the map. 4. Adjust the size of the selected area by clicking, holding, and moving the borders of the selection. 4. To proceed to the settings, click **Go to analytics**. 4. To proceed to the settings, click **Go to analytics**. **Result**: You are redirected to the segmentation configuration form. The first step is already done for you - a `session.start` event with the geographical coordinates are already selected. The system selects the group of customers which performed this event in the location you selected. Out of the group selected this way, you can select customers who meet your conditions specified in the further steps. 5. Enter the name of the segmentation. 8. To create the next step in the segmentation, click the **and then...** button. 9. From the dropdown list, choose `page.visit`. 6. To determine the time range from which the data will be analyzed, click the [calendar](/docs/analytics/i_date-filters) icon, and choose **Lifetime**. 7. To complete the process, click the **Save** button. **Result**: When you save the segmentation based on geoanalytics, you can find it on the list of segmentations under the given name.
Example of geoanalytics
Example of geoanalytics
## Create a mobile push campaign --- Prepare a mobile push with information about the promotion. 1. Go to **Experience Hub > Mobile > Create new**. 2. Add a name and optionally the description for your campaign. 2. Choose **Simple Push**. 3. In **Device type**, choose **All**. 4. In **Audience** section, click the **Segments** and choose the segmentation created in the [previous step](#create-geoanalysis) based on the geoanalysis. 5. Click **Apply**. 6. In the **Content** section, click **Create message**. From the list of templates, select the one you prepared as a part of prerequisites. If you haven't done that, you can use the a predefined template from the folder or create your own one using the mobile push code editor, in such case, click **New template**. For more information on creating a mobile push templates, read [Creating mobile push templates](/docs/campaign/Mobile/creating-mobile-push-templates). 8. To use the template in the campaign, click **Use in communication**. 9. Set up your schedule in **Schedule** section. 10. Optionally send a test mobile push and add [additional parameters](/docs/campaign/Mobile/creating-mobile-push#define-additional-parameters) to the events generated by this mobile campaign. 11. To send your campaign, click **Send** .
Example of mobile push
Example of mobile push
## Check the use case set up on the Synerise Demo workspace --- You can check the [segmentation configuration](https://app.synerise.com/analytics-v2/segmentations/d3e88fb4-2cb0-48b4-a489-abb7d0b3efdc) and [mobile push campaign](https://app.synerise.com/campaigns/mobile-push/create/26129088-3b81-4f04-a15b-3499f3a4fcac) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`push.send`](/docs/assets/events/event-reference/mobile-push#pushsend) (~1), [`push.view`](/docs/assets/events/event-reference/mobile-push#pushview) (~1), [`push.click`](/docs/assets/events/event-reference/mobile-push#pushclick) (~1). ## Read more --- - [Configuring mobile notifications](/docs/campaign/Mobile/mobile_campaign) - [Creating geoanalytics](/docs/analytics/geoanalytics/creating-geoanalytics) # Send customers from Synerise to Custom Audience in Facebook Synerise enables you to collect data from various sources and create advanced analyses based on this data. In short, Synerise enables you to gain insights from your data as well as create segments. The power of Synerise is that not only it allows you to gather, process and analyze data but also it lets you reuse it in the external sources. In this use case, you will use the native Facebook integration in Automation Hub to send a group of customers who were active in the web and mobile channels during last 30 days to Custom Audience. ## Prerequisites --- - [Generate the system user access token in Facebook](https://developers.facebook.com/docs/audience-network/optimization/report-api/system-user/); as the `scope` value, select `ads_management`. - [Create Custom Audience in Facebook](https://developers.facebook.com/docs/marketing-api/reference/custom-audience/). ## Process --- To send Custom Audience, follow the steps listed below in the following order: 1. [Create a segmentation of customers](/use-cases/send-custom-audience-webhook#create-a-segmentation) who are the most active in the web and mobile channels during last 30 days. 2. [Create a workflow](/use-cases/send-custom-audience-webhook#create-a-workflow) in which you will send the group of customers to Custom Audience in Facebook. ## Create a segmentation --- As the first part of the process, create a group of customers who were active in the mobile and web channels during last 30 days. The segmentation includes only customers with an email address. In the further part of the process, this group will be exported to Custom Audience in Facebook.
You must always narrow down the segmentation to customers who have an email address or a phone number.
1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter a meaningful name of the segmentation. 3. Click **Choose filter**. 5. From the dropdown list, select the **session.start** event. 4. As the time range, set **Last 30 days**. 6. Click **Choose filter**. 7. From the dropdown list, select the **screen.view** event. 8. As the time range, set **Last 30 days**. 9. Click **Choose filter**. 10. From the dropdown list, select the **Email address** attribute. 11. As the logical operator, by clicking Boolean icon icon, select **Is true**. 12. Connect these conditions by the **And** operator. 13. Click **Save**.
The configuration of the segmentation
The configuration of the segmentation
## Create a workflow --- In this part of the process, create a workflow for the group of customers you created in the [previous step](/use-cases/send-custom-audience-webhook#create-a-segmentation). This workflow sends the group of customers to Custom Audience in Facebook. ### Choose the segmentation of customers 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. On the dashboard, click the plus icon. 3. From the dropdown list, select **Audience**. **Results**: The **Audience** node is added to the dashboard. 4. Double-click the node. **Result**: A pop-up appears. 5. Leave the **Run trigger** option at default. 6. Click the **Select segment** button. 7. From the dropdown list, select the [segmentation you created in the previous step](/use-cases/send-custom-audience-webhook#create-a-segmentation). **Result**:
The Audience node
The configuration of the Audience node
7. Click **Apply**. ### Configure the Facebook integration 1. Click the plus button on the **Audience** node. 2. From the dropdown list, select the **Add Profiles to Custom Audience** node. 2. Double-click the node. 2. From the **Select connection** dropdown list, select an existing connection which allows you to authorize in Facebook Ad. If you haven't established a connection yet: 1. At the top of the dropdown list, click **Add connection**. 2. In the **Access token** field, paste the token generated as a part of [prerequisites](/use-cases/send-custom-audience-webhook#prerequisites). 3. Click **Next**. 4. In the **Connection name**, enter the name of the connection (it will be only visible on the list of connections).
The connection can be re-used to any custom audience created in the Facebook Ad Account related to the token generated as a part of [prerequisites](/use-cases/send-custom-audience-webhook#prerequisites).
3. In the **API version** field, enter the Facebook API version according to the [Facebook documentation](https://developers.facebook.com/docs/marketing-api/audiences/guides/custom-audiences/). 5. From the **Identified type** dropdown list, select **Email**. 6. In the **Identifier source** field, enter `{{ client.email }}`.
You can read more about Jinjava tags in Automation Hub [here](/developers/inserts/automation).
4. In the **Audience ID** field, enter the ID of the Custom Audience to which you want to send your group of customers. **Result**:
The configuration of the Add Profiles to Custom Audience node
The configuration of the Add Profiles to Custom Audience node
6. Confirm by clicking **Apply**. ### Add the End node 1. Click the plus icon on the **Add Profiles to Custom Audience** node. 2. From the dropdown list, select **End**. 3. In the upper right corner, click **Save & Run**.
Automation Hub workflow for adding customer profiles to a Facebook Custom Audience via webhook
The final configuration of the workflow
4. Wait a few minutes for the response of the webhook. **Result**: An **automation** event is saved to the profiles of the customers. Then, go Facebook, to **Facebook Manager > Audiences** to check your Custom Audience.
A webhook response with 200 status on a profile of a test customer
A webhook response with the OK status (200) on a customer's profile
## What's next --- You can start creating personalized ads to your customers in Facebook. You can see your custom audience in **Facebook Manager > Audiences**. ## Check the use case set up on the Synerise Demo workspace --- You can also check the [segmentation configuration](https://app.synerise.com/analytics/segmentations/6474998d-d04a-40cd-866c-c0f484d9eae1) and [workflow configuration](https://app.synerise.com/automations/automation-diagram/36e343c7-9d80-4600-b2c4-8f92cab368ed) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 4 events per profile that completes the flow: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), `facebook.addToCustomAudience` (~1). ## Read more --- - [Automation inserts](/developers/inserts/automation) - [Automation Hub](/docs/automation) - [Creating segmentations](/docs/analytics/segmentations/creating-segmentations) - [Add Profiles to Custom Audience node](/docs/automation/integration/facebook/send-custom-audience) # AI search for blogs and articles AI Search is really helpful not only in ecommerce sites but also in searching for content e.g. in blogs. The main challenge which can be meet with the help of this search in blogs is optimizing the user experience, based on searched website content. It can increase the effectiveness of searching on your blog or any other website which is based on text content. ## Example of use - Synerise **Challenge** In our daily operations we use AI search in three main places on our website: - in our [help center](/) - in our [blog](https://synerise.com/blog) - in our [API documentation](https://hub.synerise.com/api-reference)
AI Search on the Synerise blog
AI Search on the Synerise blog
We have decided to make it as personalized as it is possible and to increase our user experience by making it more effective and easier-to-use. At the beginning, we had to prepare an inventory of the website so we can get all information gathered from each subpage, articles from the help center, methods from API Developers Section. Then we prepared a ranking formula and selected searchable attributes and defined their importance. Based on that we are able to display proper results based on searched words. ## Prerequisites --- To be able to implement this use case, you must: - [Create AI search](/docs/ai-hub/ai-search/introduction-to-ai-search). - [Prepare catalogs](/docs/assets/catalogs/creating-catalogs). ## Process --- To set up ai serach on your website, perform the steps in the following order: 1. [Create a catalog](/use-cases/ai-search-in-blog#create-a-catalog). 2. [Create AI search](/use-cases/ai-search-in-blog#create-ai-search). 3. [Add additional query rules](/use-cases/ai-search-in-blog#add-additional-query-rules). ## Create a catalog --- 1. Go to **Data Modeling Hub > Catalogs > New Catalog**. 2. Enter the name of the catalog and confirm it by clicking **Apply**. 3. Click the catalog on the list and choose **import CSV button**. 4. Click Upload file button and select the file to be uploaded, then confirm with button - **OK**. 5. In the Order key field, type the name of the column whose values are treated as the key.
Screenshot an example catalog
An example catalog looks like
Go to items of your website, which has one obligatory tag—the item ID. This individual ID indicates the content we want to show. Apart from that, the catalog can contain additional attributes which describe the content.
## Create AI search --- You can use AI Search for every case (Blog, Developers, Help Center). Each of them in our case was based on different attributes. 1. Go to AI Hub icon **AI Hub > Indexes**. 2. To select the data structure a search engine refers to while searching, click **Add index**. 1. In the **Index name** field, type the human-readable name of the index. 2. From the **Catalog** dropdown list, select an item catalog the search engine refers to. 3. Optionally, to let other users know about the purpose of the index, in the **Description** text field, add the description of the index. 4. Confirm by clicking **Save**. 3. Further configuration requires adjusing the settings in the **Ranking**, **Synonyms** and **Settings** sections. More information about creating AI search you will find in the video.
Click for video tutorial
What is ranking? | AI Search Engine | Synerise AI Growth Ecosystem
AI search can have different goals, depending on where we will implement it and on what database it will work.
--- Take a look at how it's working on Synerise websites. Below we present three examples. - **Synerise Blog** In the case of the Synerise Blog, we have information like: title, author name, author surname, description and category. That information was collected from our website and was used to prepare the AI search.
Screenshot ai search
Ranking formula for AI Search
- **Synerise Developers** In the developer section, we have some additional information that’s a little different than what we saw before. Here we have category, description, and item ID and links as well. But additionally, we have, for example, a method in which we want to send something to Synerise. We have also information about permissions for each method and additional information like service, tags and a title that describes those methods.
Screenshot presenting ai search
Ranking formula for AI Search
- **Synerise Hub** In the case of the Help Center, we have attributes like category, link, ID, title and description. But one additional thing is involved here – we have a table of contents. So, what you can find in each article is also described here.
Screenshot ai search
Ranking formula for AI Search
## Add additional query rules --- Based on query rules, in just a few steps you can decide that if somebody enters a query, you can replace it with a different phrase or also synonym and show in the search results a specific article. 1. Prepare such query rules in **AI Hub > Indexes** > choose index from the list **> Rules**. 2. Click **create new** in query rules and complete 3 sections: - Conditions - Consequences - Schedule
Screenshot presenting settings for AI search
Final settings for AI search
As an example, if somebody enters **onboarding** in the search box, we can prepare a rule that replaces this query with a new one (first steps)
## Generated events This use case generates approximately 2 events per profile that completes the flow: [`item.search`](/docs/assets/events/event-reference/search#itemsearch) (~1), [`item.search.click`](/docs/assets/events/event-reference/search#itemsearchclick) (~1). ## Read more --- - [AI Search](/docs/ai-hub/ai-search/introduction-to-ai-search) - [AI Search statistic](/docs/ai-hub/ai-search/ai-search-statistics) - [Catalogs](/docs/assets/catalogs/creating-catalogs) # Recommending complementary products to recently bought You can use AI to offer customers a personalized shopping experience by suggesting relevant, complementary products that they might like. You can send those recommendations, based on cross-sell algorithms that select complementary products based on those recently bought, in your email marketing campaigns. This use case describes how to prepare an automated workflow that sends an email with cross-sell recommendations. This use case uses an aggregate and AI cross-sell recommendations inserts in targeted customer communication. The workflow is triggered with `product.buy` event, and sends an email after a specific time period.
Example of communication for recommending complementary products to recently bought
## Prerequisites --- - [Configure AI engine](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). - [Create an email account](/docs/campaign/e-mail/configuring-email-account). ## Process --- In this use case, you will go through the following steps: 1. [Create an aggregate](#create-an-aggreagate). 2. [Prepare AI recommendations](#prepare-ai-recommendations). 3. [Prepare an email template](#prepare-an-email-template). 4. [Create a workflow](#create-a-workflow). ## Create an aggreagate --- In this step, create an aggregate that returns the SKU of the product a customer bought in the last 30 days. You will later use it as an insert in an email. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last**. 6. From the **Choose event** dropdown list, select the `product.buy` event. 7. From the **Choose parameter** dropdown list, select `$sku` parameter. 8. In the calendar in the right bottom of the page define the period from which the aggregate will return products from the event. 1. In this case, in the **Relative date range** section, click **Custom**, type 30 and from the the dropdown list, select **Days**. 2. Click **Apply**. 9. In the right upper corner, click **Save**. 10. Copy the aggregate ID from its URL to use in [Jinjava later](#prepare-an-email-template).
The view of the configuration of the aggregate with last bought productst
Configuration of the aggregate with last bought products
Cross-sell recommendations which you will add to the email template have to have the context of the product based on which the items in the recommendations can be selected. It is provided by the SKU retrieved from the `product.buy` event in the aggregate.
## Prepare AI recommendations --- In this part of the process, you will configure a cross-sell recommendation which will be later used in the email template. 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. Enter the name of the recommendation (it is only visible on the list of recommendation). 3. In the **Type & Items feed** section, click **Define**. 4. From the **Items feed** dropdown list, select an item feed. 5. In the **Type** section, choose the **Cross-sell** recommendation type. 6. Confirm the settings by clicking **Apply**. 7. In the **Items** section, click **Define**. 1. Click **Add slot**. 2. Define the minimum and maximum number of items that will be recommended to the user in each slot. 3. Optionally, define [Static filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#static-filters) and [Elastic filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#elastic-filters). 4. Confirm by clicking **Apply**. 8. Optionally, you can define the **Boosting** factors and settings in the **Additional settings** sections. 9. In the right upper corner, click **Save**. 10. Copy the recommendation ID from its URL to use in [Jinjava later](#prepare-an-email-template). ## Prepare an email template --- In this part of the process, you will create an email template with a Jinjava code that contains the IDs of the [aggregate](#create-an-aggreagate) and the [recommendation](#prepare-ai-recommendations) you created in the previous steps. 1. Go to Experience Hub icon **Experience Hub > Email > Templates**. 1. To create a new template, click **Create new**. 2. To create a template out of an existing template, click **From template**. 2. Select the template. 3. Select the wizard: 1. **Drag&drop** builder - Create email templates with ready-made components. 2. **Code editor** - Create email templates in CSS and HTML. 4. To add the dynamic part to the email template (last bought product and AI recommendations), you use Jinjava and add your own CSS. Below you can find an example Jijnava code.
Check the Jinjava code
<!-- Opening the tag that retrieves the value from the aggregate prepared in step 1--> {% aggregate 6b009acf-d86a-3ac6-b299-cb3c5d64c04f %} <!-- Assign an aggregate value to skuValue --> {% set skuValue = aggregate_result[0] %} <!-- Referencing with the help of variable to the snrs-product-ogTag directory built by default from OG tags. The variable names depend on the name of the OG tags on your page --> <div class="wrapper-card"> <h2 style="text-align:center">Product Card</h2> <div class="card"> <img src="{% catalog.Snrs-produktu-ogTag(skuValue).og:image %}" alt="Product image" style="width:100%"> <h1>{% catalog.Snrs-produktu-ogTag(skuValue).product:brand %}</h1> <p class="price">$ {% catalog.Snrs-produktu-ogTag(skuValue).product:price:amount %}</p> <p>{% catalog.Snrs-produktu-ogTag(skuValue).og:title %}</p> <p><button>Add to Cart</button></p> </div> </div> <!-- Adding the skuValue variable to the array for which we will retrieve cross-sell products --> {% set itemContext = [] %} {% do itemContext.append(skuValue) %} <!-- Downloading the cross-sell campaign for the product in the table --> {% recommendations3 campaignId=tFwEUKvZLj4d itemsIds=itemContext %} <!-- Iterating loop through the received products --> {% for item in recommended_products3 %} <!-- Listing the attributes assigned to the product in the feed --> <div class="wrapper-card" style="width:25%;float:left"> <h2 style="text-align:center">Product Card</h2> <div class="card"> <img src="{{ item.imageLink }}" alt="Product image" style="width:100%"> <h1>{{ item.brand }}</h1> <p class="price">$ {{ item.priceValue }}</p> <p>{{ item.title }}</p> <p><button>Add to Cart</button></p> </div> </div> {% endfor %} {% endrecommendations3 %} <!-- Closing of the tag that gets the value from the aggregate prepared in point 1 --> {% endaggregate %}
You will find more about email templates in [this article](/docs/campaign/e-mail/creating-email-templates).
## Create a workflow --- To start sending emails with the recommendation to customers prepare a workflow, which in basic configuration may look like the one below. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. 3. As the first node, add **Profile Event**. In the configuration of the node, select the event that triggers the workflow. In this use case, it’s a `product.buy` event. 4. As the second node, add **Delay**. In the configuration of the node, set the period according to your business needs. 5. As the next node, add the **Send Email** node. 6. In the **Send Email** node configuration: 1. In the **Sender details**, define the account from which the email will be sent. 2. In the **Content** section: 3. Enter the subject of the email which will be visible in the customer’s inbox. 4. Select the email template created in [the previous step](#prepare-an-email-template). 5. Optionally, you can add UTM and URL parameters. 7. Confirm by clicking **Apply**. 8. Add the **End** node to finish the workflow. 9. Optionally, you can set up the capping for this workflow based on your business needs. 10. Click **Save & Run**.
The view of the configuration of the workflow
Workflow configuration
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of use case in Synerise Demo workspace: - [Aggregate](https://app.synerise.com/analytics/aggregates/6b009acf-d86a-3ac6-b299-cb3c5d64c04f) - [Email template](https://app.synerise.com/campaigns/email/content-manager/template/153786) - [Recommendation](https://app.synerise.com/ai-v2/recommendations/tFwEUKvZLj4d) - [Workflow](https://app.synerise.com/automations/workflows/automation-diagram/be21803b-2ad4-4c96-b1a2-d5d9cad0e644) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 9 events per profile that completes the flow: [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~2), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Automation Hub](/docs/automation) - [Jinjava inserts](/developers/inserts) - [Recommendations](/docs/ai-hub/recommendations-v2) # Report with top purchased products per store Tracking top purchased products for each store offers a valuable way to understand customer behavior and optimize product exposure. This use case shows how to generate daily reports that calculate and display the 10 best-selling products for every individual store (represented as profiles in the CRM), based on transaction data. The report is created dynamically and filtered with flexible business rules. Once generated, these results can be used for many purposes, for example: – you might send the top products to an external tool and display them as personalized banners in a given store or use them in targeted campaigns. - top-product reports can be used to adjust local inventory planning. - items that perform well in a particular store can be positioned more prominently. - you can create discounts offers based on each store's top performers. Knowing what sells best in each store gives you an edge – not just for backend analytics, but for improving the customer journey. You can **highlight bestsellers on local pages, power in-store digital signage, or inform stock planning**. It enables better personalization and relevance across channels and improves business responsiveness to customer demand in specific locations. This specific use case was used by our customer to present top 10 products per store in digital signage in offline stores. Displaying top-performing products on screens inside the store draws customer attention to popular items, reinforces social proof, and can drive impulse purchases. ## Prerequisites --- - [Implement a tracking code](/docs/settings/tool/tracking_codes). - Implement the [transaction events](/developers/web/transactions-sdk). Your transactions must be properly tracked and include identifiers of the shop (`StoreId`) to enable product-level reporting. - Stores must be created as individual profiles in the CRM. Every store profile must include a `StoreId` parameter – this should be a unique identifier for each store. It is required to group transaction data and generate reports per store. Additionally we assign [profile tags](/docs/crm/customer-tag) to all stores (in our case, `store-top-products`) to make it easier to find and extract them. To correctly identify the store in the system: - Add a `custom_identify` field to the store’s profile with the same value as `StoreId`. In the Synerise platform, this will appear as Custom identifier. - You can use Jinjava that references a store through the `custom_identify` parameter (for example, when sending events through an outgoing integration). This setup ensures consistent and reliable store identification across processes. - Create a workspace [API Key](/docs/settings/tool/api) and assign the following permissions: - `ANALYTICS_BACKEND_REPORT_READ` - it lets you [retrieve a summary of all reports in the workspace](https://hub.synerise.com/api-reference/analytics-suite#operation/previewAllGroupingsCSVPOST_v4). Make sure the API Key used for sending events has the necessary event send permissions enabled. - `API_BATCH_EVENTS_CREATE` ## Process --- In this use case, you will go through the following steps: 1. [Create a metric](/use-cases/report-with-top-products#create-a-metric) which counts the number of transactions for each store. Thanks to setting a dynamic key, in the following steps we will be able to properly filter events within a given store. 2. [Create a report](/use-cases/report-with-top-products#create-a-report) based on the metric created earlier, which lists the top 10 purchased products per store. 3. [Create a workflow](/use-cases/report-with-top-products#create-a-workflow) that dynamically refers to the report, retrieves the top 10 products for each store based on defined business conditions (e.g., availability), and generates an event for each top product on the profile card of each store. 4. [Create a final metric](/use-cases/report-with-top-products#create-final-metric) based on events generated in the workflow. 4. [Create final report](/use-cases/report-with-top-products#create-final-report) based on the metric whose conditions are built on the events generated in the workflow. ## Create a metric --- In this part of the process, create a metric which counts the number of transactions for each individual store. 1. Go to Decision Hub icon **Decision Hub > Metrics > New metric**. 2. Enter the name of the metric. 3. As a metric kind, select **Simple metric**. 4. As the metric type, select **Event**. 3. As the aggregator, set **Count**. 4. As the occurrence type, set **All**. 5. From the **Choose event** dropdown list, select `product.buy`. 6. Click **+ where** button and from the dropdown list, choose `StoreId` parameter. 7. From the **Choose operator** dropdown, select **Contain (String)**. 8. Click the icon next to the **Equal** operator two times to find dynamic key icon Dynamic key icon 9. In the first box add `StoreId` and in the second add any value (in our case it might be `0`). 10. Define the period from which the metric will return products from the event as **7 days**. 11. Click **Save**.
Metric settings
Metric settings
## Create a report --- In this part of the process, create a report to clearly show the list of top products purchased in the shops. 1. Go to Behavioral Data Hub icon **Decision Hub > Report > New report**. 2. Enter the name of the report. 3. Select the metric you created in [the previous part of the process](/use-cases/report-with-top-products#create-a-metric). 4. From the **Range** dropdown list, select the number of top (the most frequently added to favorites) products to be shown in the preview of the report. In this case it will be **TOP 100** products.
When creating a consolidated report of top-selling products across multiple stores, it is recommended to retrieve more than just the top 10 products (e.g., top 100 or more). This is because the combined list of bestsellers does not always reflect the top 10 products in each individual store. Some products that rank in the top 10 in specific stores might not appear in the overall top 10 list. By increasing the number of products included in the report, you ensure that local top-performing items are not missed and that it's possible to accurately identify the top 10 for each store.
5. In the **Dimension** section, from the dropdown list select **Events > Parameters**. To be able to show products name in the report, choose `$name`. 6. Click **Add dimension**. 7. From the list, choose `$sku`. 8. Below, add additional dimension - `StoreId`.
In this particular use case, we use three dimensions: name, storeID and SKU. This way, we will receive the SKU and name of the products in the report and information in which shop it was bought. You can use any number of dimensions based on your business needs.
6. In the date range, select the time that will be analyzed. In this case it will be **7 days**.
Select the same date range as you selected for the metric.
7. Save the report.
Report settings
Report settings
## Create a workflow --- In this part of the process, you will create the workflow which sends an event with the current top 10 products from each store. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Add the Audience node In this step you will create the audience who will get the report you have created. 2. From the list of available triggers, select **Audience**. 3. Click the node. 4. Set the **Run trigger** to repeatable. 5. Define the frequency of launching the workflow (the **Interval** field) and when your workflow will be launched for the first time (the **Begin at** field). 4. In the **Define audience**, select the **New audience**. Choose the tag used to extract the group of stores - `store-top-products` created as a part of [prerequisites](#prerequisites). 5. As the parameter choose **Is true**. 5. Click **Apply**.
The Audience node settings
The Audience node settings
### Add the Outgoing Integration node This webhook will be used to get the storeID from the report created in the [previous step](#create-a-report). We send here all top products, ID of the store and products. We will make a request to [this endpoint](https://hub.synerise.com/api-reference/analytics-suite#tag/Reports/operation/analytics2-recalculate-report-override).
This step uses a webhook to automatically retrieve the contents of the report via API, based on the store’s ID. This is necessary because: - reports in Synerise are calculated dynamically, - store-specific filtering must happen at runtime, per each store profile in the audience, - the API enables automation – instead of downloading and filtering data manually, each store profile receives its own filtered results based on the same report definition. This makes the workflow scalable across hundreds of stores, ensures daily updates, and avoids manual effort.
1. Select the **Custom webhook** tab. 7. Select the method of authorization as **Synerise API key**. 2. Click **Select connection**. 3. From the dropdown list, select the connection. - If no connections are available or you want to create a new one, see [Create a connection](/docs/automation/integration/azure-blob-storage/get-file-azure-blob-storage). - If you selected an existing connection, proceed with the integration settings. 2. In the **Webhook name** field, enter `ReportTopProducts`. 4. Click on the **Event name** and choose **Create event** 5. In **Name**, enter `topProducts.webhook`. 6. In **Display name**, enter the label for the event. 3. Select the **POST** method. 4. Enter the endpoint: `https://hub.synerise.com/api-reference/analytics-suite#tag/Reports/operation/analytics2-recalculate-report-override` - Replace with the unique ID of your own report. You can find the report ID in the URL when you open the report in Synerise (e.g., https://app.synerise.com/analytics/reports/32bf9328fb8). 4. Leave the **content-type** at default (`application / json`). 5. In the request body, paste the code presented below.
Check the examplary JSON body of the report
{ "variables": [ { "name": "storeId", "value": "{ customer storeId %}" } ] }
If you want to send more information about the products and transactions, just add them to the code on your own, based on your business needs.
8. From the dropdown list, select the API key you created as a [part of prerequisites](#prerequisites). 7. Click **Apply**.
Automation Hub Outgoing Integration node configured as a webhook to trigger Analytics Suite report recalculation
Webhook settings
### Define the Event Filter node --- This node will wait for the webhook response. 1. As the next node, add **Event Filter**. In the configuration of the node: 1. Add the name of the node. 2. Set the **Check** option to **for period of time**. 2. Set the time range. In our case, it is **10 minutes**. 3. In the **Define conditions** section, from the **Choose event** dropdown menu, choose `topProducts.webhook` event. 4. Confirm by clicking **Apply**.
Event Filter node settings
Event Filter node settings
### Add the Outgoing Integration node To the **matched path** add the Outgoing Integration. In this node, we retrieve the results from reports generated by previous nodes in the workflow. The goal is to extract relevant product data (like SKU, name, URL, price, and brand) and construct a structured event that can be used downstream — for example, in product recommendations or messaging flows. 1. Select the **Custom webhook** tab. 7. Select the method of authorization as **Synerise API key**. 2. Click **Select connection**. 3. From the dropdown list, select the connection. - If no connections are available or you want to create a new one, see [Create a connection](/docs/automation/integration/azure-blob-storage/get-file-azure-blob-storage). - If you selected an existing connection, proceed with the integration settings. 2. In the **Webhook name** field, enter `Top products per store`. 4. Click on the Event name and choose **Create event** 5. Add the new event. 4. As the event name add `topBoughtProducts.perStore`. 6. In **Display name**, enter the label for the event. 3. Select the **POST** method. 4. Enter the endpoint: `https://hub.synerise.com/api-reference/data-management#tag/Events/operation/BatchSendEvents` 4. Leave the **content-type** at default (`application / json`). 5. In the request body, paste the code presented below.
Check the examplary JSON body of the report
{# Here we retrieve the results of reports from previous nodes #} {% set raport1 = automationPathSteps['data1'].event.params['body.data[0].values[0]'] %} {% set allRaports = [raport1] %} {# We iterate over retrieved reports and add arrays of skus of products from them to the skusArrays #} {% set skusArrays = [] %} {%- for raport in allRaports -%} {% set arr = [] %} {%- for entry in raport -%} {% do arr.append(entry.name[0]) %} {%- endfor -%} {% do skusArrays.append(arr) %} {%- endfor -%} {% set finalArr = [] %} {%- for skuArr in skusArrays -%} {%- for sku in skuArr -%} {%- if finalArr|length < 10 -%} {% catalogitemv2.store-1(sku) allowEmpty=True %} {% set prod = catalog_result %} {%- if prod.name and prod.brand -%} {#Here we can add conditions to check#} {%- do finalArr.append({ 'sku': sku, 'name': prod.name, 'productUrl': prod.productUrl, 'price': prod.price, 'brand': prod.brand.label }) -%} {%- endif -%} {% endcatalogitemv2 %} {%- endif -%} {%- endfor -%} {%- endfor -%} {% set data = [] %} {# Here we set the final object to send #} {%- for promotion in finalArr -%} {% do data.append({ "client": { "customId": "{% customer StoreId %}" }, "label": "Magic products", "action": "magic.products", "type": "custom", "params": promotion, }) %} {%- endfor -%} {# We convert the object to JSON and this is the body of our request #} {% if data|length > 0 %} {{ data|tojson }} {% else %} {{ [{ "client": { "customId": "{% customer StoreId %}" }, "label": "Magic products", "action": "magic.products", "type": "custom", "params": { "alert": "No products matched the conditions" } }] | tojson }} {% endif %}
This part of the workflow processes the top products per store: - It retrieves the list of SKUs from the report results (fetched via the webhook from the previous step). - For each SKU, it queries the catalog feed to enrich the product data with: additional parameters like e.g. name, price, brand, etc. - It builds an array of up to 10 enriched product items, skipping those that are incomplete (e.g., missing name or brand). - This webhook generates a custom event with action top.products, containing enriched product data (sku, name, price, etc.). This event becomes the source for the final metric and report that summarize the top products per store. It is also ready to be used in other systems (e.g., digital signage, product recommendations, banners, etc.).

Once the product data is collected, it’s structured into a standardized event format, with fields like label, action, type, and params, making it suitable for downstream use—such as powering features like **top.boughtproducts.perStore**.

As a safeguard, if no valid product data is found (for example, due to empty results or filtering logic), the system includes a clear message in the output indicating that no products were available, allowing for graceful fallback handling in the display or integration logic. 7. Click **Apply**.
Automation Hub Outgoing Integration node configured as a webhook to generate a custom event with enriched top products data
Webhook settings
### Prepare the final settings --- 1. Add the **End** nodes. 2. Optionally, define capping. 3. Optionally, add titles to each node so the workflow will be more understandable to your colleagues. 4. Activate the workflow by clicking **Save & Run**.
Workflow settings
Workflow settings
## Create final metric --- In this part of the process, create the metric based on the events generated in the workflow. 1. Go to Decision Hub icon **Decision Hub > Metrics > New metric**. 2. Enter the name of the metric. 3. As a metric kind, select **Simple metric**. 4. As the metric type, select **Event**. 3. As the aggregator, set **Count**. 4. As the occurrence type, set **All**. 5. From the **Choose event** dropdown list, select `top.products`. 6. Click **+ where** button and from the dropdown list, choose `sku` parameter. 7. From the **Choose operator** dropdown, select **Is not empty**. 6. In the date range, select the time that will be analyzed. In this case it will be **7 days**. 11. Click **Save**.
Metric settings
Metric settings
## Create final report --- As the last step, create the final report, presenting the results of the report, created based on the events generated in workflow. 1. Go to Behavioral Data Hub icon **Decision Hub > Report > New report**. 2. Enter the name of the report. 3. Select the metric with top products you created in [the previous part of the process](#create-final-metric). 4. From the **Range** dropdown list, select the number of top (the most frequently added to favorites) products to be shown in the preview of the report. In this case it will be **TOP 100** products. 5. In the **Dimension** section, from the dropdown list select **Events > Parameters**. To be able to show products name in the report, choose `sku`. 6. Click **Add dimension**. 7. From the list, you can choose more dimensions - in our case it will be `brand` and `customIdentify` 6. In the date range, select the time that will be analyzed. In this case it will be **7 days**.
Select the same date range as you selected for the metric.
7. Save the report. 8. Click preview to see the results.
Report settings
Report settings
## What's next --- Information from this report might be used in the following campaigns: 1. **Integrate with in-store digital signage systems** Once the daily top 10 product reports per store are generated, the data can be automatically pushed to digital signage platforms. This enables real-time, localized content that reflects actual customer behavior in each specific store. Set up automated workflows to refresh signage content daily or as frequently as needed, ensuring that each store highlights its current bestsellers without manual intervention. 2. **Support merchandising decisions** Use these insights to test different product placements and monitor their performance visually and analytically, linking digital presentation with physical outcomes. 3. **Extend to omnichannel experiences** Consistent messaging across in-store signage, local landing pages, and mobile apps builds a seamless customer journey, with top products tailored to the customer's location. You’re free to use it however you like—whether that means simply downloading it or sending it to other tools for external analysis. There are a few ways to handle this: - You can also export it as a file. - You can send the data to an API. - You can use our existing nodes and integrations to forward it to other tools—depending on the number of products, certain requirements may apply. In such cases, we recommend getting in touch with our CSI team if you plan to process the data externally.
Each method has its own limitations and constraints, so please remember to contact our CSI team beforehand to avoid issues.
## Check the use case set up on the Synerise Demo workspace --- You can check the [metric](https://app.synerise.com/analytics/metrics/e45130c3-8015-4e18-acb7-6d93e09182d4), [report](https://app.synerise.com/analytics/reports/71161920-de46-4d23-a0c6-4d3073f44cca) and [workflow configuration](https://app.synerise.com/automations/workflows/automation-diagram/552bdef6-6980-48f6-8398-eea112320e9f), [final metric](https://app.synerise.com/analytics/metrics/4d04834f-fda1-4dce-af5f-3160d5071d8d) and [final report](https://app.synerise.com/analytics/reports/63d98cfc-cacf-4f6c-a656-1134a5d9d076) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 17 events per profile that completes the flow: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), `topProducts.webhook` (~1), `topBoughtProducts.perStore` (~1), `magic.products` (~10). ## Read more --- - [Automation Hub](/docs/automation) - [Metrics](/docs/analytics/metrics) - [Reports](/docs/analytics/reports) # Web push with recommended products Web push messaging is an effective form of communication that allows businesses to communicate directly with people who visit their website, even when they are not actively using it. Compared to other forms of communication, web push notifications allow you to deliver concise, clickable messages directly to users' devices, making them an ideal channel for delivering product recommendations and driving traffic back to your website.
Web Push notification with two action buttons
This campaign is targeted at all users and includes additional action buttons that direct them straight to a page to the product card or to a dedicated page with a list of recommendations. ## Prerequisites --- - [Configure an item catalog for recommendations](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). Enable personalized recommendations. - [Import your product feed to AI engine](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). - [Configure web push notifications](/docs/campaign/Webpush/configuring-web-push) - Create a workspace [API Key](/docs/settings/tool/api) with the permission - API_CUSTOM_EVENTS_CREATE. ## Process --- In this use case, you will go through the following steps: 1. [Create a personalized recommendation campaign](/use-cases/webpush-with-recommended-products#create-personalized-recommendation-campaign). 2. [Create a webpush template](/use-cases/webpush-with-recommended-products#create-a-web-push-template). 3. [Prepare a workflow](/use-cases/webpush-with-recommended-products#create-workflow) that creates an event with recommended products and sends a web push to customers who receive any recommendation in the campaign. ## Create personalized recommendation campaign In this part of the process, you will create a personalized recommendation campaign, the ID of which will later be used during [workflow creation](/use-cases/webpush-with-recommended-products#create-workflow). 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. Enter the name of the recommendation (it is only visible on the list of recommendations). 3. In the **Type & Items feed** section, click **Define**. 4. From the **Items feed** dropdown list, select a product feed that has a trained model. 5. Select the **Personalized** recommendation type. 6. Confirm the recommendation type by clicking **Apply**. 7. In the **Items** section, click **Define**. 8. Click **Add slot**. 9. Click the **Unnamed slot** that was created. 10. Set the minimum and maximum number of products displayed in the frame to 1. 11. Optionally, you can use filters to include specific items in the recommendation frame. 12. Confirm the configuration by clicking **Apply**. 13. Optionally, you can define the settings in the **Boosting** and **Additional settings** sections.
Learn more about [boosting](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#define-the-boosting-factors) and [additional settings](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#additional-settings).
14. Click **Save**.
AI recommendation configuration
AI recommendation campaign configuration
## Create a web push template --- In this part of the process, you will create a web push template with recommended products with two action buttons. The first button links to the product card and the second to the list of recommended products. 1. Go to Experience Hub icon **Experience Hub > Web Push > Templates > New template**. 2. Enter the name of the template. 3. In the **Title** field, define the title you want to display in the web push. 4. In the **Message** field, define the copy you want to appear in the web push. In our case it will be an insert with product title: `{{ event.params.title }}` 5. In the **Destination URL** field, define the link you want to redirect your customers by clicking the web push notification. In our case, it will be link to the homepage: `https://demoshop.synerise.com/` (clicking the web push will redirect to homepage, action buttons will redirect to more specific pages). 6. In the **Icon URL** field, define the icon you want to display in the web push. 1. To get the URL of the icon, go to Data Modeling Hub icon **Data Modeling Hub > Files**. 2. Find the icon on the list. 3. Hover the mouse cursor over the icon on the list. 4. Click **Copy URL**. 5. Paste the URL in the **Icon** field. 7. In the **Image URL** field, define the image you want to display in the web push. In our case it will be an insert with product image: `{{ event.params.imageLink }}` 1. To get the URL of the image, go to Data Modeling Hub icon **Data Modeling Hub > Files**. 2. Find the image on the list. 3. Hover the mouse cursor over the image on the list. 4. Click **Copy URL**. 5. Paste the URL in the **Image** field. 8. Select **Action button** and to add two buttons to your web push template by clicking **Add item** twice. In the button's settings: 1. The first button link to product card. In the **URL** field, paste the following insert: `{{ event.params.link }}` and in the **Button Label** field, enter the text on the first button. 2. The second button links to a listing of product recommendations. In **URL** field, paste the link to the listing. In our case, it's `https://demoshop.synerise.com/product-personalized-listing` and in the **Button Label** field, enter the text on the second button.
To create a page with a list of recommended products, please refer to the [Creating section recommendations](/docs/ai-hub/recommendations-v2/creating-section-recommendations) article.
9. Save the template clicking the button **Save as**, and choose the folder where the template will be saved. 10. Confirm by clicking **Save**. ## Create workflow --- In this part of the process, create a workflow that will be triggered by the `session.end` event and create an event with the recommended products that you will refer to in the webpush template. If the customer receives any recommended products in the event, then a webpush message will be sent. ### Define the Profile Event trigger node At this stage, configure conditions that launch the workflow. As a trigger, we will use the `session.end` event. 1. As the first node of the workflow, add **Profile Event**. In the configuration of the node: 1. From **Choose event** dropdown menu, choose `session.end` event. 2. Confirm by clicking **Apply**. ### Define the Outgoing Integration node In the **Outgoing Integration** node, create a webhook that will generate event with recommended products. In our case it is a `webpush.recommendation` event. 1. After the trigger node, add **Outgoing Integration**. 1. Choose the authentication method. In our case, it will be **API key**. 2. Click **Add connection**, and on the pop-up, enter the name of the connection and from the dropdown list, select the API Key created as a part of prerequisites. 2. Click **Apply**. 3. In the **Webhook name**, field enter a name for the webhook. In this case `Webpush recommendation`. 4. Select the **POST** method. 3. In the URL of the endpoint, enter `https://api.synerise.com/v4/events/custom`. 5. Leave **content-type** at default: `application/json`. 6. Click **Add header**. 7. Add **Api-Version** with the value set to `4.4` 8. Enter the request body. For the sheet used in this case, the body is as follows:
{% recommendations3 campaignId=nBzlR4BQtyvD %}
       {% set item = recommended_products3[0] %}
   {
     "label": "Webpush recommendation",
     "client": {
       "id": {{ customer.id }}
     },
     "action": "webpush.recommendation",
     "params": {
       "title": "{{ item.title }}",
       "imageLink": "{{ item.imageLink }}",
       "link": "{{ item.link }}"
     }
   }
   {% endrecommendations3 %}
Where: - The `campaignId=nBzlR4BQtyvD` is the Id of the recommendation campaign you created earlier [in this step](/use-cases/webpush-with-recommended-products#create-personalized-recommendation-campaign). - All params contain information about recommended product are used in the [webpush template](/use-cases/webpush-with-recommended-products#create-a-web-push-template). 6. Click **Apply**.
The view of the Outgoing Integration node configuration
Configuration of the Outgoing Integration node
### Configure the Event Filter node This node will set the workflow to wait for 2 minutes for the creation of a `webpush.recommendation` event for the client. If a customer has not received any recommended products in the event, the workflow ends. However, if a customer receives any recommended products in the event, the workflow goes to the next step, in which a web push will be sent to that customer. 1. As the next node, add **Event Filter**. In the configuration of the node: 1. In the **Check** field, from the dropdown menu choose **for period of time**. 2. Set the time range. In our case, it is 2 minutes. 3. In the **Define conditions** field, from the **Choose event** dropdown menu, choose `webpush.recommendation` event. 4. Click the + where button, from the **Choose parameter** dropdown menu, choose **title**. 5. From the **Choose operator** dropdown, choose **Regular expression**. 6. As the value, enter `.+`
The `.+` value means at least 1 character. This excludes events where the item title is empty, meaning there is no recommended item.
2. Confirm by clicking **Apply**. 3. At the **Not Matched** path, add the **End** node . ### Configure Send Web Push node In this part of the process you will define the Webpush message to be sent. 1. To the **Matched** path, add **Send Web Push**. In the configuration of the node: 1. In the **Content** section, from the **Webpush template** dropdown, select [the template you created in the previous step](/use-cases/webpush-with-recommended-products#create-a-web-push-template). 2. In the **Schedule** section, set the **Webpush lifespan (TTL)** according to your business needs. 3. You can describe campaigns with [additional parameters](/docs/campaign/Webpush/creating-webpush-campaigns#adding-custom-parameters). 2. Click **Apply**.
Configuration of the Send Configuration node
Configuration of the Send Configuration node
### Add the finishing node 1. Add the **End** node. 2. In the upper right corner, click **Save & Run**.
Automation Hub workflow for sending web push notifications with recommended products
The workflow configuration
## Check the use case set up on the Synerise Demo workspace --- You can check the all the configurations directly in Synerise Demo workspace: - [Personalized recommendation campaign](https://app.synerise.com/ai-v2/recommendations/nBzlR4BQtyvD) - [Workflow](https://app.synerise.com/automations/automation-diagram/e02a94cc-dc7c-4df3-9ef3-e03c64d90307) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 11 events per profile that completes the flow: [`session.end`](/docs/assets/events/event-reference/web-and-app#sessionend) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), `webpush.recommendation` (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`webpush.send`](/docs/assets/events/event-reference/webpush#webpushsend) (~1), [`webpush.show`](/docs/assets/events/event-reference/webpush#webpushshow) (~1), [`webpush.click`](/docs/assets/events/event-reference/webpush#webpushclick) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Jinjava inserts](/developers/inserts) - [Recommendations](/docs/ai-hub/recommendations-v2) - [Web push](/docs/campaign/Webpush) # Transform and import customers' data to Synerise Automation capabilities in the area of data transformation can be used to update and change large amounts of data in a fast, advanced way, eliminating the process of manually adjusting the whole file. All transformations are performed on a sample file in desired format. In this use case, you will find out how to transform and import customer data from a `.JSON` file with data transformation and workflows. In this use case, you will make the following modifications to the sample file: - Edit values: - replace the value of the `city` attribute from blank to `unknown`; if the `city` attribute is defined, keep the existing city, - replace the `en`, `es`, `fr` values of the `language` attribute with `English`, `Spanish`, `French`, respectively, - replace the value of `payment_cash` and `payment_online` attributes from `1`/`0` to `cash`/`Null` and `online`/`Null`. - Merge `payment_cash` and `payment_online` attributes into the `payment_info` attribute. ### Input data in use case In this use case, we use two files: - the complete `.JSON` file with your customer database. Make sure you include one of the required parameters: `clientID, uuid, email, customId`. The only requirement for JSON files is that they must be UTF-8 encoded. - Prepare a sample JSON file with data you want to import. Below you will find an example how such a a file can look.
Example JSON file might look like this
{ "email": "test@test.com", "city": "", "language": "fr", "payment_cash": "1", "payment_online": "0" }, { "email": "test2@test.com", "city": "New York", "language": "en", "payment_cash": "0", "payment_online": "1" }
If your data is complete, you can skip transforming data. But if you need to modify the file with data before an import to Synerise, you can modify the data in **Automation Hub > Data Transformation**. To do so, create a sample of your data and include all attributes you want to modify. If you miss the attributes in the sample file, but import the actual data with them, the data will be imported as delivered in the actual file.
## Process --- 1. [Prepare data transformation rules](#create-data-transformation-rules) to transform the data in the file. 2. [Prepare a workflow](#prepare-a-workflow) to import the `.JSON` file to Synerise. ## Create data transformation rules --- In this part of the process, you define the rules of modifying data before sending it to Synerise, so the data is consistent. Each of the following sub-steps describes the individual changes performed on the file. 1. Go to Automation Hub icon **Automation Hub > Data Transformation > Create transformation**. 2. Enter the name of the workflow.
Before you proceed with selecting sample data and defining transformation rules, optionally, you can select a goal to help you structure the data. If you want to create a transformation diagram without a specific goal and you know the structure of the output data, skip this step. Goals will suggest you the required fields needed to perform the import into Synerise.
### Add input data This node allows you to add a data sample. In further steps, you define how the data must be modified. Later, when this transformation is used in the workflow, the system uses the rules created with the sample data as a pattern for modifying actual data. 1. Click the **Add input** node on the canvas. 2. On the pop-up, click **Upload a new file or drag one here**. 3. Upload the `.JSON` file. 4. You can preview the file, then click **Apply**. **Result:** The **Data input** view is filled with data from the sample.
Data input of the sample file  class=
Data input of the sample file
### Handle missing data In this part of the process, you will use the **Edit values** node to edit the `city` attribute values with Jinja code to keep the existing city and add the `unknown` value to the blanks. 1. Add the **Edit values** node. 2. In the configuration of the node: 1. Click **Add rule**. 3. Click **Add column**. 4. Select the `city` column. 4. Under **Edit values by**, from the dropdown list, select **Replacing**. 5. Under **with**, from the dropdown list, select **Dynamic value**. 6. In the **Type value** field, paste the following Jinja code:
{% if root["city"] != "" %}{{ root["city"] }}{% else %}unknown{% endif %}
The view of the configuration of the Edit values node
The configuration of the Edit values node
As a result, in the **Output data** tab, you will get an updated file:
Output data after applying Edit values node
Output data after applying Edit values node
### Change data In this part of the process you will use the same **Edit values** node [created in the previous part of the process](#handle-missing-data), to also edit the `language`, `payment_cash` and `payment_online` attributes values with jinjava code to change the data. You will change the `language` attribute value from "en" to "English" and so on. In case of `payment_cash` and `payment_online` attributes you will change “1/0“ values to “cash/Null“ and "online/Null" to later merge them into `payment_info` attribute. 1. In the configuration of the node: 1. Click **Add rule**. 2. Click **Add column**. 4. Select the `language` column. 4. Under **Edit values by**, from the dropdown list, select **Replacing**. 5. Under **with**, from the dropdown list, select **Dynamic value**. 6. In the **Type value** field, paste the following Jinja code:
{% if root["language"] == "en" %}English{% elif root["language"] == "es"%}Spanish{% elif root["language"] == "fr"%}French{% endif %}
The view of the configuration of the Edit values node
The configuration of the Edit values node
2. Click **Add rule**. 1. Click **Add column**. 2. Select the `payment_cash` column. 3. Under **Edit values by**, from the dropdown list, select **Replacing**. 5. Under **with**, from the dropdown list, select **Dynamic value**. 6. In the **Type value** field, paste the following Jinja code:
{% if root["payment_cash"] == "1" %}cash{% elif root["payment_cash"] == "0"%}{% endif %}
2. Click **Add rule**. 1. Click **Add column**. 2. Select the `payment_online` column. 3. Under **Edit values by**, from the dropdown list, select **Replacing**. 5. Under **with**, from the dropdown list, select **Dynamic value**. 6. In the **Type value** field, paste the following Jinja code:
{% if root["payment_online"] == "1" %}online{% elif root["payment_online"] == "0"%}{% endif %}
As a result, in the **Output data** tab, you will get an updated file:
Output data after applying Edit values node
Output data after applying Edit values node
3. Click **Apply**. ### Merge columns In this part of the process, you will use the **Merge columns** node to merge `payment_cash` and `payment_online` attributes into one `payment_info` attribute. 1. Click **THEN** on the canvas. 2. From the dropdown list, select **Merge columns** node. 3. In the configuration of the node: 1. Click **Add rule**. 2. Click **Add column**. 4. Select the `payment_cash` and `payment_online` columns. 4. In the **Merge values to new column** section, in the **New column name** field, type the name for the new column: `payment_info`. 5. Enable the **Remove original columns** option.
The view of the configuration of the Edit values node
The configuration of the Merge columns node
As a result, in the **Output data** tab, you will get an updated file:
Output data after applying Edit values node
Output data after applying Merge columns node
4. Click **Apply**. 5. As the final node, add **Data Output** in which you will see the final result of file modifications. 6. Click **Save and publish**. ## Prepare a workflow --- The scenario for this use case involves a one-time import of `.JSON` file with a customer database directly to Synerise. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the launch date 3. As the trigger node, add **Scheduled Run**. 4. In the configuration of the node: 1. Change the **Run trigger** option to **one time**. 2. Select **Immediately**. 3. Confirm by clicking **Apply**.
Automation Hub Scheduled Run node configuration for triggering schemaless profile data transformations
The configuration of the Scheduled Run node
### Select file to import 1. Add the **Local File** node. 2. In the configuration of the node: 1. Upload the file. 2. Confirm by clicking **Apply**.
The view of the Local File transfer
Local File transfer
### Add Data Transformation node 1. Add the **Data Transformation** node. 2. In the configuration of the node, select [the data transformation you have created before](#create-data-transformation-rules).
The view of the configuration of the Data Transformation node
The configuration of the Data Transformation node
3. Click **Apply** ### Add Import Profiles and finishing node 1. Add the **Import Profiles** node. 2. Add the **End** node. 3. In the upper right corner, click **Save & Run**.
Automation Hub workflow for schemaless profile data transformations
The workflow configuration
## Check the use case set up on the Synerise Demo workspace --- You can check the [Data Transformation](https://app.synerise.com/automations/data-transformation/269c63b8-ea4b-4baf-9028-005b06e8e06d) and [Workflow](https://app.synerise.com/automations/automation-diagram/39155d5e-b0cd-4d92-b887-ebf931166a96) configurations directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 5 events per workflow execution: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1). ## Read more --- - [Customer properties](/docs/crm/customer-properties) - [Data Transformation](/docs/automation/data-transformation-and-imports) - [Jinjav inserts](/developers/inserts) # Send any event to Facebook You can relay any events collected by Synerise to [Facebook Conversion API](https://developers.facebook.com/docs/marketing-api/conversions-api/) in order to enrich the customer's history and create more personalized ads in Facebook. Example events: - page visits - adding a product to cart - clicking a recommendation - prediction results - many more, including your own custom event types In this use case, we will send `page.visit` events to Facebook using the dedicated integration node in Automation Hub.
Completing this procedure requires some knowledge on sending API requests using tools such as curl or Postman.
## Prerequisites --- - [Create a Pixel in Facebook](https://developers.facebook.com/docs/facebook-pixel). - [Generate an access token in Facebook](https://developers.facebook.com/docs/marketing-api/conversions-api/get-started/#access-token). - In Synerise, you must have permissions that allow you to access **Automation Hub** and create an outgoing integration and a workflow. - In Synerise, implement tracking of [events](/docs/assets/events/event-definitions) that you want to send to Facebook. ## Create a workflow --- In this part of the process, you will create a workflow that is triggered by an event. Through the outgoing integration, the system sends this event to Facebook. ### Add the Profile Event trigger In this part of the process, you will configure the trigger of workflow. Whenever the event in trigger happens, the system launches the workflow and performs action configured in it - in our case it will be sending event to Facebook. 1. In the Synerise app, go to **Automation Hub > Workflows > New workflow**. 2. On the dashboard, click the plus button. 3. From the dropdown list, select **Profile Event**. 4. Double-click the **Profile Event** node. 5. On the pop-up, from the **Choose event** list, select the page visit event. If you're not sure of the event's label in your system, search for `page.visit` (or other event you want to send to Facebook). 6. Confirm by clicking **Apply**.
Configuration of the Profile Event trigger
Configuration of the Profile Event trigger. No conditions are used, all page.visit events activate the trigger.
### Configure Facebook Integration node In this part of the process, you will configure an action that workflow performs - outgoing integration that sends the event to Facebook. Values of the event parameters will be dynamic and will be passed from the event trigger using [inserts](/developers/inserts/automation). 1. On the **Profile Event** node, click the plus icon. 2. From the dropdown list, select **Facebook**. 3. From the dropdown list, select **Send Custom Event**. 4. Click the node. 5. Click **Select connection**. 6. From the dropdown list, select the connection. If you haven't established a connection yet, see [Create a connection](/use-cases/sending-events-facebook#create-a-connection).
Configuration of the Facebook Integration node
Final configuration of the Facebook Integration node
### Create a connection Use an access token which allows you to send a request. 1. At the bottom of the **Select connection** dropdown list, click **Add connection**. 2. In the **Access token** field, enter the app access token.
You can read more about access tokens in [Facebook documentation](https://developers.facebook.com/docs/marketing-api/conversions-api/get-started/#access-token).
3. Click **Next**. 4. In the **Connection name** field, enter the name for the access token you generated. 5. Click **Apply**. **Result**: A connection is created and selected. ### Define the integration settings 1. In the **Graph API version** field, enter the currently used API version in Facebook. You can find information about the currently used API version in the Facebook documentation. 2. In the **Meta Pixel ID** field, enter the identifier of the Pixel you use in Facebook. You can find information about how to find ID of the Pixel in the Facebook documentation. 3. In the **Event data** input field, enter the JSON body of event. Use [inserts](/developers/inserts/automation) to insert dynamic values and [Facebook developer documentation](https://developers.facebook.com/docs/marketing-api/conversions-api) to build the structure of event body.
It is mandatory to provide one of the customer identifiers listed under the Customer Information Parameters section of the [Conversions API Documentation - Meta for Developers](https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/customer-information-parameters).
**Example** of `page.visit` event body:
{   "data": [
    {
        "event_name": "PageVisit",
        "event_time": {{ (event.params.time / 1000)|int }},
        "event_source_url": "{{ event.params.uri }}",
        {% if event.params['product:retailer_part_no'] %}
            "currency": "PLN",
            "content_type": "product",
            "content_ids":  ["{{ event.params['product:retailer_part_no'] }}"],
            "value": {{ event.params['product:price:amount']|int }},
        {% endif %}
        "user_data": {
            "client_ip_address": "{{ event.params.ip }}",
            "client_user_agent": "",
            "em": ["{% if 'anonymous' in client.email %}{% else %}{{ client.email|trim|lower|hash("SHA-256") }}{% endif %}"],
            "ph": ["{% if 'phone' in customer|string %}{{ client.phone|trim|lower|hash("SHA-256") }}{% endif %}"],
            "fbc": "",
            "fbp": ""
        },
        "custom_data": {}
    }]
   }
where: | Line number | Description | | --- | --- | | 4 | Inserts event time from the trigger node and re-calculates it into seconds (this is required by Facebook). | | 5 | Inserts URI from the trigger node as the `event_source_url` param. | | 6-11 | If the visited page has product metadata, inserts that metadata. | | 13 | Inserts customer's IP from the trigger node. | | 15 | Inserts email encoded using SHA-256 algorithm, if available. | | 16 | Inserts phone number encoded using SHA-256 algorithm, if available. |
In the example of body described above, you can see that customer's personal data is encoded. While sending events to Facebook, the customers' identifiers must be encoded using SHA-256 algorithm. Read more about encoding function in [inserts](/developers/inserts/filter#hash).
6. Confirm by clicking **Apply**. ### Add the End node 12. On the **Send Custom Event** node, click the plus button. 13. From the dropdown list, select **End**. 14. Save and activate the automation by clicking **Save&Run**. 15. Go to your Facebook Ad account, select **Facebook Manager > Events Manager** to see the events.
The final structure of the workflow
The final structure of the workflow
**Result**: After the customer performs event trigger, the `webhook.response` event is visible on the customer's profile with 200 status. That means that the event has successfully been sent to Facebook. ## Check the use case set up on the Synerise Demo workspace --- You can also check [the workflow configuration](https://app.synerise.com/automations/automation-diagram/a9180cf5-847f-4d90-8573-66371c8fe837) directly in Synerise Demo. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 5 events per profile that completes the flow: [`page.visit`](/docs/assets/events/event-reference/web-and-app#pagevisit) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`webhook.response`](/docs/assets/events/event-reference/integration#webhookresponse-and-custom-webhook-response-names) (~1). ## Read more --- - [Add Profiles to Custom Audience](/use-cases/send-custom-audience-webhook) - [Send offline transactions to Facebook](/use-cases/sending-offline-transactions-facebook) # Automated Emails for Customer Retention Using Churn Predictions Prediction results are saved as [events to customer cards](/docs/ai-hub/predictions/custom#understanding-prediction-events). Thanks to this, a prediction can be used as a parameter in a segmentation that is the audience of a workflow. The number of uses for churn prediction is practically unlimited. In this example, an email is sent automatically to every customer for whom the risk of churn is calculated as high after completing the prediction described in [Predict churn](/use-cases/churn-prediction).
Reduce churn
Reduce churn
## Prerequisites --- - Prepare a churn prediction (for example, as described in [Predict churn](/use-cases/churn-prediction)). - Prepare the template for the email you want to send to customers who are at risk of churn, as described in [Creating email templates](/docs/campaign/e-mail/creating-email-templates). ## Process --- 1. Create a [segment](/use-cases/predictions-automation#create-a-segment-based-on-predictions) based on predictions. 2. Create [workflow](/use-cases/predictions-automation#create-workflow-to-message-customers-at-risk-of-churn) to message customers at risk of churn. ## Create a segment based on predictions --- In this stage, you create a segment of customers who are at high risk of churn. The segment will be used in an Audience Trigger for a workflow. 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Give the segmentation a meaningful name, for example `Customers at risk of churn`. 3. Click **Choose filter** and select the `snr.prediction.score` event.
The event may have a custom label in the list, but can always be found by entering the system name (`snr.prediction.score`) in the search field.
3. Add the following conditions to the event: - `score_label` parameter equals `High` - `modelId` parameter equals the ID of the prediction you want to use.
The model ID can be copied from the Three-dot icon menu in the Prediction list.
4. Click **Save**. **Result:** The segmentation is saved and can be used in automations, analytics, and more.
Segment configuration
Segment configuration
## Create workflow to message customers at risk of churn --- 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Add an **Audience** trigger node. 3. In the settings of the node, as the audience select the segment you created earlier. 4. Add boolean and set it as **true**. 4. Save the node configuration. 5. Add a **Send email** node. 6. Configure the sender and prepare the content as described [here](/docs/automation/actions/send-email). 7. Save the node configuration. 8. Add and **End** node. 9. Perform one of the following actions: - If you want to send the messages immediately, click **Save & Run**. - If you want to send the messages later, click **Save**. **Result:** When the workflow starts, a message is sent to all customers who belonged to the segmentation at the time of starting the workflow. ## What's next --- You can configure the workflow differently, for example by: - using the prediction event as a trigger, - sending other types of messages, - adding more conditions to the audience filter, - and more nodes, depending on your business scenario and familiarity with Automation Hub. ## Check the use case set up on the Synerise Demo workspace --- You can find the analyses created in this use case in our Synerise Demo workspace at the following links: - [Propensity prediction](https://app.synerise.com/ai-v2/predictions/generic-scoring/bgycsoovxgby) - [Segmentation](https://app.synerise.com/analytics-v2/segmentations/9ec901b4-2ea0-47dc-9285-023d2000e8cf) - [Workflow configuration](https://app.synerise.com/automations/automation-diagram/e0f72659-611a-4122-91a0-a99e4832a106) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 6 events per profile that completes the flow: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1). ## Read more --- - [Predictions](/docs/ai-hub/predictions) - [Workflow](/docs/automation) # Send alerts to Microsoft Teams and email alerts about unsent and failed emails Effective communication is crucial for maintaining strong relationships with customers and ensuring seamless business operations. In scenarios in which message delivery issues occur, such as unsent and failed messages, these disruptions can impact customer satisfaction and operational efficiency. This use case focuses on implementing a comprehensive monitoring and alert system for unsent and failed messages. By using Synerise's Automation Hub, businesses can distribute detailed daily reports and set up real-time alerts to notify channel members in Microsoft Teams and send email alerts when message delivery issues occur. This proactive approach helps maintain communication reliability and enhances customer satisfaction. In our case we will start this automation daily to check the number of `message.notSent` events and the list of possible errors. The message alert will be sent only if the number of unsent messages will be higher or equal to `1`.
This case specifically describes creating reports based on the `message.notSent` event, which is generated when the process of sending an email fails. However, it can be easily adapted by incorporating additional events that are generated when delivery issues occur in different communication channels. For instance, events like `push.notSent` or `webpush.notSent` can be included to ensure a broader scope of monitoring.
## Prerequisites --- Create a workflow from a channel in Teams by following steps below: 1. Go to Power Automate to create [a workflow from a channel in Teams](https://support.microsoft.com/en-us/office/creating-a-workflow-from-a-channel-in-teams-242eb8f2-f328-45be-b81f-9817b51a5f0e). Save workflow to generate incoming webhook URL. 2. Edit the created workflow by filling out the **TeamId** and **ChannelId** fields. These values will be suggested. If not: - To get the value of **TeamId**, go to the MS Teams application and retrieve a link to the team. **TeamId** is the part of generated URL groupId=XXXX. - To get the value of **ChannelId**, go to the MS Teams application and retrieve a link to the channel. **ChannelId** is a part of generated URL channel/XXXXXXXX. 3. Save the changes in the workflow. 4. If you want to send an interactive message (such message can contain links, simple surveys, sections), prepare it in [AdaptiveCard](https://adaptivecards.io/designer/). ## Process --- In this use case, you will go through the following steps: 1. [Create a metric which counts the occurrences of `message.notSent` events](/use-cases/teams-alerts#create-a-metric). 3. [Create a report](/use-cases/teams-alerts#create-a-report). 2. [Create an email template](/use-cases/teams-alerts#create-an-email-template) that contains description of error parameters. 2. [Create a workflow](/use-cases/teams-alerts#create-a-workflow) which sends an email alert. 2. [Create a workflow](/use-cases/teams-alerts#create-a-workflow-sending-teams-alert) which sends the message to the Microsoft Teams channel. ## Create a metric --- In this part of the process, we will create a metric whose result will be later sent in the Microsoft Teams message. This specific metric will count the number of unsent email messages. 1. In Synerise, go to Decision Hub icon **Decision Hub > Metrics > New metric**. 2. Enter the name of the metric. 3. As the metric type, choose **Simple metric**. 3. From the **Type** dropdown, choose **Event**. 4. As an aggregator, choose **Count**. 3. From the **Choose event** dropdown list, select `message.notSent`. 4. Set the time range to **Yesterday**.
The configuration of the metric
The configuration of the metric
## Create a report --- In this part of the process, we will create a report whose results will be later sent in the Microsoft Teams message. 1. Go to Decision Hub icon **Decision Hub > Reports > New report**. 2. Enter a meaningful name of the report. 3. From the **Choose metric** dropdown list, select [a metric created in "Create a metric" part of the process](#create-a-metric). 4. From the **Range** dropdown list, select the number. This number should be linked to the average number of campaigns sent daily and may therefore be smaller or larger depending on the business. In this case it will be **TOP 20**. 5. In the **Dimension** section, from the dropdown list, select **Event > Parameters**. From the list, select the following parameters: - campaignName - info - extra - exception - id - diagramId
- You can find descriptions of these parameters in the [documentation](/docs/assets/events/event-reference/email#messagenotsent) for the `message.notSent` event. - If needed, you can add more parameters, reduce its number, or modify them to suit your specific business requirements.
8. Choose **Show null values**. 6. Using the date picker in the lower-right corner, set the time range to **Yesterday**. 9. Save the report.
The configuration of the report
The configuration of the report
## Create an email template --- You can use a [ready-made template](https://app.synerise.com/campaigns/email/content-manager/template/161215) (available on the Synerise Demo workspace) that inserts the data you want to send in a table format. 1. On the right panel, click the **Config** tab. 2. Fill out **Title** and **Subtitle** to personalize the header and subtitle in the template. 3. Define **Maximum report table rows number**. 4. In **Report id**, enter the ID of the report you created within ["Create a report"](#create-a-report). You can retrieve the report ID by going to **Decision Hub > Reports**. On the list of reports, find the report you created in the previous part of the process. To the right side of the report author, expand the context menu and at the bottom of the list, copy the ID. 5. In the **General Settings** section: - From the **Synerise environment** dropdown, select the cloud where your workspace is hosted. - From the **Campaign type** dropdown, select **email**. 4. Click **Save as**. 5. On the pop-up, you can change the name and select the folder where the template will be saved.
Email notification on email performance template
The configuration of the email template
## Create a workflow --- In this part of the process, you will create a workflow that sends a message with the report results through email once a day. The message alert will be sent only if the number of unsent messages will be higher than `1`. 1. In Synerise, go to **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Scheduled Run trigger node --- At this stage, configure the conditions that trigger the workflow. 1. As the trigger node, select **Scheduled Run**. 2. In the configuration of the node: 1. Change the **Run trigger** option to **all time**. 2. Choose the **Everyday** option. 3. Choose the timezone and hour (in our case, it's 6.00 A.M.) 3. Confirm by clicking **Apply**.
Automation Hub Scheduled Run node configuration for triggering Microsoft Teams alert notifications
The configuration of the Scheduled Run node
### Choose Get Analytics Report Node --- 1. Choose **Get Analytics Report**. 2. From the dropdown list, select the [report created in "Create a report" part of the process](#create-a-report). 3. Set report records limit. 4. Click **Apply**.
The configuration of the Get Analytics Report Node
The configuration of the Get Analytics Report Node
### Define the Metric Filter node --- In the **Metric Filter** node, you will select [the metric prepared in "Create a metric" part of the process](#create-a-metric). The continuation of the workflow will depend on the result of the metric. If the metric result is equal to or more than 1, an alert will be sent. 1. Add **Metric Filter**. 2. In **Define condition**, choose the [metric created in the previous step](#create-a-metric). 3. As the condition, by using the mathematical operators, set the metric result as equal or more than `1`. 4. Click **Apply**.
The configuration of the Metric Filter node
The configuration of the Metric Filter node
## Define the Email Alert Node --- 1. Add the **Email Alert** node to the **matched** path. In the configuration of the node: 1. In the **Content** section, select [the email template created in the previous step](#create-an-email-template) and in the **Subject** field, enter your message subject. 2. In the **Recipient** section, use the text field to add at least one email address of a workspace user to whom the message will be sent. 3. Confirm the selection by clicking **Add**. 3. Confirm by clicking **Apply**. ## Add the finishing node --- 1. Add the **End** node: - To the **Not matched** path, - After the **Email Alert** node. 2. In the upper right corner, click **Save & Run**.
Data Reference Workflow
Workflow configuration
## Create a workflow sending Teams alert --- In this part of the process, you will create a workflow that sends a message to the Microsoft Teams channel once a day. The workflow will look similar to one created [previously](#create-a-workflow) but instead of the Email Alert node, we use the **Send Channel Message** node. Its settings are described below. ## Send channel message --- In this step, you will configure the settings of the outgoing integration that sends the alert message to Microsoft Teams channel. 1. Add the **Send Channel message** node. 3. In the configuration of the node: - If you already created a connection, select the connection from the list. - If you haven't created any connection yet: 1. At the top of the dropdown list, click **Add connection**. 2. In the **Incoming Webhook URL** field, enter the incoming webhook URL you created as a part of [prerequisites](/use-cases/teams-integration#prerequisites). 3. Click **Next**. 4. In the **Connection name** field, enter the name for the connection you created. 5. Click **Apply**. **Result**: A connection is created and selected. 1. In the **Type of message** field, choose **Interactive message (JSON)**. 2. Below, in **JSON body**, add the content of the message which will be sent to the Microsoft Teams channel.
In the code below, remember to replace a few things: - `set mentions`: Replace email addresses with emails of workspace users who are supposed to be mentioned on the Teams channel when a new report is available. - `set reportId`: Set this to the ID of the report created in ["Create a report"](#create-a-report). - `set env`: Replace this with the environment your workspace is hosted. - `set campaignType`: Replace this with the type of campaign, in our case: email.
Click to expand the code
{#CONFIG#} {% set mentions = ['abc@synerise.com','xyz@synerise.com']%} {# you can leave array empty []#} {% set title = "Message.notSent alert" %} {% set reportId = 'f3370785-f309-4b6f-b47f-bb10de377708' %} {% set env = 'microsoft-eu' %} {# microsoft-eu, microsoft-usa, google #} {% set campaignType = 'email' %} {# email, sms, mobile-push, webpush #} {#ENDCONFIG#} {% if env == 'microsoft-usa' %} {% set baseUrl = 'https://app.azu.synerise.com' %} {% elif env == 'google' %} {% set baseUrl = 'https://app.geb.synerise.com %} {% else %} {% set baseUrl = 'https://app.synerise.com' %} {% endif %} { "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", "type": "AdaptiveCard", "version": "1.4", "body": [ { "type": "TextBlock", "text": "{% for mention in mentions %}<at>{{mention}}</at>{% if not loop.last %}, {% endif %}{% endfor %}", "size": "small" }, { "type": "TextBlock", "size": "Medium", "weight": "Bolder", "text": "{{title}}" }, { "type": "Table", "columns": [ { "width": 1 }, { "width": 1 }, { "width": 1 }, { "width": 1 }, { "width": 1 } ], "rows": {% set dataRow=[] %} {% set titles=['campaignName', 'info', 'extra', 'value', 'campaignId'] %} {% set cells = [] %} {% for t in titles %} {% do cells.append( { "type": "TableCell", "items": [ { "type": "TextBlock", "text": t, "wrap": true } ] } ) %} {% endfor %} {% do dataRow.append({"type": "TableRow","cells":cells}) %} {% datareference node='Get report' maxRows=12 %} {% set cells=[] %} {% for r in datareference_result %} {% set cells=[ { "type": "TableCell", "items": [ { "type": "TextBlock", "text": r.campaignName +' [[link]]('+baseUrl+'/campaigns/'+campaignType+'/preview/'+r.id+')', "wrap": true } , { "type": "TextBlock", "text": 'Automation [[link]]('+baseUrl+'/automations/workflows/automation-diagram/'+r.diagramId+')' if r.diagramId is not string_containing 'null' else '', "wrap": true } ] }, { "type": "TableCell", "items": [ { "type": "TextBlock", "text": r.info, "wrap": true } ] }, { "type": "TableCell", "items": [ { "type": "TextBlock", "text": r.extra, "wrap": true } ] }, { "type": "TableCell", "items": [ { "type": "TextBlock", "text": r.Value|int, "wrap": true } ] }, { "type": "TableCell", "items": [ { "type": "TextBlock", "text": r.id, "wrap": true } ] } ]%} {% do dataRow.append({"type": "TableRow","cells":cells}) %} {% endfor %} {% enddatareference %} {{dataRow|tojson}} } ], "actions": [ { "type": "Action.OpenUrl", "title": "Raport", "url": "{{baseUrl}}/analytics/reports/{{reportId}}" } ], "bleed": true, "msteams": { "width": "Full", "entities": [ {% for mention in mentions %} { "type": "mention", "text": "<at>{{mention}}</at>", "mentioned": { "name": "{{mention}}", "id": "{{mention}}" } } {% if not loop.last %} , {% endif %} {% endfor %} ] } }
Remember, that the rest of the code and the adaptive card are designed to match the parameters of the event described earlier. The results of this report will reflect those parameters. If you want to show fewer, additional, or different parameters, you will need to modify the rest of the code accordingly.
3. Confirm by clicking **Apply**.
Configuration of the workflow that sends alert messages based on the metric results to the Teams channel
Configuration of the workflow that sends alert messages based on the metric results to the Teams channel
## Add the finishing node --- 5. Add the **End** node after **Send channel message** and to the **not matched** path. 6. In the upper right corner, click **Save & Run**.
Data Reference Workflow
Workflow configuration
## Check the use case set up on the Synerise Demo workspace --- Directly in our Synerise Demo workspace, you can check the configuration of: - [metric](https://app.synerise.com/analytics/metrics/901e1213-9c04-4f31-b1d1-226531b95a46) - [report](https://app.synerise.com/analytics/reports/f3370785-f309-4b6f-b47f-bb10de377708) - [workflow sending email alert](https://app.synerise.com/automations/workflows/automation-diagram/828b4892-e681-4d95-b250-e4f127e11565) - [workflow sending teams alert](https://app.synerise.com/automations/workflows/automation-diagram/44b674e7-4d81-4af6-87e2-31640e50877a) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 12 events per workflow execution: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~2), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~6), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~2), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`MSteams.sendChannelMessage`](/docs/assets/events/event-reference/integration#msteamssendchannelmessage) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Metrics](/docs/analytics/metrics) - [Reports](/docs/analytics/reports) # Date-Driven and Transaction-Based Email Banners for Customer Segments In today's fast-paced digital landscape, email marketing has evolved into a powerful tool for businesses to connect with their customers. The effectiveness of email campaigns often hinges on personalization. The ability to tailor content, products, and offers to individual recipients can significantly impact Key Performance Indicators (KPIs) and enhance the overall user experience. Email personalization goes beyond addressing the recipient by their first name; it's about delivering content that speaks directly to their interests, needs, and preferences. Such personalization can be done based on any attributes or activities of the customer, such as, for example, the customer's club status, transaction history, age in combination with any other variables, such as even the day of the month/week. The number of possible scenarios is huge, making it a great place to implement the most daring ideas.
Email campaigns with catalog-based banners
This use case describes a scenario in which customers receive email banners tailored to the following criteria: - **Current Day of the Month:** Depending on the day, customers receive banners with special promotions relevant to that day. - **Transaction History:** Customers are segmented into two groups based on whether they have made a transaction in the last 180 days or not. **Assumptions:** - The email is part of a specific marketing campaign scheduled for a particular month. - All banner graphics and their links are stored in a catalog, with each day of the month having its own banner graphic for the respective audience. **Scenarios:** Group 1: Customers with recent transactions For customers who have made at least one transaction in the last 180 days: - **Days 1-15:** They receive Banner 1, offering a special promotion. - **Days 16-31:** They receive Banner 2, featuring a different special promotion. Group 2: Customers with no recent transactions For customers who have not made any transactions in the last 180 days: - **Days 1-15:** They receive Banner 1, offering a specific discount for a particular product category. - **Days 16-31:** They receive Banner 2, with a different discount for another product category. ## Prerequisites --- - Implement [Synerise tracking code](/developers/web/installation-and-configuration#creating-a-tracking-code) on your website. - Permissions that allow access to Catalogs section and adding new catalogs. - Implement the [transaction events](/developers/web/transactions-sdk) using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). - Configure a [sender account](/docs/campaign/e-mail/configuring-email-account). - Prepare a CSV file with banner graphics and corresponding links assigned to a specific day of the month and customer segment. The file used in this use case contains the following columns: - `DayOfTheMonth` - column that contains the days of the month (this column will be used as a catalog key) - `Group1banners` - column that contains banners dedicated to Group 1 (customers who have made at least one transaction in the last 180 days) - `Group2banners` - a column that contains banners dedicated to Group 2 (customers who have not made any transaction in the last 180 days) - `link1` - column that contains links to banners dedicated for Group 1 - `link2` - column that contains links to banners dedicated to Group 2
Example file
Sample file
Sample file
## Process --- 1. [Create a catalog](/use-cases/dynamic-email-campaign#create-a-catalog) with banners assigned to specific days of the week and customer segments. 2. [Create an aggregate](/use-cases/dynamic-email-campaign#create-an-aggregate) showing whether a customer has made a transaction in the last 180 days. 3. [Create a jinjava](/use-cases/dynamic-email-campaign#create-a-jinjava-insert) insert to be used in the email template. 4. [Create an email template](/use-cases/dynamic-email-campaign#create-an-email-template). ## Create a catalog --- In this part of the process, create a catalog and import there your CSV file you prepared as a part of prerequisites. 1. Go to **Data Modeling Hub > Catalogs > New Catalog**. 2. Enter the name of the catalog and confirm it by clicking **Apply**.
Don't use diacritical letters and spaces.
3. Click the catalog on the list and click **Import Local File**. If you prepared a CSV file in Excel, open it in a text editor to check whether commas are used as separators. If not, replace them with commas. 4. Click the **Upload a new file** button and select the file to be uploaded, then click **Next** button. 5. You will see the information that your file has been successfully uploaded. Click **Next** button to continue the import process. 6. In the **Primary key** field, type the name of the column whose values are treated as the key. In this case it will be `DayOfTheMonth`. Click **Next** button to continue the process.
Catalog primary key configuration
Catalog primary key configuration
7. In the next screen you will find the summary of your import. If no changes are needed click **Run import** button.
Import success
Import success
## Create an aggregate --- Create an aggregate that show whether a customer has made a transaction in the last 180 days. The ID of this aggregate will be later used in the Jinjava code. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Click **Analyze profiles by** and select **Exists**. 4. From the **Choose event** dropdown list, select the **transaction.charge** event. 5. Set the period from which the aggregate will analyze the results to the last **180 days**. 6. Save the aggregate.
Decision Hub Exists aggregate returning whether a customer has made a transaction.charge event in the last 180 days
Configuration of the aggregate
## Create a Jinjava insert --- In this part of the process, prepare a Jinjava insert that will be used in the email template to display the relevant banner from the current day of the month to the appropriate customer segment. Below you can find the jinjava insert used in this use case. There is the list of used values that you need to replace to tailor this Jinjava to your campaign: - replace `insert_aggregate_ID` with the ID of your aggreagate - replace `insert_aggregate_name` with any unique aggregate name - replace `insert_catalog_name ` with your catalog name - in the `{{ catalog_result.link1 }}`, `{{ catalog_result.link2 }}` and `{{ catalog_result.Group1banners }}`, `{{ catalog_result.Group2banners }}` replace the `link1`, `link2` and `Group1banners`, `Group2banners` with the names of respective columns from the created catalog.
Check the Jinjava code
<!-- The purpose of the following part of Jinjava is to calculate the day of the month that corresponds to the current date plus 1 hour and save it as a string.).--> {% set now = (unixtimestamp(null)|plus_time(1, 'hours'))|unixtimestamp() %} {% set now_sec = now|divide(1000) %} {% set current_date = (now_sec|int*1000)|datetimeformat('%d.%m.%y') %} {% set current_date_array = current_date|split('.') %} {% set today = current_date_array[0] %} {% set todayString = today|int|string %} <!-- The logic behind the remaining part of Jinjava determines which set of HTML elements to generate based on the value of the aggregate result and the relevant links and image data from the catalog. This part divides customers into 2 groups based on their transaction activity (customers who have or have not made any transaction in the last 180 days).--> {% aggregate insert_aggregate_ID %} {% set insert_aggregate_name = aggregate_result|last %} {%if insert_aggregate_name =='true' %} {% catalogitemv2.insert_catalog_name(todayString) %} <a href="{% preparelink %}{{ catalog_result.link1 }}{% endpreparelink %}"> <img src="{{ catalog_result.Group1banners }}"> </a> {% endcatalogitemv2 %} {% else %} {% catalogitemv2.insert_catalog_name(todayString) %} <a href="{% preparelink %}{{ catalog_result.link2 }}{% endpreparelink %}"> <img src="{{ catalog_result.Group2banners }}"> </a> {% endcatalogitemv2 %} {% endif %} {% endaggregate %}
## Create an email template --- In this part of the process, create an email template. You can use a predefined template or create your own template from scratch. In this case, we will use the predefined template. 1. Go to Experience Hub icon **Experience Hub > Email**. 2. On the left pane, click **Templates** and from the list of template folders, select **Predefined simple templates**. 3. Select any template that mostly fits the campaign assumptions. **Result:** You are redirected to the code editor. 4. Edit the template according to your needs and add the row dedicated to the banner section. 5. Add **HTML** from the **Content** section to the created row and insert the Jinjava code you created in the previous step. 6. After you make changes to the template, you can check the preview. 1. Click the **Preview Contexts** button on the upper left side. 2. Enter the ID of a customer. 3. Click **Apply**. 7. If the template is ready, in the upper right corner, click the arrow next to **Next**, and from the dropdown select **Save as**. 8. On the pop-up: 1. In the **Template name field**, enter the name of the template. 2. From the **Template folder** dropdown list, select the folder where the template will be saved. 3. Confirm by clicking **Save**. Below you can find an example of email context preview.
Email context preview
Email context preview
## What's next --- You can use this template in an email campaign by sending it manually or setting it up in Automation Hub as part of your business scenario. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1). ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of each step directly in the Synerise Demo workspace: - [Catalog](https://app.synerise.com/assets/catalogs/182804) - [Aggregate](https://app.synerise.com/analytics/aggregates/860f507b-b2db-3b71-b98e-63a040183502) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. # Sending TrustMate Survey Links via Email After Purchase TrustMate is a tool that enables building online brand image through management of reviews of your online shop or company. You can integrate it with Synerise using dedicated node in Automation to build a variety of business scenarios. The node enables you to get two survey links - to rate the purchased product and to rate the company. This use case describes the process of creating a workflow to generate a survey link from TrustMate and send it in email communication to encourage customers to leave their feedback about the purchased products. The link to the survey will be sent after 7 days from the day of purchase. ## Prerequisites --- - Contact TrustMate to receive access key for API requests. - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). - [Create an email account](/docs/campaign/e-mail/configuring-email-account). - [Create an email template](/docs/campaign/e-mail/creating-email-templates). ## Process --- 1. [Create a workflow](/use-cases/trustmate-integration#create-a-workflow) 3. [Track survey answers](/use-cases/trustmate-integration#track-survey-answers) ## Create a workflow --- Create a workflow that is triggered by every product purchase. In response to the purchase, the system sends a request to TrustMate with the details of the purchased products. In exchange, a link to the survey is saved to Synerise. After 7 days, the workflow sends an email to a customer.
Trustmate integration workflow
Trustmate integration workflow that generates link to the survey
### Define the Profile Event trigger --- 1. In Synerise, go to **Automation Hub > Workflows > New workflow**. 2. Add the first node - **Profile Event**. In the node configuration: 1. Select an event that signifies a purchase of an item (in this use case it's `product.buy`). 2. Confirm by clicking **Apply**.
Automation Hub Profile Event node configured with product.buy event for TrustMate integration trigger
Configuration of the Profile Event node
### Configure TrustMate Integration node --- In this part of the process, you will configure an action that workflow performs - outgoing integration that sends the details of purchased products to TrustMate and generates the `trustMate.getSurveyLinks` event with survey links. The values of the integration parameters are dynamic and they are sourced from the event trigger by using [inserts](/developers/inserts/automation). 1. On the **Profile Event** node, click the plus icon. 2. From the dropdown list, select **TrustMate**. 3. From the dropdown list, select **Get Survey Link**. 4. Click the node. 5. Click **Select connection**. 6. From the dropdown list, select the connection. If you haven't established a connection yet, see [Create a connection](/use-cases/sending-events-facebook#create-a-connection). #### Create a connection Use an access key which allows you to send a request. 1. At the bottom of the **Select connection** dropdown list, click **Add connection**. 2. In the **Access key** field, enter the access key received from TrustMate. 3. Click **Next**. 4. In the **Connection name** field, enter the name for the connection you created. 5. Click **Apply**. **Result**: A connection is created and selected. #### Define the integration parameters 1. In the **Customer’s firstname** field, enter the insert that extracts the customer's first name from the customer's attribute: `{{ customer['firstname'] }}` 2. In the **Customer’s email** field, enter the insert that extracts the email of your customer from the customer's attribute: `{{ customer['email'] }}` 3. In the **Order Id** field, enter the insert that extracts the order ID of the purchase from the **Profile Event** trigger: `{{ event.params['$orderId'] }}` 4. In the **Product’s name** field, enter the insert that extracts the name of the purchased product from the **Profile Event** trigger: `{{ event.params['$name'] }}` 5. In the **Product’s category** field, enter the insert that extracts the category of the purchased product from the **Profile Event** trigger: `{{ event.params['$category']|join(' / ') }}`
TrustMate requires to separate categories path elements with `/`, ex. `clothes/dresses/pink-dresses`
1. In the **Product’s SKU** field, enter the insert that extracts the SKU of the purchased product from the **Profile Event** trigger: `{{ event.params['$sku'] }}` 2. In the **Product’s image URL** field, enter the image URL of the purchased product. Use the following insert to extract it from the profile event trigger: `{{ event.params['image-link'] }}`. 3. In the **Product’s URL** field, enter the insert that extracts the SKU of the purchased product from the **Profile Event** trigger: `{{ event.params['$url'] }}`
The names of the parameters you send in the transaction events may differ in your case, so make sure that Jinjava inserts correspond with the parameters' names you send in the transaction events. If you do not pass some of the parameters required to configure TrustMate integration node in transaction events, try extracting them from [the product catalog](/use-cases/import-product-feed-to-catalog) using [inserts](/developers/inserts/insert-usage#extracting-items-from-catalogs-as-objects).
When the TrustMate node is launched, `trustMate.getSurveyLinks` event is generated on the customer's profile. There are links to surveys in event parameters.
Event generated on the customer's profile
Event generated on the customer's profile
### Configure the Event Filter node This node enables you to make sure the link to survey is generated and keeps it as [the context for the workflow](/developers/inserts/automation#context). 4. Add **Event Filter**. In the configuration of the node: 3. In the **Define conditions** field, from the **Choose event** dropdown menu, choose `trustMate.getSurveyLinks` event. 4. Click **where** button. 5. From the dropdown menu, select the `body.product[0]` parameter. 6. From the **Choose operator** dropdown menu, select `Regular expression (String)`. 7. Enter the `.` value. 4. Confirm by clicking **Apply**.
Final configuration of the Event Filter node
Final configuration of the Event Filter node
### Configure the Delay node --- Add the Delay node to define the lag between the purchase and sending an email with survey link. In this example it is 7 days. 1. On the **Get Survey Link** node, click the plus icon. 2. From the dropdown list, select **Delay**. 4. Click the node. 5. In the **Delay** field enter `7`. 6. From the **Unit** dropdown menu, select `Day`. ### Configure settings for email 1. As the next node, add **Send Email**. Configure it according to your business needs. 2. Configure the sender details section. 3. Configure the Content section. 1. In the **Subject** field, enter your message subject. 2. In the **Template** section, choose the template email template prepared earlier. 3. You can define **UTM & URL parameters**. 4. Confirm by clicking **Apply**.
You need to enrich your email template with the survey link generated in the TrustMate integration node. The link to survey about purchased product is stored in the `body.product[0]` parameter of the `trustMate.getSurveyLinks` event, so you can use the following [Jinjava code](/developers/inserts/automation#event-parameters) in your email template: `{{ event.params['body.product[0]'] }}`
9. Add the **End** node. 10. In the upper right corner, click **Save & Run**. ### Track survey answers --- Optionally, you can level up your communication with customers based on the answers from the survey. To make it possible, configure a custom event that will be sent to Synerise through API and which will include the rate of a product. When a customer fills in the survey, this event will be sent to Synerise. Exemplary event frame:
{
   "action":"client.review",
   "client":{
      "email":"string"
   },
   "params":{
      "author_name":"string",
      "created_at":"2021-04-28T14:09:27.000Z",
      "grade":0,
      "brand":"string",
      "category":"string",
      "group_id":"string",
      "gtin":"string",
      "image_url":"string",
      "local_id":"string",
      "name":"string",
      "product_url":"string",
      "public_identifier":"string"
   }
}
You can find the API method [here](https://hub.synerise.com/api-reference/data-management#operation/CustomEvent).
## Check the use case set up on the Synerise demo workspace --- You can also check the workflow configuration directly in Synerise Demo workspace at this [link](https://app.synerise.com/automations/workflows/automation-diagram/4891c9c3-d4e4-40e6-9ff1-74afd2169b58). If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 11 events per profile that completes the flow: [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~4), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`trustmate.getSurveyLinks`](/docs/assets/events/event-reference/integration#trustmategetsurveylinks) (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1). ## Read more --- - [Automation inserts](/developers/inserts/automation) - [Creating workflows](/docs/automation/creating-automation) - [Outgoing Integration](/docs/automation/actions/webhook-node) # Sending Mobile Push Birthday Discounts at the Best Time A properly designed and executed mobile push campaign can help attract users' attention and increase the conversion rate. Sending a push notification at the optimal time, when the customer is active in the app, increases the chances that the customer will read the communication. Customers may feel happy if you offer them a birthday discount to celebrate their big day. In this use case, you will learn how to prepare a mobile push campaign with a discount on products from specific categories for customers who have a birthday on the current day. The promotion will be available for 14 days after the birthday. You can optimize time of sending push notifications with the help of our time optimizer and connect with your customers at the right hour. The sending time is adjusted to the customers' activity in the mobile app. ## Prerequisities --- - Implement promotions in your [mobile application](/developers/mobile-sdk/loyalty), [API](https://hub.synerise.com/api-reference/loyalty-and-engagement#operation/profileLogin). - Implement mobile pushes in your mobile application: [iOS](/developers/mobile-sdk/configuring-push-notifications/ios), [Android](/developers/mobile-sdk/configuring-push-notifications/android). - [Import your product feed to a catalog](/use-cases/import-product-feed-to-catalog). - Collect data about customers' birthdays in their profiles. - If you want to limit the promotion to only some of your stores, add the list of stores to a catalog. Such a catalog must contain a unique store ID and any other store attributes by which you will filter stores, such as city, zip code, and so on. More information about catalogs can be found [here](/docs/assets/catalogs). ## Security configuration --- Before you start working with this hub, if you are a Synerise customer or partner, consider reading [the section about denylisting events](/docs/settings/tool/api#denylist). This natively accessible configuration will allow you to manage the restrictions in points management that may help you prevent fraud. ## Process --- 1. [Enable time optimizer](/use-cases/mobile-push-birthday-best-time#enable-time-optimizer). 2. [Create a mobile mode](/use-cases/mobile-push-birthday-best-time#create-a-mobile-mode) in time optimizer. 3. Create segmentations: 1. [A segmentation of customers whose birthday is on the current day](/use-cases/mobile-push-birthday-best-time#create-a-segmentation-of-customers-whose-birthday-is-on-the-current-day) - needed to send the push notification. 2. [A segmentation of customers whose birthday was in the last 14 days](/use-cases/mobile-push-birthday-best-time#create-a-segmentation-for-customers-whose-birthday-was-in-the-last-14-days) - needed to keep the promotion active for 14 days after the birthday. 2. [Create a promotion](/use-cases/mobile-push-birthday-best-time#create-a-promotion) for customers who have celebrated their birthday within the last 14 days on products in specific categories. 3. [Prepare a mobile push notification](/use-cases/mobile-push-birthday-best-time#prepare-a-mobile-push-notification). 4. [Create a workflow](/use-cases/mobile-push-birthday-promotion#create-a-workflow) to send the mobile push. The workflow runs once a day. ## Enable time optimizer --- 1. Go to **Settings > AI Engine Configuration**. 2. Select **Time optimizer** tab. 3. Click **Define**. 4. Switch the toggle on. ## Create a mobile mode --- Create a Mobile mode for Time Optimizer that will calculate the time when the customer is most active in the mobile application based on the events such as `screen.view` and `screen.interaction`. 1. Go to **Settings > AI Engine Configuration**. 2. Select the **Time optimizer** tab. 3. Click **Define**. 4. Click **Add new mode**. 5. To create a new mode, select **Custom**: 1. In the **Mode name** field, enter the name for the custom mode. 2. From the **Predicted event** dropdown list, select the `screen.view` activity to calculate the most probable time of occurrence. 3. From the **Input events** dropdown list, select the events: `screen.interactions`, `screen.click` and `screen.view`, based on which the engine will perform the predictions. 4. Click **Apply**. 6. Click **Apply** to save the new mode.
To keep the time optimizer enabled, at least one mode must be active.
New mode mobile
Configuration of custom mode in time optimizer
## Prepare segmentations --- ### Create a segmentation of customers whose birthday is on the current day 1. Go to Behavioral Data Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of segmentation. 3. Click **Conditions**. 4. From the **Add condition** dropdown list, select the birthday attribute. 4. In the operator selection menu that opens: 1. Click the calendar icon. 3. Click **Matches current day**. 5. From the **Add condition** dropdown list, select the birthday attribute. 6. In the operator selection menu that opens: 1. Click the calendar icon. 3. Click **Matches current month**. 7. Click **Save**.
Segment of customers who have a birthday on the current day
Segment of customers who have a birthday on the current day
### Create a segmentation for customers whose birthday was in the last 14 days This segment identifies customers who have received a mobile notification about the birthday promotion within the last 14 days. 1. Go to Behavioral Data Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of segmentation. 3. Click **Conditions**. 3. From the **Add condition** dropdown list, select the **Mobile push sent** event. 4. Add the **campaignName** parameter. 5. As the logical operator, select **Equal**. 6. In the blank field enter the campaign name. You must use the same name later, when creating the mobile push template. 7. In the time range settings: 1. Click **Custom**. 2. Set the range to last 14 days. 8. Add additional filters identical to those in the previous segmentation, with the condition that today is the user's birthday. Choose **Add condition**. The `OR` operator should be applied between the "Mobile push sent" filter and the birthday date filter for the first contact. This ensures that customers who respond immediately to the push notification will have the promotion activated, even if there is a delay in processing the `push.send` event.
Segment of customers who have received a mobile notification of a birthday promotion within the last 14 days
Segment of customers who have received a mobile notification of a birthday promotion within the last 14 days.
## Create a promotion --- Create a promotion for customers whose birthday was within the last 14 days (including the current day) on products from the following categories: sweets, cosmetics, and coffee. 1. Go to AI Hub icon **AI Hub > Regular Promotions > Add promotion**. 2. Select the **For selected items** option. 3. In the **Audience** section, select the segment created in [this step](/use-cases/mobile-push-birthday-best-time#create-a-segmentation-for-customers-whose-birthday-was-in-the-last-14-days). 4. In the **Content** section: 1. Define the name, description, and image of the promotion. 2. In the price field, enter `0`. 3. Confirm the settings by clicking **Apply**.
Example of birthday promotion content
Example of birthday promotion content
5. In **Type & limits**, define the settings so that the promotion is available for use for up to 6 products in the cart, while giving a 20% discount on products defined in the **Items** section. 1. As the **Discount type**, choose **Percentage**. 2. In the **Limit per profile**, as the maximum value, enter `6`. 3. In the **Value** section, define the discount as `20`. 6. In the **Schedule** section, define the distribution period of your promotion. 7. **Optional** In the **Stores** section, specify stores where the promotion is available.
This is possible only if the list of stores is imported into a [catalog](/docs/assets/catalogs).
8. In the **Items** section, define a product catalog and a filter - specifying the products that will be discounted.
Example of a catalog filter with products from specific categories
Example of a catalog filter with products from specific categories
You can define the filter directly in the catalog with the products for which the promotion is created. To do this, go to **Catalogs** located in **Data Modeling Hub**, select the catalog you need and define a filter for the products in the categories that are included in the promotion.
Catalog filter
Catalog filter
10. To apply all changes and run the promotion, click **Publish**. ## Prepare a mobile push notification --- Prepare a mobile push with information about the promotion. 1. Go to **Experience Hub > Mobile > Template**. 2. You can use the template from the folder or create your own one using the mobile push code editor. Click **New Template > Simple Push**. 2. Create your mobile push in the code editor. For more information on creating a simple mobile push, visit our [User Guide](/docs/campaign/Mobile/creating-mobile-push).
The template name must be the same as the one you used in the filter when [creating the segmentation](/use-cases/mobile-push-birthday-best-time#create-a-segmentation-for-customers-whose-birthday-was-in-the-last-14-days) earlier!
Example of mobile push notification
Example of mobile push notification
## Create a workflow --- In this part of the process, prepare a workflow that sends notifications for customers celebrating their birthday on the current day, delivering their birthday promotion at the optimal time determined by the Synerise Time Optimizer. 1. Go to **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. 3. As the first node of the workflow, add **Audience**. In the node settings: 1. As the **Run trigger** option, select **repeatable**. 2. Set the interval to 1 day. 3. In the **Begin at** field, select the date, select the hour as 00:00. 4. From the **Timezone** dropdown list, select the time zone consistent with the time zone of your workspace. 5. In the **Define audience** section, click **Segments**. 6. Click **Select segment**. 7. Select the segment of [customers whose birthday is on the current day](/use-cases/mobile-push-birthday-best-time#create-a-segmentation-of-customers-whose-birthday-is-on-the-current-day). 8. Confirm by clicking **Apply**. 4. Add an **Optimize time** node. In the configuration of the node: 1. Select the [custom mode](/use-cases/mobile-push-birthday-best-time#create-a-mobile-mode) you created in previous part of the process. 2. Set the time period to analyze according to your business needs by clicking **Custom time period**. 3. In the **Time period** field, enter `24` 3. Confirm by clicking **Apply**. 4. As the next node, add **Send Mobile Push**. 5. In the configuration of the **Send Mobile Push** node: 1. From the **Template type** dropdown list, select **Simple Push**. 2. Select the **Push template** created in [this part](/use-cases/mobile-push-birthday-best-time#prepare-a-mobile-push-notification) of the process. 6. Confirm by clicking **Apply**. 7. Add the **End** node to finish the workflow. 8. Click **Save & Run**.
Final configuration of a workflow that sends a mobile push to customers whose birthday is on the current day
Final configuration of a workflow that sends a mobile push to customers whose birthday is on the current day
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of the segmentations directly in Synerise demo workspace: - [a segmentation of customers whose birthday is on the current day](https://app.synerise.com/analytics/segmentations/eb0dc5de-da7b-420e-a20a-3f96e57546ff), - [a segmentation of customers whose birthday was in the last 14 days](https://app.synerise.com/analytics/segmentations/5c1343d0-c156-4f1f-9389-b04b5bf8da24). Check also the [configuration of the promotion](https://app.synerise.com/campaigns/promotions/42cfd4d0-dea4-43b5-aa19-34440a3ca350) and [workflow](https://app.synerise.com/automations/automation-diagram/aad0b2b5-401c-43f4-8f1a-48c8f2e265af) created for this use case. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 9 events per profile that completes the flow: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~2), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`snr.ate.prediction`](/docs/assets/events/event-reference/predictions#snrateprediction) (~1), [`push.send`](/docs/assets/events/event-reference/mobile-push#pushsend) (~1), [`push.view`](/docs/assets/events/event-reference/mobile-push#pushview) (~1), [`push.click`](/docs/assets/events/event-reference/mobile-push#pushclick) (~1), [`client.activatePromotion`](/docs/assets/events/event-reference/loyalty#clientactivatepromotion) (~1). ## Read more --- - [Creating promotions](/docs/ai-hub/promotions) - [Mobile push notifications](/docs/campaign/Mobile) - [Time optimizer](/docs/settings/configuration/time-optimizer) - [Workflow](/docs/automation/creating-automation) # In-app Stories with Personalized Product Recommendations Display an engaging in-app story that combines interactive storytelling with AI-driven product recommendations. This feature allows businesses to present relevant products in a dynamic and visually appealing format, enhancing user engagement and increasing conversion opportunities. By leveraging predefined, ready-to-use templates, brands can easily create and adapt stories to their specific needs. In this use case, you'll discover how to create an interactive in-app story promoting a running challenge and specific brand of running shoes. The guide offers detailed steps for using a predefined template, customizing content, and including AI-based recommendations for a personalized and engaging user experience. The target audience consists of women who visited the shoes category in the last 30 days without making a purchase.
In-app Interactive Stories
## Prerequisites --- - [Configure AI engine](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations) for recommendations; enable the personalized recommendation type. - Implement the [transaction events](/developers/web/transactions-sdk) using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). - [Implement Synerise SDK in your mobile app](/developers/mobile-sdk). ## Process --- In this use case, you will go through the following steps: 1. [Prepare the segmentation](#prepare-the-segmentation) of women who have visited the shoes category during the last 30 days and have not made any transaction. 2. [Create an in-app message](#create-an-in-app-message) with product recommendations using the predefined template. ## Prepare the segmentation --- In this part of the process, we will create a segmentation of users who have visited the `women/shoes` category in the last 30 days (website of mobile) but have not made any transaction during that time. 1. Go to Decision Hub icon**Decision Hub > Segmentations > New segmentation**. 3. Enter the name of the segmentation. 4. Click **Add condition**. 4. From the dropdown list, select the `page.visit` event. 6. Click **+ where** and from the dropdown list, select `url`. 7. Choose the **Contain** operator and enter the fragment of the URL for the specific category. In our case it will be `women-shoes`. Alternatively, you can build the following condition: **category equal [category name]**. 7. Using the date picker in the lower-right corner, set the time range to **Last 30 days**. 8. Click **Add condition**. 10. From the list, choose the `screen.view` event, 6. Click **+ where** and from the dropdown list, select `url`. 7. Choose the **Contain** operator and enter the fragment of the URL for the specific category. In our case it will be `women-shoes`. Alternatively, you can build the following condition: **category equal [category name]**. 12. Connect these conditions by the **OR** operator. 7. Using the date picker in the lower-right corner, set the time range to **Last 30 days**. 8. Click **Add condition**. 9. From the list, choose the `transaction.charge` event. 10. By clicking **Performed** above the event name change the condition to **Not performed**. 6. Save the segmentation.
Decision Hub segmentation configuration for targeting customers who visited but did not make a purchase in the last 30 days
Segmentation configuration
## Create an in-app message --- In this part of the process, you will create an in-app campaign. We will use a predefined template for the message with interactive in-app stories, so there is no need to create a template from scratch. 1. Go to Experience Hub icon **Experience Hub > In-app messages> Create in-app**. 2. Enter the name of the in-app. ### Define the audience --- As the first step, define the target group of customers for the in-app message. In this case, we will use the segmentation created in the [previous step](#prepare-the-segmentation). 1. In the **Audience** section, click **Define**. 2. Click **Segmentations**. 3. Click **Select segmentation** and choose the segmentation created in the [previous step](#prepare-the-segmentation). 3. Save settings in the **Audience** section by clicking **Apply**. ### Define content --- In this part of the process, you will use a ready-made template to create the content of the in-app message that will be displayed in the mobile application. 1. In the **Content** section, click **Define**. 2. Click **Create message** and from the list of template folders, select **Predefined templates**. 3. Select the **STORIES** template. **Result:** You are redirected to the code editor.
You can edit the template in two ways, by editing the code of the template, [add inserts](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-snippet-to-the-template-code), [add variables](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-variable) and/or by filling out the form in the Config tab. In this use case, we will use the capabilities of the predefined Config tab.
#### Edit form in the Config tab --- The form in the **Config** tab is already filled in with default values. You can keep them or change them to fit your business needs.
In-app stories message Config tab with slide and general settings
In-app configuration
1. To lock a specific slide that you want to preview and edit, to prevent it from switching automatically, enable the **Config Mode**. 2. In the **Slide number** field, enter the slide number from which you want to edit. 2. In the **General Settings** section: - In **Number of stories**, enter the number of slides in the stories (no more than 5). - In **Stories order**, define the order of stories (for example, 2,3,5,1). - In **Title** and **Subtitle**, define the title and subtitles of the stories respectively. If you don't want to display them, enter a dash (-). - If you want to display the avatar, enable the **Display avatar image** option and in **Avatar image**, enter a link to the source of avatar image. 3. In the **Button** section: - Customize the action button by defining the text on the button (**Text on the button**), the URL to which a user will be redirected (**Destination link**), colors of the button (**Button text color** and **Button color**). 4. Configure the settings for each story - Each story can be customized separately. You can customize copy in a story, select colors of text and background, provide the links to image or video included in the story, and define the display time. 5. After you complete editing the form, disable the **Config mode** option. 5. After you make changes to the template, you can check the preview. 1. Click the **Preview contexts** button on the upper left side. 2. Enter the ID of a customer. 3. Click **Apply**.
Considering that the in-app is very interactive, the preview in the platform may not be enough to test the in-app performance. That’s why we suggest checking the campaign preview directly in the mobile app.
6. If the template is ready, in the upper right corner click **Save this template > Save as**. 7. On the pop-up: 1. In the **Template name field**, enter the name of the template. 2. From the **Template folder** dropdown list, select the folder where the template will be saved. 3. Confirm by clicking **Apply**. 8. To continue the process of configuring the in-app campaign, click **Use in communication**. 9. To save your content changes, click **Apply**. ### Select events that trigger the in-app message display --- In this part of the process, you will define the event triggering the display of the in-app message. 1. In the **Trigger events** section, click **Define**. 2. Select **Add event** and from the dropdown list, choose `screen.view` event. 3. Click the **+ where** button and select `source`. 4. As the logical operator, select **Equal**. 5. As the value add `MOBILE`. 5. Click **Apply**.
In-app message trigger configured with screen.view event filtered by MOBILE source
In-app trigger event configuration
### Schedule the message and configure display settings --- As the final part of the process, you will set the display settings of the in-app message such as schedule, capping, priority of the message among other in-app messages. 1. In the **Schedule** section, click **Define** and set the time when the message will be active. 2. In the **Display Settings** section, click **Change**. 3. Define the **Delay display**, **Priority index** and enable the **Frequency limit** toggle to manage the frequency of in-app message display in the application. 16. Click **Apply**. 17. Optionally, you can define the UTM parameters and additional parameters for your in-app campaign. 18. Click **Activate**. ### Test the in-app campaign --- Read the ["Testing" section](/docs/campaign/in-app-messages/create-inapp-message#testing) to discover how to test your in-app campaign. ## Check the use case set up on the Synerise Demo workspace --- You can check the [segmentation](https://app.synerise.com/analytics-v2/segmentations/e9ba4f5e-76e6-4782-8bc5-3bdb72281688) and [in-app message campaign](https://app.synerise.com/communications/in-app/0954550c-eb59-4b33-a92c-662e348a3029) configuration directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 6 events per profile that completes the flow: [`screen.view`](/docs/assets/events/event-reference/web-and-app#screenview) (~1), [`inApp.show`](/docs/assets/events/event-reference/inapp#inappshow) (~1), [`inApp.click`](/docs/assets/events/event-reference/inapp#inappclick) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [In-app messages](/docs/campaign/in-app-messages) - [Using in-app template builder](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template) # Calculate value of all sold items You can calculate the value of sold items including items sold by weight and volume. It helps you analyze the sold products statistics in more effective way. ## Prerequisites --- - Implement [tracking code](/developers/web/installation-and-configuration#creating-a-tracking-code) on your website. - Implement [transactions](/docs/automation/actions/synerise-integrations/import-transactions). ## Process --- In this use case, you will go through the following steps: 1. [Create an expression](/use-cases/calculate-items-sold-by-weight/?helpCenterAi=calc#create-an-expression) that will be available as a variable when including the `product.buy` event in analytics. 2. [Create a metric](/use-cases/calculate-items-sold-by-weight/?helpCenterAi=calc#create-a-metric) that calculates all sold items. ## Create an expression --- In this part of the process, create an expression that will be available as a variable when including the `product.buy` event in analytics. The formula of the expression multiplies the quantity of the item by the price of a single item. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. Enter the name of the expression.
The name of the expression is also used as the name of the event's parameter.
2. As a type of expression, select **Event**. 2. From the **Choose event** dropdown, select the `product.buy` event. 4. In the **Formula definition** section of the page, click **Select**. **Result**: A dropdown list appears. 6. From the dropdown list, select **Event attribute**. 5. Open the settings of the event attribute by clicking the **unnamed** expression element that appeared. 6. From the **Choose parameter** dropdown, select `$finalUnitPrice`. 7. Next to the added event attribute, click the plus button. **Result**: A dropdown list appears. 8. From the dropdown list, select **Event attribute**. 9. Open the settings of the event attribute by clicking the **unnamed** expression element that appeared. 10. From the **Choose parameter** dropdown, select `$quantity`. 11. Click the mathematical operator between the attributes and change it to multiplication. 12. Click **Save**.
The final form of an expression
The final form of an expression
## Create a metric --- In this part of the process, create a metric that calculates all sold items. The metric reuses the expression you created in the previous part of the process. 1. Go to Decision Hub icon **Decision Hub > Metrics > New metric**. 2. Enter the name of the metric. 3. As a metric kind, select **Simple metric**. 3. As the aggregator, set `Sum`. 4. As the occurrence type, set `All`. 5. From the **Choose event** dropdown list, select `product.buy`. 6. Click where icon button. **Result**: The **Choose parameter** button appears. 7. Click the **Choose parameter** button. **Result**: A pop-up appears. 8. On the pop-up, click the three-dot button. **Result**: A dropdown shows. 9. From the dropdown, select **Expressions**. 10. In the list of expressions, find the event expression you have created earlier. 11. To select a specific time range, click the calendar icon. In our case it will be **Lifetime**. Confirm your choice with the **Apply** button. 12. Click **Save**.
The final form of a metric
The final form of a metric
## What's next --- You can reuse the expression and metric while preparing the analyses to calculate items purchased in a given campaign. You can find more instructions [here](/docs/analytics/analytics-scenarios/items-bought-after-clicking). ## Check the use case set up on the Synerise Demo workspace --- Check the [expression](https://app.synerise.com/analytics/expressions/1302fb26-5895-40c0-8bbf-547e798329c5) and [metric](https://app.synerise.com/analytics/metrics/db5f94fa-4a80-48e0-9bab-79130d1281a8) settings directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case does not generate any events. ## Read more --- - [Expressions](/docs/crm/expressions) - [Metrics](/docs/analytics/metrics) # Predict replenishment Recurring purchases are those purchases that are usually made with some frequency and regularity, such as the purchase of coffee, printer paper, hygiene products, etc. Products purchased on a regular basis fill the greater part of most customers' shopping baskets. That's why it's so important to provide customers with the best experience when making such purchases, reminding them of an upcoming purchase and encouraging them to return more often for these products in your store. The prediction created in this case is based entirely on analytics and calculates the average time between purchases for customers who have made at least three transactions in a given category, so we can calculate when a customer may make the next purchase, anticipating their intention by sending them an email reminder of the upcoming purchase. The described process consists of two automations, where one calculates the average interval between purchases and the other sends an email to the customer at the appropriate time to encourage to replenishment.
Communication for customers making repetitive coffee purchases
## Prerequisites --- - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). - [Create an email account](/docs/campaign/e-mail/configuring-email-account). - [Create an email template](/docs/campaign/e-mail/creating-email-templates) to be used in the email campaign.
We recommend including an [insert](/developers/inserts/recommendations-v2) in the email template with a product recommendation from the specific category to make the buying decision process easier for customers. You can refer to [this use case](/use-cases/personalized-category-reco#create-a-recommendation) to see how to build recommendations filtered to the product category.
## Process --- 1. [Create an event expression](/use-cases/repetitive-purchases#create-an-expression) that converts the time of transaction to a number. 2. [Create an aggregate](/use-cases/repetitive-purchases#create-an-aggregate) that returns the timestamps of the purchased products from the specific category. 3. [Create a workflow](/use-cases/repetitive-purchases#create-a-workflow-to-predict-purchase-time) that calculates the average number of days between a customer's purchases of a product in a specific category and calculates the date of the next purchase based on that number. 4. [Create a workflow](/use-cases/repetitive-purchases#create-a-workflow-to-encourage-a-purchase) that is responsible for sending a reminder to a customer about the next recurring purchase. ## Create an expression --- In this part of the process, you need to create an event expression that converts the timestamp of transaction to a number. This expression will be used later to create an aggregate. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expression > New expression**. 2. Enter the name of the expression. 3. Set the **Expression for** option to **Event**. 4. From the drop-down list, select **product.buy**. 5. In the **Formula definition** section, click **Select**. 6. From the list that opens, select **Function > To number**. 7. In the brackets, click the **Select** button and from the list, select **Event attribute**. 8. Click the **Unnamed** node that appeared. 9. At the bottom of the page, click **Choose parameter**. 10. In the list of attributes, find and select **TIMESTAMP**. 11. Save the expression.
An expression that converts the timestamp to a number
An expression that converts the timestamp to a number
## Create an aggregate --- In this part of the process, you create a dynamic aggregate that returns timestamps of purchases from a specific category. The aggregate will return timestamps (as numbers) from **product.buy** events. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter a meaningful name of the aggregate. 3. Click **Analyze profiles by** and select **Last Multi** and size `15`.
This is the maximum number of a customer's past transactions to be used in the calculation. You can change the number according to your business needs.
4. Select **Consider only distinct occurences of the event parameter**. 5. Select the **product.buy** event. 6. From the **Choose event** drop-down list, select the expression you created [in the previous step](/use-cases/repetitive-purchases#create-an-expression). 7. Click the **+ where** button and from the **Choose parameter** drop-down menu, choose **category**. 8. From the **Choose operator** drop-down, choose **Equal**. 9. Enter the name of the product category. In our example, it's `coffee`. 10. Define the time range as **Last 365 days**. 11. Confirm by clicking **Apply**.
The final configuration of the aggregate
The final configuration of an aggregate
## Create a workflow to predict purchase time --- You need to create a workflow that calculates the average number of days between a customer's purchases from a given category. The result is used to calculate the customer's next purchase probability. 1. Go to **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Profile Event trigger node At this stage you will configure the conditions that will trigger the workflow. As a trigger, you will use the `product.buy` event for the coffee category. 1. As the first node of the workflow, add **Profile Event**. In the configuration of the node: 1. From the **Choose event** drop-down menu, choose the **product.buy** event. 2. Click the **+ where** button and from the **Choose parameter** drop-down menu, choose **category**. 3. From the **Choose operator** drop-down, choose **Equal**. 4. Enter the name of the product category for which you want to predict the time of the customer's next purchase. In our case, it's `coffee`. 5. Confirm by clicking **Apply**. ### Define the Profile Filter node In this part of the process, you need to identify customers for whom the workflow calculates the date of next purchase. It takes into consideration customers who have made at least three separate transactions (**transaction.charge** event) with products from the "coffee" category. 1. Add the **Profile Filter** node. 2. Click the node to open its settings. 3. Click the **Choose filter** button and choose the **product.buy** event. 4. Click the **+ where** button and from the **Choose parameter** drop-down menu, choose **category**. 5. From the **Choose operator** drop-down, choose **Equal**. 6. Enter the name of the product category for which you want to predict the time of the customer's next purchase. In our case it's `coffee`. 7. Click **+ Add funnel step** button and repeat steps 3-6. 8. Set the time range to **Last 365 days before 1 days**. 9. Click the **Choose filter** button and choose the **transaction.charge** event. 10. Click **+ Add funnel step** button and another **transaction.charge** event. 11. Set the time range to **Last 365 days before 1 days**. 12. Confirm by clicking **Apply**. 13. For the **Not matched** path, add the **End** node.
Automation Hub Profile Filter node with funnel checking at least three coffee category purchases and transaction events in the last 365 days
The Profile Filter node configuration
### Define the Generate Event node At this stage, an event is generated on the customer's profile, returning the number of days between purchases and the date when the customer may make the next purchase. It contains the following parameters: - **category** - the category of products for which the calculation is made, - **itemId** - the ID of last product bought from the specific category, - **predictedTime** - calculated date of the next purchase from the specific category, - **predictedTimeInDays** - average number of days between purchases from the specific category. 1. To the **Matched** path of the **Profile Filter** node created earlier, add a **Generate Event** node. In the configuration of the node: 1. In the **Event name**, enter the name of the event that will be generated on the customer's profile. In this case, it is `product.purchasePredictedTime` 3. Add the JSON body of the event. You can use the example below.
Example jinjava code
{ "category": "coffee", "itemId": "{{ event.params.$sku }}", "predictedTime": "{% set avgTime = [] %}{% aggregate PASTE_AGGREGATE_ID_HERE %}{%set timeDiff = []%}{% for item in range(aggregate_result|length-1) %}{%set diff = aggregate_result[loop.index] - aggregate_result[loop.index-1]%}{% do timeDiff.append(diff)%}{% endfor %}{% set temp = timeDiff|sum/(aggregate_result|length-1) %}{% do avgTime.append(temp) %}{{ datetimeformat(unixtimestamp(null) + avgTime[0], '%Y-%m-%d') }}{% endaggregate %}", "predictedTimeInDays": "{{avgTime[0]/86400000}}" }
The above jinjava code contains the logic of calculating the average number of days between purchases from the specific category and calculating the date of a next purchase. It can be copied 1:1 into the Generate Event node. However, remember to replace the ID of aggregate in this code with the [ID of the aggregate created earlier in the process](/use-cases/repetitive-purchases#create-an-aggregate).
4. Confirm by clicking **Apply**.
Configuration of the Generate Event node
Configuration of the Generate Event node
Example of a generated **product.purchasePredictedTime** event:
Example of a generated event
Example of a generated event
### Add final settings to your workflow 1. Add the **End** node. 2. Launch the workflow by clicking **Save & Run**.
Automation Hub workflow for re-engaging customers with repetitive purchase patterns
Configuration of the workflow
## Create a workflow to encourage a purchase --- With the above workflow in place, you can create another workflow in which you send a message reminding the customer of the next purchase. This workflow starts each day for a group of customers whose expected purchase date is the current day. 1. Go to **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Audience node In this stage, you create an Audience that checks for the presence of the **product.purchasePredictedTime** event on a user's card in the last 30 days with a specific product category (in our case, coffee), where the predicted purchase date is on the current day. In addition, the Audience filter includes only those customers who have agreed to receive communications. 1. Start the workflow with the **Audience** node and open the node's settings. 2. In **Define audience**, choose **New Audience** and click **Define conditions**. 3. From the **Choose filter** drop-down menu, choose the **product.purchasePredictedTime** event. 4. Click the **+ where** button and from the **Choose parameter** drop-down menu, choose **predictedTime**. 5. From the **Choose operator** drop-down menu, select **Date > Current date > Matches current day**. 6. Click the **+ where** button and from the **Choose parameter** drop-down menu, choose **predictedTime**. 7. From the **Choose operator** drop-down menu, select **Date > Current date > Matches current month**. 8. Click the **+ where** button and from the **Choose parameter** drop-down menu, choose **predictedTime**. 9. From the **Choose operator** drop-down menu, select **Date > Current date > Matches current year**. 10. Click the **+ where** button and from the **Choose parameter** drop-down menu, choose **category**. 11. From the **Choose operator** drop-down, choose **Equal**. 12. Type the name of the product category - `coffee`. 13. Define the time range to the **Last 30 days**. 14. From the **Choose filter** drop-down, choose the **newsletter_agreement** parameter. 15. From the **Choose operator** drop-down, choose **Equal** and and specify the condition as **enabled**. 16. Confirm by clicking **Apply**.
Automation Hub Profile Filter node configuration with purchase prediction, category, and newsletter conditions
Configuration of the Audience node
### Define the Send Email node In this step, choose an email template for the upcoming purchase. 1. To the **Matched** path, add the **Send Email** node and open its settings. 2. In the **Sender details** section, choose the email account from which the email is sent. 3. In the **Content** section, select the template that you prepared as a part of the prerequisites. 4. **Optional**: In the **UTM & URL parameters** section, define the UTM parameters added to the links included in the email. 5. In the **Additional parameters** section, optionally describe campaigns with [additional parameters](/docs/campaign/e-mail/creating-email-campaigns#adding-custom-parameters). 6. Click **Apply**. ### Add final settings to your workflow 1. Add the **End** node. 2. Launch the workflow by clicking **Save & Run**.
Automation Hub workflow for sending upcoming purchase reminder notifications
Configuration of the workflow
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of each step directly in the Synerise Demo workspace: - [Expression](https://app.synerise.com/analytics/expressions/04e342d8-5e14-4d7b-be39-a6bf117c1bff) - [Aggregate](https://app.synerise.com/analytics/aggregates/0b329a23-4a80-3522-8938-981254f92150) - [Workflow for purchasing time calculations](https://app.synerise.com/automations/automation-diagram/44c9e618-f72a-4720-8dbc-774f8752ad30) - [Workflow for sending a mailing communication](https://app.synerise.com/automations/automation-diagram/dfaf267d-c186-40c3-965f-810646b4a982) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 12 events per profile that completes the flow: [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~2), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~2), `product.purchasePredictedTime` (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Automation Hub](/docs/automation) - [Email campaigns](/docs/campaign/e-mail) - [Expressions](/docs/crm/expressions) - [Segmentation](/docs/analytics/segmentations) # Dynamic remarketing with AI recommendations --- Not all potential customers that come to your website purchase right away. You need to continue to influence them not only from your website, but also across Google’s display network. Segmenting visitors and remarketing to those that have ‘Abandoned the Shopping Cart’ or ‘Visited A Product Page” may not be enough. If you want to beat your competitors you should take your **remarketing campaign** a step further, **using our AI recommendation engine** and showing customers the most relevant products. ## Example of use - Home appliances industry **Challenge** A client from the home appliance industry decided to use AI recommendation campaigns outside their website with Google remarketing. They wanted to show customers personalized recommendations based on their behavior. They already had such a campaign on their homepage and they wanted to display those products to customers while they browsed the Internet. To do this, they added Google Data Layer events to the script with a recommendations campaign to get the ID of products recommended to each customer. In this way they were able to **display their campaigns with personalized products on external websites** as remarketing to customers who previously visited their page. ![Screenshot presenting dynamic remarketing](/api/docs/image/f8a57079df9dd82ae8b22dc747691385d7d51d29/use-cases/all-cases/_gfx/dynamic_remarketing.png) ## Requirements --- 1. Basic elements of AI integration: - Tracker - Product feed, filled with appropriate custom attributes - Transactional events - OG tags 2. Google Data Layer implemented on the website ## How to do it --- You need to send a dataLayer.push event to every visitor of your website. Add the script below in the java script section in the dynamic content with the recommendation campaign:
<script> 
dataLayer.push({ 
'pid': 'product_id', 
'event': 'event_name' 
'sce': 'campaign_name'}); 
</script>
Where: - `product_id`- recommended product ID - `event_name`- name of the event, by which you will recognize AI recommendation's campaign - `campaign_name`- optionally, name of the recommendation campaign. Very useful if you send to the Data Layer products from more than one AI campaign a time
Remember that you need to send a separate event for every product.
## Generated events This use case generates approximately 5 events per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - Read more about [AI](/docs/ai-hub/recommendations-v2/recommendation-types#personalized) - Read more about [creating metrics](/docs/analytics/metrics) - Read more about [dynamic content](/docs/campaign/dynamiccontent) - Read more about [recommendation types](/docs/ai-hub/recommendations-v2) # Promotion triggered by basket value In order to increase your sales, you need to make every customer count. The ability to automatically trigger a promotion for your loyal customers at certain basket values will help you boost your average basket value. It can also make customers more satisfied, reliable, and profitable. In this use case, you will create a promotion for members of a loyalty program: they will receive a specific product for free when their cart value exceeds 100 PLN. ## Prerequisites --- - [Implement promotions in your mobile application](/developers/mobile-sdk/loyalty), [API](https://hub.synerise.com/api-reference/loyalty-and-engagement#operation/profileLogin). - [Import your product feed to catalogs](/use-cases/import-product-feed-to-catalog). - If you want to limit the promotion to only some of your stores, add the list of stores to a catalog. Such a catalog must contain a unique store ID and any other store attributes by which you will filter stores, such as city, zip code, etc. More information about catalogs can be found [here](/docs/assets/catalogs). ## Security configuration --- Before you start working with this hub, if you are a Synerise customer or partner, consider reading [the section about denylisting events](/docs/settings/tool/api#denylist). This natively accessible configuration will allow you to manage the restrictions in points management that may help you prevent fraud. ## Process --- 1. [Prepare segmentation](/use-cases/promotion-triggered-by-basket-value#prepare-a-segmentation) of customers who are members of the loyalty program. 2. [Create a promotion](/use-cases/promotion-triggered-by-basket-value#create-a-promotion). ## Prepare a segmentation --- In this part of the process, create a segmentation of customers who are members of the company's loyalty program. 1. Go to Behavioral Data Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of segmentation. 3. From the **Choose filter** dropdown list, select the **loyaltyCard** attribute. 4. As the logical operator select Boolean **Is true**.
The conditions used in the segment will vary depending on your loyalty program integration (for example, the name of the attribute may be different). You must define the segmentation accordingly.
5. Click **Save**.
An example of a customer segment that participates in a loyalty program
An example of a customer segment that participates in a loyalty program
## Create a promotion --- 1. Go to AI Hub icon **AI Hub > Regular Promotions > Add promotion**. 2. Select the **For selected items** option. 3. In the **Audience** section, select the segmentation created in [this step](/use-cases/promotion-triggered-by-basket-value#prepare-a-segmentation). 4. In the **Content** section: 1. Define the name, description, and image of the promotion. 2. In the **price** field enter `0`. 3. Confirm the settings by clicking **Apply**.
AI Hub promotion Content section with name, description, image, and zero price for a basket value triggered promotion
Example of promotion content
5. In the **Type and limits** field, define the settings so that the promotion is only available once to loyalty program members: 1. As the **Type**, choose **Members only**. 2. In the **Limit per profile** section, enter `1`. 3. In the **Value** section, define the discount as `100%`. 4. Switch the **Basket trigger** toggle on. 5. In the **Minimum value** field, enter `100`. 6. Apply changes. 6. In the **Schedule** section, define the promotion distribution period according to your business needs. 7. **Optional** In the **Stores** section, specify stores where the promotion is available.
This is possible only if the list of stores is imported into a [catalog](/docs/assets/catalogs).
8. In the **Items** section, specify the catalog item to be discounted: 1. In the **Source catalog** field, select an item catalog to select the promotional items from. 2. Select a promotional item by using the **Select items** option (in our case, the item is a coffee). 10. To apply configuration and run the promotion, click **Publish**. ## Check the use case set up on the Synerise Demo workspace --- You can check the [segmentation](https://app.synerise.com/analytics/segmentations/1f34841c-8dd8-49f6-acd9-aab7ce928e23) and [promotion settings](https://app.synerise.com/campaigns/promotions/b168dea2-0f33-46a5-8066-68e8d380c40d) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 4 events per profile that completes the flow: [`client.activatePromotion`](/docs/assets/events/event-reference/loyalty#clientactivatepromotion) (~1), [`transaction.charge`](/docs/assets/events/event-reference/items#transactioncharge) (~1), [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~2). ## Read more --- - [Creating segmentations](/docs/analytics/segmentations) - [Creating promotions](/docs/ai-hub/promotions) # Visual search Visual search can really enhance shopping experience. By just taking a photo or uploading one of the items your customers are interested in, they will can search for visually similar products. Implementing visual search can connect online and offline shopping and the path from search to conversion may get shorter. Customers will be more willing to make a purchase when finding items is easier. Combining this with functionalities such as query rules, ranking may bring your business some serious benefits, and take the search experience to another level. This use case describes the process of creating an index for a visual search engine and further step you should take to implement it on your website, including ideas on how you can upgrade it for an even better search experience.
The view of implemented visual search in Synerise demo shop
## Prerequisites --- - [Prepare an item feed](/developers/product-feed). - [Enable AI Search for the selected feed](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-search#enabling-ai-search-for-the-feed)
After the configuration, contact [Synerise Support](https://hgintelligence.atlassian.net/servicedesk/customer/portal/1?snrs_cl=c4396770-2f57-11ed-91d5-d354b5b26860&snrs_medium=email&snrs_test=true&snrs_cp=a3e34858-a036-42b8-b794-31c1415855a8&snrs_he=-1381345904&snrs_n=4&snrs_action=newsletter.click&snrs_category=client._DEVICE_.browser.mail&snrs_var=6853245&snrs_redir=1) and ask to enable visual search for your workspace.
## Create an index --- We will configure an index for AI search and the settings for how it will work - this is the place for adding proper rules, ranking settings, returned attributes, and so on. Later, this index will be used during the implementation of the search - in the application or on the website. 1. Go to AI Hub icon **AI Hub > Indexes**. 2. Click **Add index**. **Result:** The index creation screen opens. 4. From the **Choose feed** dropdown list, select a catalog that contains an item feed based on which you would like to create an index. 5. From the **Choose search language** dropdown, select the language of your search engine. 7. Click **Next step**. 6. Choose **Search Method**. 9. **Add searchable attributes**. Searchable attributes are used by the search engine to calculate the item’s relevance to the query phrase provided by the customer. Attributes can be assigned to three importance levels: high, medium and low. When a word from the phrase matches an attribute, the score amount is assigned depending on importance assigned to the attribute. 6. Optionally, to display unavailable items in the search results, enable the **Include out of stock items** option. 7. Click **Next step**.
The view of creating new index
New index configuration
8. Optionally, you can select item attributes which will be used as response, filterable, facetable, and sortable attributes. 9. In the Item ranking section, define the criteria for sorting items in search results. 14. Click **Finish**. **Result:** Your index is configured, now you can use the **Preview** tab to test the if the results meet your expectations.
The testing of the index setup
The Preview section
## What's next --- Once you set up AI search, you can use it in various channels. For example, you can incorporate it into a website with [dynamic content](/docs/campaign/dynamiccontent/creating-dynamic-content). Alternatively, you can implement it as a feature in a mobile app or use it in an in-app message. In order to get the visual search results, you need to [use the dedicated API method](https://hub.synerise.com/api-reference/ai-search#tag/Visual-Search). In our demo workspace, we have prepared [a ready-made implementation of visual search](https://app.synerise.com/campaigns/preview/120e4d68-8d2d-45cb-90b4-c26be451616d), from which you can take inspiration when it comes to implementing it in your own shop. Check out an example visual search in our [demo shop](https://demoshop.synerise.com/). ## Check the use case set up on the Synerise Demo workspace --- You can check the [index configuration](https://app.synerise.com/ai-v2/search/indices/f2fc5cbb9955469b1c94368ee66de93c1663658739/stats/global) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 2 events per profile that completes the flow: [`item.search`](/docs/assets/events/event-reference/search#itemsearch) (~1), [`item.search.click`](/docs/assets/events/event-reference/search#itemsearchclick) (~1). ## Read more --- - [AI Search](/docs/ai-hub/ai-search) - [Dynamic content](/docs/campaign/dynamiccontent) # First run in-app message First-run in-app messages play a pivotal role in establishing a meaningful connection with customers from the outset of their interaction with a digital product or service. First-run in-app messages serve as a direct communication channel between the product and its users, allowing for personalized engagement. By conveying a brand's personality and values, these messages can create an immediate sense of connection, fostering a positive relationship between the user and the product. Welcome messages can be considered as one of the examples of this kind of messages. A "Warm Welcome" message serves as the virtual handshake of the digital realm, extending a friendly greeting to users as they embark on their journey with a new app. This type of in-app message is crucial for setting the tone and establishing a positive initial interaction. In this use case, we will create the first run in-app message that will be displayed to users who are logging into the mobile app for the first time. We will be using predefined in-app template. Created message will not only greet users warmly but also offer a unique voucher code, adding an extra touch to enhance their first purchase experience. ## Prerequisites --- - [Implement Synerise SDK in your mobile app](/developers/mobile-sdk). - Implement a dedicated custom event that is sent to the customer's profile when they first enter the mobile app. This event should be sent only one time, during first visit in the mobile application. In this use case, we use `app.firstVisit` event. - Create [voucher pool](/docs/assets/code-pools) for users who are logging to the mobile application for the first time. ## Create an in-app message --- Create an in-app campaign triggered by the `app.firstVisit` event for customers who logged into the mobile application for the first time. We will use a predefined template for this message, so there is no need to create a template from scratch. 1. Go to Experience Hub icon **Experience Hub > In-app messages> Create in-app**. 2. Enter the name of the in-app. ### Define the audience --- As the first step, define the target group of customers for the in-app message. In this use case, this segment acts as an additional security measure that helps to include only people who have never seen this in-app message before.
The accuracy of this segment depends on the retention set for the **inApp.show** event.
1. In the **Audience** section, click **Define**. 2. Click **New Audience** and then **Define conditions**. 3. Click **Add condition**, from the dropdown list, select the **inApp.show** event. 4. Next to the **inApp.show**, click **+where**. 5. From the dropdown list, select **id**. 6. As the operator, choose **Equal**. 7. Enter the In-app campaign ID in the text field. You can locate the ID in the campaign's URL link. For instance, in the URL https://app.synerise.com/communications/in-app/fb5932ab-ae00-4302-948f-39c3aa72b542 the ID is `fb5932ab-ae00-4302-948f-39c3aa72b542`. 8. Change **matching** condition to **not matching** to find all profiles that don't meet the defined condition. 9. Use the time filter to define analysed time period. 10. Click **Apply**. 11. To save the audience, click **Apply**.
Audience configuration
Audience configuration
### Define content --- In the next step, you will create the content of the in-app message that will appear in the mobile application with the help of ready-made template. 1. In the **Content** section, click **Define**. 2. Click **Create message** and from the list of template folders, select **Predefined templates**. 3. Select the **Fullscreen** template. **Result:** You are redirected to the code editor.
You can edit the template in two ways, by editing the code of the template ([add snippets](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-snippet-to-the-template-code), [add variables](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-variable) and/or by filling out the form in the Config tab. In this use case, we will use the capabilities of the predefined Config tab.
#### Edit form in the Config tab --- The form in the **Config** tab is already filled in with default values. You can keep them or change them to fit your business needs. In this use case, we will make changes to the graphic, header, description, and call to action button. We will also use inserts to personalize the displayed message. 1. In the **Background** section, adjust the background color and background image if needed. 2. In the **Image** section, leave the default image URL or change it to an image customized for your message (add the image to **Data Modeling Hub > Files** and then you can find there the URL to this image). 3. In the **Header** section, customize the header text, font size and color to your specifications. Example of header used in this use case: `Welcome {% customer firstname %}!` 4. In the **Description** section, customize the description text, font size and color to your specifications. Example of the description used in this use case: `To kick off your journey, here's an exclusive voucher code just for you: {% voucher assign=false %} fca2d8c1-afb0-4bb3-9198-4ac7d00c4233{% endvoucher %} Use this code at checkout for a special 20% discount on your first purchase! Ready to dive in? Explore our app now and redeem your voucher code.` Where
{% voucher assign=false %} pool-uuid {% endvoucher %}
is an insert that assigns a code from a pool to a customer (unless one is already assigned) and [retrieves that same code for this customer every time](/developers/inserts/insert-usage#retrieving-the-same-code-every-time). The value `pool-uuid` must be replaced with the ID of your voucher pool. 5. In the **CTA button** section, customize the button text, corner radius, color, background color, and URL to which a user is redirected according to your needs. 6. In the **Close button** section, select the position of the closing cross. 7. In the **Automatically Disappear** section, you can enable the **Automatically Disappear** switch and define a timeout for this in-app message in seconds, or leave this switch disabled by default. 8. You can also enable **Use deep links** option if you are using deep links as CTA links. 9. When the template is ready, in the upper right corner click **Save as**. 10. On the pop-up: 1. In the **Template name field**, enter the name of the template. 2. From the **Template folder** dropdown list, select the folder where the template will be saved. 3. Confirm by clicking **Save**. 11. To continue the process of configuring the in-app campaign, click **Next**. 12. To save your content changes, click **Apply**. In the screens below you can see a preview of the final in-app message configuration with and without contextual preview.
In-app preview without user context
In-app preview without user context
In-app preview with user context
In-app preview with user context
### Select events that trigger the in-app message display --- In this part of the process, you will define the event triggering the display of the in-app message. 1. In the **Trigger events** section, click **Define**. 2. Select **Add event** and from the dropdown list, choose `app.firstVisit` event. 3. Click the **+ where** button and select `source`. 4. As the logical operator, select **MOBILE_APP**. 5. Click **Apply**. ### Schedule the message and configure display settings --- As the final part of the process, you will set the display settings of the in-app message such as schedule, capping, priority of the message among other in-app messages. 1. In the **Schedule** section, click **Define** and set the time when the message will be active. 2. In the **Display Settings** section, click **Define**. 3. Define the **Delay display**, **Priority index**, **Frequency limit** and/or **Capping limit**. In our case, we want to display the message once per user. To do this, we set the limit for displaying this in-app message to once per user. 4. Click **Apply**. 5. Optionally, you can define the UTM parameters and additional parameters for your in-app campaign. 6. Click **Activate**. ## Check the use case set up on the Synerise Demo workspace --- You can check the [Voucher pool](https://app.synerise.com/assets/vouchers/pools/fca2d8c1-afb0-4bb3-9198-4ac7d00c4233/coupons) and [In-app message](https://app.synerise.com/communications/in-app/fb5932ab-ae00-4302-948f-39c3aa72b542) configuration directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 4 events per profile that completes the flow: `app.firstVisit` (~1), [`inApp.show`](/docs/assets/events/event-reference/inapp#inappshow) (~1), [`inApp.click`](/docs/assets/events/event-reference/inapp#inappclick) (~1), [`voucherCode.assigned`](/docs/assets/events/event-reference/loyalty#vouchercodeassigned) (~1). ## Read more --- - [In-app messages](/docs/campaign/in-app-messages) - [Jinjava inserts](/developers/inserts) - [Mobile campaigns](/docs/campaign/Mobile) - [Using in-app template builder](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template) # Automated Replenishment Email with Upsell Recommendations You can encourage customers to reorder items that they have previously purchased, to meet demand. This kind of campaign increases the chances of making a purchase and thus increase your revenue. It might be useful especially in the FMCG industry, for products that sell quickly as coffee or milk. Additionally, we can use boosting to promote more products based on chosen indicators. Boosting rules are built using the same editor as the filters, but unlike filtering, boosting does not entirely exclude items that do not meet the conditions. In this use case, we will create the workflow which, after a month from the transaction, will send an email with recommended products from a specific category (coffee) to encourage the customer to reorder. The recommendation will be boosted by the personalization model to boost products whose price exceeds the average price of all the customer's transaction from a specific category. ## Prerequisites --- - Implement transaction events either through [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). - Create [an email account](/docs/campaign/e-mail/configuring-email-account) - Create [items feed](/docs/ai-hub/recommendations-v2/item-feed-requirements) - **Recommended**: Become familiar with [creating recommendations](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign). ## Process --- In this use case, you will go through the following steps: 1. [Create an aggregate](/use-cases/replenishment#create-an-aggregate) that calculates the average value of products from the `Coffee` category previously bought by the customer. 2. [Create the recommendation with boosting rules](/use-cases/replenishment#create-the-recommendation-with-boosting-rules). 2. [Create an email template](/use-cases/replenishment#create-an-email-template). 3. [Create a workflow](/use-cases/replenishment#create-a-workflow). ## Create an aggregate --- In this part of the process, create an aggregate that calculates the average value of products bought by the customer from `Coffee` category. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Average**. 4. From the **Choose event** dropdown list, select the `product.buy` event. 4. As the event parameter, select **$finalUnitPrice**. 5. Next to the **$finalUnitPrice**, click **+where**. 6. From the dropdown list, select **$category**. 7. As the operator, choose **Equal**. 9. In the text field, enter the value of the category you want to use in replenishment campaign - in this use case, it will be `Coffee`. 8. Define the period analyzed in the aggregate. 9. Save the aggregate.
Decision Hub Average aggregate returning the average finalUnitPrice of Coffee category product.buy events
Configuration of the aggregate
Configuration of this aggregate depends on the implementation of the transaction events and it might differ for each workspace.
## Create the recommendation with boosting rules --- In this step, we create a personalized recommendation that will be filtered to the coffee category. Additionally, we will apply boosting rules to this campaign to promote products whose price is higher than the average price of the previously purchased products from this category by a customer. ### Create the campaign --- 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. In the **Type & Items feed** section: 1. Select an item catalog. 2. As a recommendation type, select **Personalized recommendations**. 3. Click **Apply**. 3. In the **Items** section, configure at least one slot. 1. Choose the minimum and maximum number of products to be displayed in the recommendation frame. 2. In the **Static filter** section, click **Choose filter**. 3. Select **Visual Builder**. **Result**: The Visual Builder window appears. 4. From the **Select attribute** dropdown list, choose the **category** attribute. 5. As the logical operator, select **Equals**. 6. From the **Select value** dropdown list, select **Coffee**. 7. In the **Level range** field, enter `0`. 4. Click **Apply**.
Replenishment static filter section
Static filter section
### Build the boosting rule --- In this part of the process, you will build a rule that boosts the products whose price is higher than the average price a customer paid for the transaction during the specific period. 1. In the **Boosting** section, click **Define**. 2. Click **Add rule**. 3. Click **Define rule** and select **IQL Query**. **Result**: The IQL Query window opens. 4. Click the **Select** node. 5. From the dropdown list, select **Attribute**. 6. Click the **null** node. **Result**: The **Select value** button appears. 7. Click **Select value**. 8. From the dropdown list, select the **price** attribute. 9. Click the Plus icon 10. From the dropdown list, select **Context**. 11. Click the **null** node. **Result**: The **Select value** and **Property** buttons appear. 12. From the **Property** dropdown list, select **Aggregate context**. 13. From the **Select value** dropdown list, select an aggregate created in [the previous step](/use-cases/replenishment#create-an-aggregate). 14. Change the mathematical operator between the nodes to the greater-than sign (**>**). 8. Click **Apply**.
Boosting items
Boosting items with the price higher than the average value of order in this category
9. In the **Promote/Demote** selector, select **Promote** (default value). 10. Use the slider to adjust how much you want the rule to affect the results. 11. Save the **Boosting** section settings by clicking **Apply**. 12. Optionally, you can define the settings in the **Additional settings** section. 13. Save the recommendation. ## Create an email template --- In this part of the process, prepare an email template with the recommendation created in [the previous step](/use-cases/replenishment#create-the-recommendation-with-boosting-rules) that will encourage a customer to make another purchase from the specific category. 1. Go to Experience Hub icon **Experience Hub > Emails > Templates > Drag&drop builder** or **Code editor** to create an email template. 2. In the upper right corner, click **Inserts**. In the **AI Cart Recommendations 2** catalog, find [previously build recommendations](/use-cases/replenishment#create-the-recommendation-with-boosting-rules) on the list of inserts. 3. Copy and paste the Jinjava code of the recommendation and insert it to the template of your email. 4. Adjust the visual layer of the email to your needs. 4. Save your template. ## Create a workflow --- In this part of the process, create a workflow which is triggered by the `product.buy` event from `Coffee` category. The workflow will wait 30 days. If a customer did not make another purchase from this category after that period, we will send the email with the recommended products. 1. In Synerise, go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. 3. As the first node, add **Profile Event**. In the configuration of the node, select the event that triggers the workflow. In this use case, it's a `product.buy` event, 4. Click **+ where** and choose **$category**. 5. As the logical operator, select **Equal**. 6. In the text field, enter `Coffee`. 4. Confirm by clicking **Apply**. 5. As the second node, add **Delay**. In the configuration of the node, set the period to `30 days`. 6. As the next node, choose **Profile Filter** to check if customers have bought a product from the coffee category during last 30 days. To do this: 1. Choose the `product.buy` event. 2. As the parameter, choose **$category**. 5. As the logical operator, select **Equal**. 6. In the text field, enter `Coffee`. 3. Set the time range to last 30 days. 4. Click **Apply**. 7. To the **Matched** path, add the **End** node. 8. To the **Not matched** path, add the **Send Email** node. 9. In the **Send email** node configuration: 1. In the **Sender details**, define the account from which the email will be sent. 2. In the **Content** section: 1. Enter the subject of the email which will be visible in the customer's inbox. 2. Select the email template created in [the previous step](/use-cases/replenishment#create-an-email-template). 3. Optionally, you can add UTM and URL parameters. If not, click **Skip step**. 10. Confirm by clicking **Apply**. 7. Add the **End** node to finish the workflow. 8. Optionally, you can set up the capping for this workflow based on your business needs. 8. Click **Save & Run**.
Replenishment workflow
Workflow configuration
## Check the use case set up on the Synerise Demo workspace --- You can check the the configuration of each step from this use case in our Synerise Demo workspace: - [Aggregate](https://app.synerise.com/analytics/aggregates/3b5d4f67-ed80-33d8-838f-00be16a0b5f7) - [Recommendation](https://app.synerise.com/ai-v2/recommendations/gHRu3EMcjO6w) - [Workflow](https://app.synerise.com/automations/automation-diagram/3b9158df-b63f-4845-a81e-a53adf9101c8) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 12 events per profile that completes the flow: [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Automation Hub](/docs/automation) - [Email campaigns](/docs/campaign/e-mail) - [Recommendations](/docs/ai-hub/recommendations-v2) # AI recommendations enriched with customer opinions --- Other customers opinions often have a big impact on user purchasing decisions. We consider positive and negative opinions when we buy, especially when purchasing more expensive items. It's worth using positive opinions in AI ​​recommendation filters or boosting when displaying recommendations on the page. This will be helpful in campaigns which are created to promote the best products to those who best match them. In this way we can highlight them and encourage more people to buy them. ## Example of use – Home appliances industry One of our customers from the home appliances industry decided to exclude products with an average opinion below 3.0 in the recommendations on the home page. Additionally, while displaying recommendations on the site, he decided to sort the displayed products in order of number of opinions. ![Screenshot presenting recommendations with opinions](/api/docs/image/f8a57079df9dd82ae8b22dc747691385d7d51d29/use-cases/all-cases/_gfx/recommendations_with_opinion.png) ## Requirements - Tracker - Imported correct feed - Suitable AI models trained (e.g. personalized) - Two custom feed attributes: - Average product opinion Example name: Attribute value type: numeric (float) - Number of opinions expressed about the product Example name: Attribute value type: numeric (float) ## How to do it --- 1. Prepare an AI campaign that includes the right filter for the attribute with the average review. 2. Prepare dynamic content for the campaign using inserts in Jinjava. Additionally, use Jinjava to sort products by number of reviews.
{% set tab = [] %}  
   {% recommendations2 campaignId=campaign_hash %}  
   {% for p in recommended_products2 %}  
   {% set count = (loop.index - 1) %}  
   {% for r in p.customAttributes %}  
   {% if r.name == 'average_rating' %} 
    <!-- WE SAVE RATING AND INDEX OF PRODUCT -->  
   {% do tab.append({rating:r.value, index: count}) %}  
   {% endif %}  
   {% endfor %}  
   {% endfor %}  
   {% for r in tab|sort(true, true, 'rating') %}  
   {{ r }}  
   <!-- SHOW PRODUCTS SORTED BY RATING -->  
   {{ recommended_products2[r.index].productRetailerPartNo }}<br>  
   {% endfor %}{% endrecommendations2 %}
## Generated events This use case generates approximately 5 events per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - Read more about [Jinjava inserts](/developers/inserts/insert-usage) (recommendations) - Read more about [Loops in Jinjava](/developers/inserts/tag) - Read more about [Product feed preparation](/developers/product-feed) # Time-window event aggregates *"How much revenue did this email drive? Did the push notification lead to a purchase? Which campaign gets credit for the sale?"* - the usual answer comes in one of two forms, and each has a drawback. You can build the metric logic and formulas by hand, but joining a click to a later purchase this way relies on approximations — proxies for the link between the two events — so the result is never fully accurate. Alternatively, you can export the raw events and wait for the BI or analytics team to join clicks to purchases for you, which arrives days later as a static spreadsheet that cannot be refreshed. A third option avoids both drawbacks: a single metric that returns the number directly. The difference from the hand-built approach is not the number of metrics involved — it is how the link between the two events is made. A time-window event aggregate tracks a triggering event (for example, a `newsletter.click`) within a defined rolling window. When this aggregate is attached as a condition to a metric built on a base event (for example, each `transaction.charge`), it checks, for every occurrence of the base event, whether the triggering event happened first, within that window. The link between the action and the outcome is established at the event level — not approximated — without hand-built formulas and without an export to refresh. Because it runs on first-party events rather than tracking pixels, the result is not affected by cookie consent or cross-device behavior. This builds on a familiar idea: a standard Last aggregate returns a profile's most recent value within a date range. An event aggregate applies the same Last logic at the event level — it evaluates each occurrence of the base event and looks at what happened before it — so the defined window only sets how far back it checks for the triggering event. The key characteristic of this aggregate: it returns nothing on its own. It is a condition attached to a base event. You are not asking *"what did each customer do"* — you are asking *"of all these purchases, which ones followed the triggering action within the window."* This applies to any scenario where one action causes a later outcome inside a known time horizon: email, push, in-app, recommendations, or in-store visits. This use case shows how to build that metric, step by step, using email attribution as the example. ## Example - Email attribution --- **Business question:** *"How many transactions can we credit to the newsletter, and to which campaign specifically?"* **Why this matters:** Open Rate and CTR tell you that people engaged with the email. They do not tell you that anyone bought anything. Without connecting the click to the transaction, email's contribution to revenue stays an assumption rather than a measured number. This use case provides the number, and it holds up against cookie consent, ad-blockers, and cross-device behavior, because it runs on first-party events rather than tracking pixels. The three levels below are not three separate metrics. They are one metric, extended step by step. On its own it returns a single number (Level 1). Add a dimension and that same number splits into a table, one row per campaign (Level 2). Expose its parameter as a dynamic key and a user can enter any campaign and read its result on a dashboard (Level 3). The attribution logic stays identical at every level; what changes is only the dimension or parameter added on top. The [Process](#process) section builds it. ### Level 1 - Total *"How much did the newsletter drive overall?"* One number: the count of transactions that happened within 24h of any newsletter click. **What decisions you can make based on the metric result:** - Defend or challenge the email channel's revenue contribution in a business review. - Track the trend over time — is email-driven revenue growing or declining? - Set the baseline before testing a new send strategy. ### Level 2 - Per campaign *"Which campaign gets the credit?"* The same logic, broken out into a table — one row per campaign, showing how many post-click transactions each one drove. In this variant, the metric is used inside a report, with the campaign ID set as a dimension. The metric returns the attributed transaction count; the report is what breaks it into one row per campaign. **What the report shows:** a table of `campaignId` (or `campaignName`) | transactions attributed. **What decisions you can make based on the metric result:** - Stop crediting campaigns with high open rates that drive clicks but no purchases. - Identify the subject lines or offers that convert, not just engage. - Reallocate send budget toward campaigns with proven downstream revenue. ### Level 3 - Self-serve *"Let marketers check any campaign themselves."* The same metric, exposed as a dashboard field where a user enters a campaign ID and instantly sees that campaign's attributed transactions. It uses last-click logic, so a purchase is credited only to the most recent newsletter click before it (if a customer clicks campaign X and then campaign Y, only Y receives the sale). **What decisions you can make based on the metric result:** - Hand campaign owners a self-service answer instead of a request to the analytics team. - Wire the dashboard directly to email communications so the campaign context is passed automatically. - Standardize how the whole team measures email-driven revenue. ## Prerequisites --- The [Process](#process) below builds the total and per-campaign version step by step. All logic is configured inside Synerise using analytics features. No SQL, API, or external attribution tool is required. The same steps apply to other triggering actions — only the events and the window change. For more examples, see [Other applications](#other-applications). - Both events must be tracked — the triggering event (for example, the `newsletter.click`) and the outcome event (for example, `transaction.charge`). - For a breakdown, the identifying parameter must be on the event - e.g. `newsletter.click` must carry a campaign id if you want results split by campaign. - Decide the attribution window up front (24h / 48h / 72h). This is a business decision, not a technical default — see the note in the [Process](#process) section. - The events you want to analyze must already exist in the workspace. For building the aggregate and the metric, see [Creating event aggregates](/docs/crm/aggregates/creating-event-aggregates) and [Creating simple metrics](https://hub.synerise.com/docs/analytics/metrics/creating-simple-metrics/).
Understand the model - the aggregate alone returns nothing. It only produces results once attached as a condition to a base event inside a metric.
- For the self-serve dashboard: the dynamic key must be named exactly (lowercase, for example `id`) so the predefined parameter passing from communications works. See [Creating dashboards](https://hub.synerise.com/docs/analytics/analytics-dashboard/creating-dashboards/). ## Process --- In this use case, you will go through the following steps: 1. Create an **event aggregate**. 1. Analyze events by **Last – Time Window** type. 2. Select the `newsletter.click` event to aggregate by chosen function. 3. As the event parameter, select **TIMESTAMP**, 4. Set the **Time window** to 24 hours.
The preview of the configuration of the event aggregate
Configuration of the event aggregate
The aggregate returns nothing on its own; this is expected, because it acts as a condition.
2. Create a **simple metric**. 1. Set the **Type** to **Event** and the **Aggregator** to **Count**. 2. Select the `transaction.charge` event. 3. As the event parameter, select the aggregate created in the previous step. 4. Add a condition that the event aggregate **Is not null**.
The preview of the configuration of the metric with the aggregate used as a condition
Configuration of the metric with the aggregate used as a condition
3. Optionally, go deeper: - **Per campaign** — add a second event aggregate that returns the campaign ID, and use it as a dimension in a report. - **Self-serve** — set the aggregate's parameter as a dynamic key (/docs/analytics/i_events-parameter-value#how-to-create-a-dynamic-key) (regex value `.` matches all when the field is left blank, and a specific value when filled), then add a matching profile filter on the metric so Synerise treats it as dynamic.
**Attribution Choices - read this before you rely on the number.** - **Window length is a tradeoff.** Too short and you under-credit the channel (slow buyers fall outside the window); too long and you over-credit it (purchases that would have happened anyway get attributed). Choose the window deliberately, per purchase cycle. - **This is last-click, single-touch attribution.** Earlier clicks receive no credit. This fits the question *"which campaign closed the sale"*; it is not the right model for *"which campaign started the journey."* Confirm which question you are answering.
## What's Next --- After building the metric, you can: - Tune the window to match the real purchase cycle for each channel. - Break down the result by campaign using a report dimension. - Make it self-serve with [a dynamic-key dashboard](/docs/analytics/analytics-dashboard/creating-dashboards#dynamic-data-in-dashboards) wired to your communications, so the campaign context is passed automatically. - Pin to a dashboard and set alerts when attributed revenue drops. - Reuse the same three steps for push, in-app, recommendations, and in-store scenarios. ## Other applications --- The same setup — a triggering event, a time window, and a base event — answers other questions. These are applications of the same pattern, not pre-built reports. Only the events and the window change. | Triggering action | Outcome (base event) | Question it answers | | --- | --- | --- | | Push click / push delivered | `transaction.charge` | How much revenue followed a push within 24–48h? | | In-app banner or message view | `transaction.charge` | Did the in-app campaign convert, or was it only seen? | | Recommendation click | `product.buy` | Did the recommendation lead to an actual purchase, not just a click? | | Abandoned-cart reminder sent | `transaction.charge` | What share of reminded carts were recovered in the window? | | App open | `transaction.charge` | Do app sessions convert to a purchase within the day? | The window length is the lever: match it to the realistic decision cycle for that action. ## Read more --- - [Event aggregates](/docs/crm/aggregates/creating-event-aggregates) - [Metrics](/docs/analytics/metrics) - [Reports](/docs/analytics/reports) - [Creating reports](/docs/analytics/reports/creating-reports) - [Dashboards](/docs/analytics/analytics-dashboard) # Suggest items more expensive than customer's average purchase AI search is a type of search engine that uses artificial intelligence to understand the user’s intent and provide the most relevant results. Synerise AI search, lets you manage the behavior of the search engine for example by promoting specific products or adding specific circumstances, and also try out various configurations of the search engine by [A/B tests](/docs/ai-hub/ai-search/configuring-ab-test). AI Search not only can search relevant products in the feed based on custom rules but also provides the possibility of applying personalization and filters which can contain dynamic customer attributes such as aggregates and expressions. This use case describes the process of calculating the average value of purchased items for a specific customer. Knowing this value, you will proceed to create a rule to present in the search results only those items whose price is above the average value a customers spent in the lat 30 days. ## Prerequisites --- - Enable [the AI Search Engine](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-search) for your workspace. - Create and configure [search index](/docs/ai-hub/ai-search/create-index) and in the [filterable attributes](/docs/ai-hub/ai-search/define-attributes#filterable-attributes) add `Price.Value` as a range attribute. - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). - [Implement AI search](https://hub.synerise.com/api-reference/ai-search) in any of your channels (mobile app, website, and so on). ## Process --- In this use case, you will go through the following steps: 1. [Create an aggregate](/use-cases/query-filtering#create-an-aggregate) to calculate the average value a customer spent in the last 30 days. 2. [Create a query rule](/use-cases/query-filtering#create-a-query-rule) (based on the aggregate created in the first step) that enforces showing in the search results only more expensive products than customer's average purchase in the last 30 days. ## Create an aggregate --- In this part of the process, create an aggregate that returns the average value of products bought by an individual customer. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Average**. 4. From the **Choose event** dropdown list, select the `product.buy` event. 5. As the event parameter, select **$finalUnitPrice**. 6. Define the period from which data will be analyzed. In our case it will be last 30 days. 7. Save the aggregate.
Decision Hub Average aggregate returning the average product purchase price from product.buy events in the last 30 days
Aggregate settings
## Create a query rule --- In this part of the process, create a query rule based on the [aggregate](/use-cases/query-filtering#create-an-aggregate) created in the previous step. The rule will enforce showing in search results only the products which are more expensive than the average purchase of a customer. 1. Go to AI Hub icon **AI Hub > Indexes**. 2. Select an index from the list. 3. Go to the **Rules** section. 4. On the right side of the screen, click **Add rule**. 5. Name the rule. 6. To adjust the query conditions, in the **Conditions** section, click **Define**. 1. Choose the **All queries** tab. 2. Click **Apply**. 7. To define how the search engine reacts to the defined conditions, in the **Consequences** section, click **Define**. 1. Click **Add consequence** and choose **Filter query results** from the dropdown list. 9. From the **Attribute** dropdown list, choose `Price.Value`. 10. Choose the **More than** operator. 10. In the left field, click the **T** icon and from the dropdown list, select **Aggregate**. 11. From the list, choose [aggregate](/use-cases/query-filtering#create-an-aggregate) created in the previous step. 12. Enable the **Mark as elastic** option to make sure that the products more expensive than average value of products bought by a specific customer appear at the top of the search results. If you do not activate this option, search results will show only those products. 13. Click **Apply**. 8. In the **Schedule** section, you can define when the query rule applies. 8. Click **Save & Publish**.
Query rule settings
Query rule settings
## Check the use case set up on the Synerise Demo workspace --- You can check the [aggregate](https://app.synerise.com/analytics/aggregates/869e7abf-f235-3614-af7c-69b22ad88175) and [query rule settings](https://app.synerise.com/ai-v2/search/indices/98167fa2726dc2460deb41870c0e6d1c1729168383/query-rules/35599) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 2 events per profile that completes the flow: [`item.search`](/docs/assets/events/event-reference/search#itemsearch) (~1), [`item.search.click`](/docs/assets/events/event-reference/search#itemsearchclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [AI Search](/docs/ai-hub/ai-search) # Customers' data import from SFTP server If you gather your customers' data in several sources, you can use Automation Hub to synchronize it with the customers' profiles in Synerise. It’s possible thanks to the HTTP and SFTP integrations that allow you to send data to Synerise from external sources and the other way round. This use case describes how to prepare an automated workflow that launches every day and donwloads an updated list of customers with their agreement for email communication from an external resource to Synerise. The automation connects to an external resource using the SFTP protocol and imports data from a CSV file. One of the challenges addressed in this use case is renaming a column in the CSV file while importing the data. ## Prerequisites --- - Host the .csv file with customers' marketing agreements data on an SFTP server. - Prepare a sample of data that will be used in data transformation. To do this, you can take the real file and remove rows until about 10 are left. ## Process --- 1. [Create data transformation rules](/use-cases/import-customers-data-from-sftp#create-data-transformation-rules) that will transform data from the .csv file. 2. [Prepare a workflow](/use-cases/import-customers-data-from-sftp#prepare-a-workflow) that imports data about customers' marketing agreements from the SFTP server to Synerise. ## Create data transformation rules --- In this part of the process, you define the rules of modifying data. The data transformation diagram which is the output of this part of the process is used later to [automate sending the data](/use-cases/import-customers-data-from-sftp#prepare-a-workflow). The sample file is used to configure the data transformation diagram and preview its results. With a [library of nodes](/docs/automation/data-transformation-and-imports/transformations-and-data-operators), you can modify the file by adding, renaming, and merging columns, as well as editing the values in the rows, and so on. In this example, we will use the **Rename column** node to transform a customers' marketing agreements file so it meets Synerise's requirements. 1. Go to Automation Hub icon **Automation Hub > Data Transformation > Create transformation**. 2. Enter the name of the transformation. 3. Click **Add input**. ### Add file with sample data This node allows you to add a data sample. In further steps, you define how the data must be modified. Later, when this transformation is used in the workflow, the system uses the rules created with the sample data as a pattern for modifying actual data. 4. On the pop-up, click **Add example**. 5. Upload the file with the sample data. Below is the sample used in this article. It consists of two columns, where the first contains a customer's email address, and the second contains the marketing consent: `0` means disabled, `1` means enabled. ``` email;newsletter agreement john.doe@synerise.com;1 ``` 6. Click **Generate**.
Data Transformation Data input node showing sample file with email and newsletter agreement columns
The configuration of the Data input node
**Result:** The **Data input** view is filled with data from the sample.
Data input of the sample file
Data input of the sample file
### Rename column The column name is the key under which the data will be imported to Synerise and appear in the output file. In this example, we will use the **Rename column** node to rename the **newsletter agreement** column to **agreements.email**. 1. On the canvas, click the right mouse button. 2. From the dropdown list, select **Rename column**. 3. Click the Rename column node. 4. In the configuration of the node: 1. Click **Add rule**. 2. Select the **Include these** option. This is the default option. All column names you select will be changed as you specify in the further configuration. 3. Click **Add column**. 4. From the dropdown list, select the columns you want to rename. 5. Under the **Edit values by** subheader, select the **Replacing** option. This option finds values matching the conditions and replaces them with the value you specify.
Example of the configuration of the Rename column node
Example of the configuration of the Rename column node
5. Before you save the settings, you can check the preview of the file after changes in the **Output data** tab. 6. Confirm by clicking **Apply**. ### Add the finishing node This node ends the transformation and passes the modified data to the automation where the Data Transformation is used. 1. On the canvas, click the right mouse button. 2. From the dropdown list, select **Data output**. 3. In the upper right corner, click **Save and publish**. **Result**:
Data Transformation diagram for importing customer data from SFTP
The diagram of data transformation
After the data transformation is published, you can use it in the Data Transformation node while preparing a workflow that imports the files. ## Prepare a workflow --- As the second part of the process, create a workflow which imports the custom events every day to Synerise. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the launch date 1. As the trigger node, add **Scheduled Run**. 2. In the configuration of the node: 1. Leave the **Run trigger** option at default (**all time**). 2. From the **Timezone** dropdown list, select the time zone consistent with the timezone selected for your workspace. 3. Define the frequency of the workflow (for example, everyday at 6.00 A.M.). The workflow will automatically launch everyday at the specified time.
Automation Hub Scheduled Run node configuration for triggering customer data import from SFTP
The configuration of the Scheduled Run node
4. Confirm by clicking **Apply**. ### Configure settings for SFTP protocol Use the **Get File** node to transfer the files from the workflow to your server using SFTP protocol. 1. Add the **Get File** node by clicking **THEN > SFTP**. 2. In the [**configuration of the node**](/docs/automation/integration/sftp-integrations/sftp-get-file) : 1. Enter the path to your server. 2. Select the port. 3. Enter the path to the directory. 4. Enter the name of the file where the data will be saved. 6. From the **File format** dropdown list, select the **CSV** format. 7. Verify and modify the delimiters if needed. 8. In the **Authentication** section, select the method of authentication.
The configuration of the SFTP node
The configuration of the SFTP node
3. Confirm by clicking **Apply**. ### Select the data transformation rules 7. Add a **Data Transformation** node. 8. In the configuration of the node, select the [data transformation you have created before](/use-cases/import-customers-data-from-sftp#create-data-transformation-rules).
Example of the configuration of the Data Transformation node
Example of the configuration of the Data Transformation node
9. Confirm by clicking **Apply**. ### Import customers 1. Add the **Import Profiles** node. In the settings of the node, you can check the list of the optional columns. 2. Confirm by clicking **Apply**. ### Add the finishing node 12. Add the **End** node. 13. In the upper right corner, click **Save & Run**. **Result**:
Automation Hub workflow for importing customer data from SFTP
The workflow configuration
You can monitor the flow of the workflow in the **Transformation logs** tab. It contains information about each execution of the workflow.
Automation Hub Transformation logs tab showing workflow execution history
The logs for the workflow
## Check the use case set up on the Synerise Demo workspace --- You can check the [data transformation rules](https://app.synerise.com/automations/data-transformation/29bfc71a-e94a-4a25-aab0-a6cc363cea1b) directly in Synerise Demo workspace. Also, you can check there the created [workflow](https://app.synerise.com/automations/automation-diagram/ae1a378c-f72c-42ba-a6fa-c037ff184742). If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 6 events per workflow execution: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`profile.updated`](/docs/assets/events/event-reference/profiles#profileupdated) (~1). ## Read more --- - [Data Transformation](/docs/automation/data-transformation-and-imports/introduction) - [Behavioral Data Hub](/docs/crm) # Banner with a discount for subscribing to a newsletter Getting people to actually subscribe to a mailing list is very important but at the same time it definitely isn’t easy. Increasing the number of subscribers is key when it comes to the effectiveness of your email marketing programs. Most people check their email every day, and it is an important place to maximize your conversion opportunities.  If you want people to subscribe to your newsletter, you need to **make the benefits clear to them**. Offering a discount can be an incentive to sign up. Remember that the moment you send the invitation is also very important. It’s better to send it when customers view your products or spend time on your website since it’s unlikely that a visitor will decide immediately after visiting your home page to sign up to a newsletter. One option is to put the sign-up box in a fixed position on the site, perhaps in the header or footer, so users know where to find it. ## Example of use - Retail industry **Challenge** A client from the retail industry wanted to increase newsletter sign-ups. For signing up for the newsletter, they offered a discount on the first purchase. This information was available to everyone in the footer of the page. However, they decided to make this information more visible to users who did not yet belong to the database. For this purpose, they prepared a scrollable banner that was displayed in the bottom corner of the screen only to people who hadn’t signed up yet and visited more than two products in the previous day. The message said "We have 40 PLN for you for your first shopping". If customer clicks this banner, a popup with a subscription form will be opened. ![Screenshot presenting banner with discount](/api/docs/image/f8a57079df9dd82ae8b22dc747691385d7d51d29/use-cases/all-cases/_gfx/banner_with_discount.png) **Results** Leads from this campaign were **13%** of the whole list of new monthly subscribers ## Requirements --- To use this case, you have to meet a few conditions: - Synerise Tracker - Tagging forms - Collecting marketing consents for the newsletter in Synerise ## How to do it --- 1. Prepare your dynamic content campaign 2. Create an appropriate segment of people in which two conditions will be met: - attribute newsletter_agreement = disabled - aggregate counting events visiting the product card will have a value greater than 2. For this purpose, create an aggregate in advance, in which you will indicate event page visit, where OG tag retailer part number exists (retailer_part_no is true). ![Screenshot presenting banner with discount](/api/docs/image/f8a57079df9dd82ae8b22dc747691385d7d51d29/use-cases/all-cases/_gfx/banner_with_discount2.png) ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1), [`form.submit`](/docs/assets/events/event-reference/web-and-app#formsubmit) (~1). ## Read more --- - Read more about [dynamic content campaigns](/docs/campaign/dynamiccontent) - Learn more about [aggregates](/docs/crm/aggregates) - Learn more about [segmentation](/docs/analytics/segmentations/creating-segmentations) # Send a message encouraging replenishment on WhatsApp WhatsApp is a trusted platform by millions of users worldwide, making it a valuable channel for customer communication. It's a channel where you can get closer to your customers by forming personalized communication with them, building a stronger bond with your brand, and increasing loyalty. Thanks to Synerise's integration with WhatsApp, you have unlimited possibilities to customize your communication with customers. You can take advantage of all the insights you collect in Synerise and use them effectively to deliver the greatest value to your customers. This use case shows a scenario with a replenishment campaign. You will learn how to perform a simple integration with WhatsApp to send a personalized message to customers encouraging them to reorder a product from a specific category, additionally incentivizing the reorder by giving them a discount code for that purchase.
WhatsApp replenishment campaign
## Prerequisites --- - Make sure you meet all [prerequisites](/docs/automation/integration/whats-app/send-template-message#prerequisites) to work with the **Send Template Message** node. - Implement transaction events either through [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). - Create [item feed](/docs/ai-hub/recommendations-v2/item-feed-requirements) - Create a [voucher pool](/docs/assets/code-pools). The ID of this voucher pool will be used as a dynamic value during the message creation process, allowing discount codes to be assigned to each customer participating in this scenario. ## Process --- 1. [Create an aggregate](/use-cases/send-replenishment-message-on-whats-app#create-an-aggregate) which returns the SKU of the last purchased product from the specified category. 2. [Create a message template in the Meta portal](/use-cases/send-replenishment-message-on-whats-app#create-a-message-template-in-the-meta-portal) 3. [Create a workflow to send a message to customers on WhatsApp](/use-cases/send-replenishment-message-on-whats-app#create-a-workflow-to-send-message-to-customers-on-whatsapp) ## Create an aggregate --- In this part of the process, create an aggregate that returns the SKU of the last purchased product from the `Coffee` category. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last**. 4. From the **Choose event** dropdown list, select the `product.buy` event. 4. As the event parameter, select **$sku**. 5. Next to the **$sku**, click **+where**. 6. From the dropdown list, select **$category**. 7. As the operator, choose **Equal**. 9. In the text field, enter the value of the category you want to use in replenishment campaign - in this use case, it will be `Coffee`. 8. Define the period analyzed in the aggregate. 9. Save the aggregate.
Decision Hub Last aggregate returning the SKU of the last Coffee category product.buy event
Configuration of the aggregate
## Create a message template in the Meta portal --- Create a message template in the Meta portal that you will use in the next part of the process. In the body of the message, mark places where the dynamic elements will be added. In addition, if you would like to add a CTA at the end of the message, you can add a button and define its copy. The page to which the customer will be redirected after clicking the button can be defined in Synerise. The example message used in this use case: `Hello {{1}}, it looks like you’re almost out of Coffee! Make an order for {{2}} now before it’s too late. Use the {{3}} code to get your 20% discount on your next purchase.` Where `{{1}}, {{2}}` and `{{3}}` are markers that will be replaced with the dynamic values. This step will be done in Synerise. The screen below shows an example of creating a template message in the Meta portal:
An example of body section configuration in Meta platform
An example of body section configuration in Meta platform
In the following screen, you can see how a button can be defined in the Meta portal:
An example of button section configuration in Meta platform
An example of button section configuration in Meta platform
## Create a workflow to send message to customers on WhatsApp --- The workflow will be triggered by the `product.buy` event from the selected product category. The delay is defined up to 30 days. If a customer does not make another purchase from the defined category after that period, we will send a WhatsApp message with the recommended products from the defined category. 1. In Synerise, go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the trigger node 3. As the trigger node, add **Profile Event**. In the configuration of the node, select the event that triggers the workflow. In this use case, it's a `product.buy` event. 4. Click **+ where** and choose **$category**. 5. As the logical operator, select **Equal**. 6. In the text field, enter `Coffee`. 4. Confirm by clicking **Apply**.
Automation Hub Profile Event node configured with product.buy event filtered by Coffee category
Configuration of the Profile Event node
### Configure the Delay node 1. Add the **Delay** node. In the node settings: 1. In the **Delay** field, type `30`. 2. From the dropdown list, choose **Day**. 2. Click **Apply**. ### Define the profile filter node As the next node, choose **Profile Filter** to check if customers have bought a product from the Coffee category during last 30 days. To do this: 1. Choose the `product.buy` event. 2. As the parameter, choose **$category**. 5. As the logical operator, select **Equal**. 6. In the text field, enter `Coffee`. 3. Set the time range to last 30 days. 4. Click **Apply**. 7. To the **Matched** path, add the **End** node.
Configuration of the Profile Filter node
Configuration of the Profile Filter node
### Define the Send Template Mesage node 8. To the **Not matched** path, add the WhatsApp **Send Template Message** node. 1. Click **Select connection**. 2. From the dropdown list, select the connection. - If no connections are available or you want to create a new one, see [Create a connection](/docs/automation/integration/whats-app/send-template-message#create-a-connection). - If you selected an existing connection, proceed to defining the integration settings. 3. In the **Sender ID** field, enter the phone number ID from which the message will be sent. [You can find more information about phone number ID here](https://developers.facebook.com/docs/whatsapp/cloud-api/get-started/add-a-phone-number). 4. In the **Receiver** field, enter the phone number of the customer who will receive this message. We recommend using the `{% customer phone %}` insert, which inserts the phone number of an individual customer who goes through this node. 5. In the **Message template** field, enter the name of the [message template](/use-cases/send-replenishment-message-on-whats-app#create-a-message-template-in-the-meta-portal) you created earlier in the Meta portal. 6. From the **Language code** dropdown list, select the language used in the message. 7. In the **Message components** field, insert the object that contains the dynamic values in the order defined in the message template. The example of object used in this use case:
The aggregate and voucher pool IDs are used as examples for the purpose of this use case.
[
     {
            "type": "body",
            "parameters": [
            {
                "type": "text",
                "text": "{% customer firstname %}"
            },
            {
                "type": "text",
                "text": "{% aggregate c37acfe7-08a1-345c-a3e7-da795bb6a326 %}{% for item in aggregate_result %}{% catalog.store-1(item).name %}{% endfor %}{% endaggregate %}"
            },
            {
                "type": "text",
                "text": "{% voucher %} 8c3c8fd3-e7e9-487d-ba89-0b7824f65f33 {% endvoucher %}"
            }
        ]
    }, 
    { 
        "type": "button", 
        "parameters":
        "index": "0",
        "sub_type": "url", [
            {
                "type": "url",
                "text": "{% aggregate c37acfe7-08a1-345c-a3e7-da795bb6a326 %}{% for item in aggregate_result %}{% catalogvar.store-1(item).url %}{{ catalog_result|replace('https://yourshop.com', '') }}{% endcatalogvar %}{% endfor %}{% endaggregate %}" 
            }
        ]
    },
    { 
        "type": "header",
        "parameters": [ 
            {
                 "type": "image",
                 "image": {
                      "link": "{% aggregate c37acfe7-08a1-345c-a3e7-da795bb6a326 %}{% for item in aggregate_result %}{% catalogvar.store-1(item).image %}{{ catalog_result }}{% endcatalogvar %}{% endfor %}{% endaggregate %}"
                 }
             }
         ]
     }
   ]
9. Click **Apply**. The following table explains all the inserts used in the body, button and header sections shown above. | Section | Insert value | Insert explanation | |---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | body | `{% customer firstname %}` | The value of this insert is used as the value of `{{1}}`, so the name of a customer can be displayed in the message. | | body | `{% aggregate c37acfe7-08a1-345c-a3e7-da795bb6a326 %} {% for item in aggregate_result %} {% catalog.store-1(item).name %} {% endfor %} {% endaggregate %}` | The value of this insert is used as the value of `{{2}}` to return a product that the customer bought the last time and did not purchase again within the estimated time period. | | body | `{% voucher %} 8c3c8fd3-e7e9-487d-ba89-0b7824f65f33 {% endvoucher %}` | The value of this insert is used as the value of `{{3}}`. In this example, we assign a voucher code from the voucher pool to an individual customer. | | button | `{% aggregate c37acfe7-08a1-345c-a3e7-da795bb6a326 %}{% for item in aggregate_result %}{% catalogvar.store-1(item).url %}{{ catalog_result\|replace('https://yourshop.com', '') }}{% endcatalogvar %}{% endfor %}{% endaggregate %}` | The value of this insert is used to return product url. Here we specify the URL omitting the domain, because we define the domain in the Meta platform, as you can see in the screenshot with the [button creation](/use-cases/send-replenishment-message-on-whats-app#create-a-message-template-in-the-meta-portal). | | header | `{% aggregate c37acfe7-08a1-345c-a3e7-da795bb6a326 %}{% for item in aggregate_result %}{% catalogvar.store-1(item).image %}{{ catalog_result }}{% endcatalogvar %}{% endfor %}{% endaggregate %}` | This value of insert is used to return the url to the product image in header. |
Automation Hub workflow for sending a replenishment WhatsApp message
Workflow configuration
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of the [aggregate](https://app.synerise.com/analytics/aggregates/c37acfe7-08a1-345c-a3e7-da795bb6a326) and the [workflow](https://app.synerise.com/automations/automation-diagram/998f1dc1-932d-4636-bb98-d1d823b00af6) directly in our Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 8 events per profile that completes the flow: [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`voucherCode.assigned`](/docs/assets/events/event-reference/loyalty#vouchercodeassigned) (~1), [`whatsapp.sendTemplateMessage`](/docs/assets/events/event-reference/integration#whatsappsendtemplatemessage) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Automation Hub](/docs/automation) - [Jinjava inserts](/developers/inserts) - [Recommendations](/docs/ai-hub/recommendations-v2) - [WhatsApp **Send Template Message** node](/docs/automation/integration/whats-app/send-template-message) # Multiple metrics in one report Answering a question such as *"Which campaigns drive engagement? Which stores perform best? How do loyalty tiers affect purchase behavior?"* usually requires building three or four separate reports and comparing them manually, or writing an API query. A single report can include several metrics of the same type, displayed side by side and split by one dimension. Instead of exporting multiple CSV files and combining them in a spreadsheet, you get one report, multiple columns, and one table. This applies to any scenario where you need three to four KPIs of the same type, split by a single dimension such as campaign, store, segment, or channel. ## Example - Campaign effectiveness --- **Business question:** *"Which email campaigns drive the most opens AND clicks - and which just burn volume?"* **Why this matters:** The number of messages sent does not indicate campaign quality on its own. A campaign with a high send volume but a low click-through rate may perform worse than a smaller campaign with strong engagement (for example, a campaign with 100k sends and a 1% CTR is less effective than one with 10k sends and a 20% CTR). By combining Sent, OR, CTR, and CTOR in a single report, you can evaluate the full performance of each campaign in one view, rather than analyzing each metric separately. **What the report shows:** - campaignName - Sent - count of message.send - OR - open rate in % - CTR - click-through rate in % - CTOR - click-to-open rate in %
The preview of the campaign effectiveness report with a chart and a breakdown table split by campaignName
Report preview with a chart and a breakdown table split by campaignName
**Based on this report, you can:** - Reduce investment in campaigns with high send volumes but low engagement. - Identify subject line or content patterns shared by the best-performing campaigns. - Support decisions to pause or rework specific campaigns with data rather than assumptions. The process below builds this campaign effectiveness report step by step. The same steps apply to other scenarios — only the metrics and the dimension change. For more examples, see [Other applications](#other-applications). ## Prerequisites --- - The metrics you want to compare must be the **same type** — all profile-based or all event-based. Different metric types cannot be mixed in one report. - You need a **dimension to split the results by**, for example `campaignName`, `retailStoreID`, `customerLoyaltyTier`, or `campaignId` - in this case, `campaignName`. - The metrics you want to display must already exist in the workspace. For information on building metrics, see [Creating metrics](/docs/analytics/metrics). To reuse the rate metrics referenced in this use case (`Open Rate`, `CTR`, `CTOR`), see [Calculate CTR, OR, and CTOR based on unique event occurrences](/use-cases/calculate-ctr-or-ctor). ## Process ---
The configuration of the Metrics, Dimension, and Range sections for the campaign report
Configuration of the metrics and dimension
In this use case, you will go through the following steps: 1. Create the report. 2. Add the dimension `campaignName`. 3. Add the metrics using [existing formulas](/use-cases/calculate-ctr-or-ctor). 4. Rename columns and format as percentages. 5. Preview the results. 6. Save the report. ## What's Next --- After saving the report, you can: - Monitor it weekly on a dashboard. - Share with your team inside and outside of Synerise. - Export for analysis in other tools. ## Other applications --- The same report-building steps apply to other analyses. Only the metrics and the dimension change. The scenarios below show common variations. ### Store Performance **Business question:** *"Which physical stores sell the most - and which have the best basket quality?"* **Why this matters:** A store with an average transaction count but a high Average Order Value (AOV) represents a different situation than a store with many transactions and a low Average Order Size (AOS). Analyzing all three metrics together provides the context needed to make accurate operational decisions.
The configuration of the Metrics, Dimension, and Range sections for the store performance report
Configuration of the metrics and dimension
Each metric describes a different aspect of store performance: - Transaction count reflects traffic.
The configuration of the Number of transactions metric used in the store performance report
Configuration of the Number of transactions metric
- AOV reflects basket size.
The configuration of the AOV metric used in the store performance report
Configuration of the AOV metric
- AOS reflects the number of items per purchase.
The configuration of the AOS metric used in the store performance report
Configuration of the AOS metric
**What the report shows:**
The preview of the store performance report with a chart and a breakdown table split by retailStoreID
Report preview with a chart and a breakdown table split by retailStoreID
**Based on this report, you can:** - Identify stores that may benefit from upsell training (high traffic, low AOV). - Recognize stores outperforming others in their region (high AOV and high AOS). - Share a single report view with store operations teams, without exporting data to external tools. ### Loyalty Tier Analysis **Business question:** *"Do loyalty members spend more than non-members, and is the program worth maintaining?"* **Why this matters:** Without this comparison, the return on investment of a loyalty program is difficult to assess. Viewing Transactions, AOV, and AOS split by loyalty tier (basic, plus, and non-members) in a single table provides the data needed to support or challenge the program investment during business reviews.
The configuration of the Metrics, Dimension, and Range sections for the loyalty tier report
Configuration of the metrics and dimension
**What the report shows:**
The breakdown table of the report split by customer loyalty tier
Report breakdown table split by customer loyalty tier
**Based on this report, you can:** - Confirm or disprove that loyalty members generate higher basket value. - Determine whether the program primarily drives purchase frequency (Transactions) or order value (AOV). - Use the results to justify program costs or to support changes to the tier benefit structure. ## Generated events This use case does not generate any events. ## Read more --- - [Reports](/docs/analytics/reports) - [Creating reports](/docs/analytics/reports/creating-reports) - [Metrics](/docs/analytics/metrics) - [Dashboards](/docs/analytics/analytics-dashboard/introduction-to-dashboards) # Cleaning and Transforming Data for Optimal Business Performance The better quality data you have at your disposal, the better the actions and analyses you perform on that data. However, the data you have is not always in a state ready for analysis. The files may contain redundant or incorrect data. There may also be duplicate or missing values. To make sure that the data you want to use in your activities and analyses is properly prepared, it is a good idea to clean data before using it. Automation Hub comes to your aid. It gives you the ability to perform a large number of operations on any data you need to modify. This use case describes the process of transformation of a CSV file with electronic card transactions. The data transformations performed in this use case consist of: - removing columns with missing data - adding missing data - removing structural errors by adding suffixes - filtering rows After transformation, the file will be transferred to an SFTP server. ## Prerequisites --- - Save the file which you want to transform to your computer. - You must have a target resource with which you transfer the data (in this use case, an SFTP server is used). - Make a copy of the data file and remove rows from the copy until 10 are left. This copy will be used only as a sample for configuring the Data Transformation rules. ## Process --- 1. [Prepare data transformation](/use-cases/data-cleaning#create-data-transformation-rules) to modify the data to meet the requirements of the external resource data structure. 2. [Prepare a workflow](/use-cases/data-cleaning#prepare-a-workflow) that sends the data of customers from Synerise to the external resource. ## Create data transformation rules --- In this part of the process, you define the rules of modifying data before sending it to the SFTP server, so the data is consistent. Each of the following sub-steps describes the individual changes performed on the file. The data transformation diagram which is the output of this part of the process is used later to [automate sending the data](/use-cases/data-cleaning#prepare-a-workflow). 1. Go to Automation Hub icon **Automation Hub > Data Transformation > Create transformation**. 2. Enter the name of the transformation. 3. Click **Add input**. ### Add file with sample data This node allows you to add a data sample. In further steps, you define how the data must be modified. Later, when this transformation is used in the workflow, the system uses the rules created with the sample data as a pattern for modifying actual data. 1. On the pop-up, click **Add example**. 2. Upload the file with the sample data. 3. Click **Generate**.
Data Transformation Data input node showing sample data upload for data cleaning
The configuration of the Data input node
### Remove irrelevant data In this step, use the **Remove columns** node, to remove the columns that do not contain data, these are the columns named: **Series_title_3** and **Series_title_4**. 1. On the canvas, click the right mouse button. 2. From the dropdown list, select **Remove columns**. 3. Click the **Remove columns** node. 4. In the configuration of the node: 1. Leave the **Remove Columns** option selected in the dropdown menu. 2. Leave the default value in the dropdown as **Equal**. 3. In the text field, enter the name of the empty column you want to remove - `Series_title_3`. 4. Click **Add condition**. 5. Repeat steps **4.b-d** to define all the columns you want to delete.
The configuration of the Remove columns node
The configuration of the Remove columns node
This resulted in the removal of columns **Series_title_3** and **Series_title_4**:
Output data after applying Remove columns node
Output data after applying Remove columns node
6. Confirm by clicking **Apply**. ### Handle missing data Use the **Edit values** node that allows you to perform basic actions on the dataset. In this example, handle missing data in the **Suppressed** column by replacing its contents (in this example, the column is empty) with the value `false`. 1. On the canvas, click the right mouse button. 2. From the dropdown list, select **Edit values**. 3. Click the **Edit values** node. 4. In the configuration of the node: 1. Click **Add rule**. 2. Click **Add column**. 3. Select the **Suppressed** column. 4. Under **Edit values by**, from the dropdown list, select **Replacing**. 5. In the left dropdown, leave the **Value** option at default. 6. In the text field, enter `false`.
The configuration of the Edit values node
The configuration of the Edit values node
As a result, you will get an updated file:
Output data after applying Edit values node
The configuration of the Edit values node
7. Confirm by clicking **Apply**. ### Fix structural errors Structural errors are when you notice strange naming conventions, typos, or incorrect capitalization when measuring or transmitting data. Use **Edit values** node to make the format of the data in the column **Data_value** consistent. Currently, in the **Data_value** column, the data appears both as number `36422` and float `33317.4`. To make the data consistent, unify the data to float. 1. On the canvas, click the right mouse button. 2. From the dropdown list, select **Edit values**. 3. Click the **Edit values** node. 4. In the configuration of the node: 1. Click **Add rule**. 2. Click **Add column**. 3. Select the **Data_value** column. 4. Click on the three dots on the right side of the screen view; you'll see two options: Add value filter, Remove rule. 5. Click **Add value Filter**. 6. Under **If current value**, from the dropdown list, select **Not contain**. 7. In the text field, enter `.`. 8. Under **Edit values by**, from the dropdown list, select **Adding suffix**. 9. In the text field, enter `.0`.
The configuration of the Edit values node
The configuration of the Edit values node
As a result, you will get an updated file:
Output data after applying Edit values node
The configuration of the Edit values node
7. Confirm by clicking **Apply**. ### Filter records To filter records from the data, use the **Filter Rows** node. In this case, keep only records where the value of the **UNIT** column is equal to `Dollars`. 1. On the canvas, click the right mouse button. 2. From the dropdown list, select **Filter rows**. 3. Click the **Filter rows** node. 4. In the configuration of the node: 1. Click **Add rule**. 2. Click **Add column**. 3. Select the **UNITS** column. 4. Under **Matching condition**, from the dropdown list, select **Contain**. 5. In the text field, enter `Dollars`.
The configuration of the Filter rows node
The configuration of the Filter rows node
As a result, you will get an updated file:
Output data after applying Filter rows node
The configuration of the Filter rows node
6. Confirm by clicking **Apply**. ### Add the finishing node This node lets you preview the output of the modifications to the sample data. 1. On the canvas, click the right mouse button. 2. From the dropdown list, select **Data output**. 3. To preview the results, click the **Data output** node.
The preview of modifications to the file
The preview of modifications to the file
4. Close the preview 3. In the upper right corner, click **Save and publish**. **Result**:
Data Transformation diagram for cleaning customer data
The diagram of data transformation
## Prepare a workflow --- The scenario for this use case involves a one-time transformation of a file uploaded from the user's local storage. The transformed data will be exported to the external source using the SFTP protocol. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the launch date 3. As the trigger node, add **Scheduled Run**. 4. In the configuration of the node: 1. Change the **Run trigger** option to **one time**. 2. Select **Immediately**.
Automation Hub Scheduled Run node configuration for triggering data cleaning operations
The configuration of the Scheduled Run node
3. Confirm by clicking **Apply**. ### Select file to export 1. Add a **Local File** node. 2. In the configuration of the node: 1. Upload the file in which you want to perform the transformation.
Local File transfer
Local File transfer
2. Confirm by clicking **Apply**. ### Select the data transformation rules 1. Add a **Data Transformation** node. 2. In the configuration of the node, select the [data transformation you have created before](/use-cases/data-cleaning#create-data-transformation-rules).
The configuration of the Data Transformation node
The configuration of the Data Transformation node
3. Confirm by clicking **Apply**. ### Configure settings for SFTP protocol 1. Add the **Send File** node by clicking **THEN > SFTP**. 2. In the configuration of the node: 1. Enter the path to your server. 2. Select the port. 3. Enter the path to the directory. 4. Enter the name of the file that will be created. 5. If needed, in the **File name suffix**, select the suffix of the file name. 6. From the **File format** dropdown list, select the **CSV** format. 7. Verify and modify the delimiters if needed. 8. In the **Authentication** section, select the method of authentication.
The configuration of the SFTP node
The configuration of the SFTP node
9. Confirm by clicking **Apply**. ### Add the finishing node 1. Add the **End** node. 2. In the upper right corner, click **Save & Run**.
Automation Hub workflow for data cleaning operations
The workflow configuration
You can monitor the flow of the workflow in the **Transformation logs** tab. It contains information about each execution of the workflow.
Automation Hub Transformation logs tab showing workflow execution history
The logs for the workflow
## Check the use case set up on the Synerise Demo workspace --- You can check the [data transformation rules](https://app.synerise.com/automations/data-transformation/bdf77aad-e443-4630-931d-af944f814db3) and [workflow](https://app.synerise.com/automations/automation-diagram/811d3a5b-64c4-4cba-9d93-64add71a7f23) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 5 events per workflow execution: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1). ## Read more --- - [Data Transformation](/docs/automation/data-transformation-and-imports/introduction) - [Workflow](/docs/automation) # Display seasonal promotions in a mobile application Seasonal promotions are a great way to boost sales and engagement for your business during special occasions, such as Christmas. By creating specific promotions and marketing campaigns tailored to these holidays, you can catch the attention of your customers and encourage them to make a purchase. The [Synerise Documents](/docs/assets/documents) feature facilitates distributing seasonal promotions in your mobile application thanks to the ability of grouping them into specific categories. For example, you can create multiple documents that contain Christmas promotions and assign them to a single `Seasonal` group, then create a [screen view campaign](/docs/campaign/screen-views/creating-screen-views) which will display all documents assigned to the `Seasonal` group. You can schedule this screen view campaign to be displayed in the specific time of year. In this use case, we'll show you how to create two documents with Christmas promotions and adding them to the `Seasonal` group. This group will be used while creating a screen view campaign, presented for your all users of the mobile application. ## Prerequisites --- - [Implement Synerise SDK in your mobile app](/developers/mobile-sdk). - [Create Christmas promotions](/docs/ai-hub/promotions) - [Meet the screen views requirements](/docs/campaign/screen-views/introduction-to-screen-views#requirements) - [Meet the documents requirements](/docs/assets/documents/introduction-to-documents#requirements) ## Process --- In this use case, you will go through the following steps: 1. [Create two documents](/use-cases/documents-promotion-groups#create-a-document) with basic Christmas promotion targeted to all application users, create a `Seasonal` group and add these two documents to this group. 2. [Create a screen view](/use-cases/documents-promotion-groups#create-a-screen-view) that will display the documents from the `Seasonal` group to all mobile application users. ## Create a document --- As the first part of the process, you will create two documents with the promotions you created in Synerise. You will also create a `Seasonal` group and assign these two documents to this group. 1. Go to Data Modeling Hub icon **Data Modeling Hub > Documents > Add document**. 2. Enter the name of your document. 2. In the **Audience** section, choose to whom the document will be displayed. Select **Everyone**. 3. In the **Configuration** section: 1. In the **Slug** field, enter the slug of the document, we recommend using the following name convention: `this-is-slug-name`. 2. In the **Priority** field, use a number to define the document priority. The order of documents is defined by the priority value (1 is the highest, 100 is the lowest). 3. From the **Group** dropdown list, click **Add group**. 4. On the pop-up, in the **Group name** field, enter `Seasonal`. **Result**: The group is added and selected. 5. From the **Type** dropdown list, select a document type. Document type defines how the document is validated by your mobile application. To create a new type, from the dropdown list, click **Add type**.
Full explanation of the type is available [here](/docs/assets/documents/introduction-to-documents#terminology).
6. In the **Body** field, add the content of the promotion in the JSON format. Below you will find an easy examples of the document body that contains the promotion created in Synerise. You can add more elements to your JSON code like for example buttons, colors, tags, and so on.
{
         "content-type": "promotion",
         "background-color": "#123321",
         "title": "Christmas Promotion",
         "promotion": "{% promotion fields=uuid,name,discountType,discountValue,code,params,tags,type,price,images,description,expireAt %} 3a3750b0-c00b-4c57-9c5f-d55652b417a0 {% endpromotion %}"
       }
The view of document congifuration
Document configuration
7. Optionally, to check the document display for a specific customer, use **Preview body**. 8. To save your changes, click **Apply**. 1. In the **Schedule** section, set up when the document will be active. 2. Select the **Scheduled** tab. 3. Select the date and time when the document will be active. 2. Click **Apply** to save your changes. 3. Click **Activate**.
The view of document congifuration
Document configuration
4. Create another document with the Christmas promotion in the same way as described previously. Change the visual project and JSON code for this document. Remember to add this promotion to the `Seasonal` group. Additionally, you can change the schedule for this second promotion, based on your business needs.
If you want to add the specific document to more than one group, duplicate it and then assign it to another group.
## Create a screen view --- Create a screen view campaign for the group of documents created in the previous part of the process. 1. Go to Experience Hub icon **Experience Hub > Screen views > New Screen View**. 2. Enter the name of the screen view. 2. In the **Audience** section, choose to whom the message will be displayed. In this case, select **Everyone**. 5. Confirm your choice by clicking the **Apply** button. 6. To create the content of your screen view, in the **Content** section click the **Change** button. 1. In the **Screen views feed**, select the general feed to display. 2. Set up the **Priority**. If multiple screen views match the conditions, the one with the higher priority is displayed (1 is the highest, 100 is the lowest).
You can learn more about the order of displaying multiple screen views [here](/docs/campaign/screen-views/creating-screen-views#conflicts).
3. In the **Documents to display** section, click **Groups**. 4. Select the `Seasonal` group.
The configuration of the screen view
The configuration of the screen view
4. Confirm the choice by clicking **Add**. 4. To save your changes, click **Apply**. 6. Go to the **Schedule** section and click the **Change** button. 7. Set up when campaign will be active using the **Run immediately** option or schedule the display of the screen view using the **Scheduled** option. 8. To apply your changes, click **Save**. 5. To run your screen view campaign, click **Activate**.
The configuration of the screen view
The configuration of the screen view
## What's next --- For a screen view to be visible in a mobile application, you must fetch it using the appropriate SDK method for: - [iOS](/developers/mobile-sdk/method-reference/ios/content#generate-screen-view), - [Android](/developers/mobile-sdk/method-reference/android/content#generate-screen-view), - [React Native](/developers/mobile-sdk/method-reference/react-native/content#generate-screen-view) - [Flutter](/developers/mobile-sdk/method-reference/flutter/content#generate-screen-view) ## Generated events This use case does not generate any events. ## Read more --- - [Documents](/docs/assets/documents) - [Screen views](/docs/campaign/screen-views) # Find best matching customers for an annual campaign While selecting the right audience for an annual campaign, you can use the Predictions feature to find customers in your database who are similar to those customers who converted in the same campaign a year before. The main action in this use case is comparison of a group of customers who visited the website in the last 90 days (target group) to the group of customers who made a purchase during the Christmas season 2020 (source group). The customers from the target group are featured by the `snr.lookalike.score` event on their profiles and the `score_label` parameter contains the value of similarity scale. Based on this event, you can create a group of customers who received the highest score and will be the recipients of the campaign during Christmas season 2021. This way, you increase the chances of reaching those who are most likely to buy and only need a small incentive to make a purchase. ## Prerequisites --- - [Enable the Lookalike prediction type](/docs/ai-hub/predictions/enabling-predictions#enabling-lookalikes). - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). ## Create a lookalike prediction --- 1. Go to AI Hub icon **AI Hub > (AI Predictions) Models > New prediction**. 2. In the **Select prediction type** window that appears, click **Lookalikes**. 3. Click **Apply**. ### Create a source segmentation A source segmentation is a group of model customers to whom you compare the target group of customers in order to find similar customers in the target group. 1. In the **Audience** section, click **Define**. 2. In the **Source segmentation** subsection, click **Choose segmentation**. 3. On the dropdown list, click **Create new**. 4. In the **Segmentation name** field, enter a meaningful name of the segmentation. 5. Click **Choose filter**. 6. From the dropdown list, select the transaction event.
Events may have different labels between workspaces, but you can always find them by their action name (in this step, it’s transaction.charge).
7. Using the date picker in the lower-right corner, select the date ranges for Christmas season 2020.
Configuration of the source segmentation
Configuration of the source segmentation
9. Save the segmentation by clicking **Create segmentation**. ### Create a target segmentation A target segmentation is a group of customers among which you want to find customers who are similar to those included in the source group. 1. In the **Audience** section, click **Define**. 2. In the **Target segmentation** subsection, click **Choose segmentation**. 3. On the dropdown list, click **Create new**. 4. In the **Segmentation name** field, enter a meaningful name of the segmentation. 5. Click **Choose filter**. 6. From the dropdown list, select the page visit event.
Events may have different labels between workspaces, but you can always find them by their action name (in this step, it’s page.visit).
7. Using the date picker in the lower-right corner, set the time range to **Relative time range > Custom > last 90 days**.
Configuration of the target segmentation
Configuration of the target segmentation
9. Save the segmentation by clicking **Create segmentation**. 10. Confirm the settings in the **Audience** section by clicking **Apply**. ### Configure further settings 1. In the **Settings** section, click **Change**. 2. Leave the calculation of the model at default (the prediction will be calculated only once). 3. Optionally, you can change the scale from 5 point scale to 2. The scale a customer reached will be available in the `snr.lookalike.score` event, as the `score_label` parameter.
snr.lookalike.score event
snr.lookalike.score event
4. Confirm the changes in the **Settings** section by clicking **Apply**.
Final configuration of prediction to find matching customers for an annual campaign audience
Final configuration of prediction to find matching customers for an annual campaign audience
5. Click **Save & Calculate**. ## What's next --- Based on the `snr.lookalike.score event`, you can create a segmentation for the Christmas season 2021 campaign. To define the size of the recipient group, you can use the `score_label` parameter of the `snr.lookalike.score` with the `score` value set to high or use `percentiles` in order to address your communication to a specific percentage of target segment with the highest prediction score. Later you can use this segment in the following campaigns: - [email](/docs/campaign/e-mail) - [SMS](/docs/campaign/SMS) - [web push](/docs/campaign/Webpush) - [mobile push](/docs/campaign/Mobile) - [dynamic content](/docs/campaign/dynamiccontent) - [screen views](/docs/campaign/screen-views) Email, SMS, web push and mobile push can be sent manually or you can launch them by means of [Automation Hub](/docs/automation). ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of the [Propensity prediction](https://app.synerise.com/ai-v2/predictions/lookalike/iljrvaozvnir) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates 1 event per profile that completes the flow: [`snr.lookalike.score`](/docs/assets/events/event-reference/predictions#snrlookalikescore) (~1). ## Read more --- - [Lookalike predictions](/docs/ai-hub/predictions/lookalikes) - [Predictions](/docs/ai-hub/predictions/predictions-introduction) # Import Loyalty Program Customers from Amazon S3 to Synerise Synerise allows you to collect data from any customer touchpoint. Using Synerise's seamless integration with Amazon S3, you can import any data stored in this storage and use it in the Synerise platform. In this use case, we will perform a single import of customers from Loyalty Program from Amazon S3. This file comprises users who are a part of loyalty program. By importing this file from the Amazon S3 Bucket to Synerise, you can create tailored marketing campaigns to retain these valuable customers, such as offering loyalty rewards, VIP promotions, or personalized product recommendations based on their previous purchases. The file used in this use case is only an example. You can import any other files or different data types as needed. ## Prerequisites --- You must have an account on AWS. ## Create a workflow --- Create a workflow which downloads the customers' data from Amazon S3 to Synerise. The workflow will be triggered one time in order to import the loyal customer database to Synerise. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Scheduled Run trigger node --- At this stage, we will configure conditions that launch the workflow. As a trigger, we will use the **Scheduled Run** node. 3. As the trigger node, add **Scheduled Run**. 4. In the configuration of the node: 1. Change the **Run trigger** option to **one time**. 2. Select **Immediately**. 4. Confirm by clicking **Apply**.
Automation Hub Scheduled Run node configuration for triggering Amazon S3 file retrieval
The configuration of the Scheduled Run node
### Configure the Get file node --- In this step, to allow the data exchange, establish a connection between Synerise and Amazon S3 Bucket. 1. Click **Amazon S3 Bucket > Get File**. 2. Click **Select connection**. 3. From the dropdown list, select the connection. - If no connections are available or you want to create a new one, see [Create a connection](/docs/automation/integration/amazon-s3-bucket/get-file-amazon-s3-bucket). - If you selected an existing connection, proceed with the integration settings. 4. In the **Region** field, enter the region of your bucket. 5. In the **Bucket** field, enter the name of an existing container in your storage. 6. In the **Path to directory** field, enter the path to the existing bucket in which the file will be downloaded. 7. In the **File name** field, enter the name of the file you want to download from the storage. 8. From the **File format** dropdown list, select the format of the file which will be downloaded. 9. Confirm by clicking **Apply**.
The configuration of the Amazon S3 Get file node
The configuration of the Amazon S3 Get File node
### Add Import Profiles node --- In this step, add Import Profiles node, to import the file with customers database directly to the **Behavioral Data Hub > Profiles** in Synerise. 1. On the **Get File** node, click **THEN**. 2. From the list that opens, select **Synerise > Import Profiles**. ### Add the finishing node --- 12. Add the **End** node. 13. In the upper right corner, click **Save & Run**.
Automation Hub workflow for retrieving a file from Amazon S3
The workflow configuration
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of the [workflow](https://app.synerise.com/automations/automation-diagram/d5556b04-b373-489c-9eff-fda7dd1f9c88) created in this use case on our Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 5 events per workflow execution: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~2), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`client.add`](/docs/assets/events/event-reference/profiles#clientadd) (~1). ## Read more --- - [Get File (Amazon S3 Bucket)](/docs/automation/integration/amazon-s3-bucket/get-file-amazon-s3-bucket) - [Workflows](/docs/automation) # Promote customer's favorite products in recommendations Customers are looking for the most convenient solutions to make their experience smooth and intuitive, allowing them to find what they are looking for quickly. Adding products to the favorites is an excellent enhancement that helps customers collect products they like while browsing the site and return to them later to make a purchase. It's also a perfect opportunity for marketers to use knowledge of customer preferences to promote products they've expressed interest in, encouraging visitors to return and increasing sales. This use case describes creating personalized recommendations with filters that will boost products customers have added to their favorites. ## Prerequisites --- - [Configure an item catalog for recommendations](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). Enable personalized recommendations. - Implement a custom event for adding a product to favorites, which will be available in the customer profile. In this example, the event is called `product.addToFavorite`. Implement custom events in your [mobile application](/developers/mobile-sdk/event-tracking#product-added-to-favorites) or [website](/developers/web/event-tracking#declarative-tracking-custom-events). ## Process --- In this use case, you will go through the following steps: 1. [Create an aggregate](/use-cases/boost-favorite-products#create-an-aggregate). 2. [Create a recommendation](/use-cases/boost-favorite-products#create-a-recommendation). ## Create an aggregate --- In this part of the process, create an aggregate that will return the products the user added to favorites. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last Multi**. 4. Select **Consider only unique occurence of the event parameter**. 5. In the **Size** field, enter the number of returned SKUs. 6. Select the **product.addToFavorite** event. 7. Select the **sku** parameter. 8. Define the period from which the aggregate will return products from the event. 9. Save the aggregate.
Decision Hub Last Multi aggregate returning the distinct SKUs of products added to favorites by the customer
Configuration of the aggregate
## Create a recommendation --- 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. In the top left corner, enter the name of your recommendation. 3. In the **Type & Items feed** section, click Define. 4. From the **Items feed** dropdown menu, choose the provided feed. 5. Choose the **Personalized** recommendation type.
AI Hub recommendation model Type and Items feed section with Personalized recommendation type selected
Configuraion of the catalog and recommendation type section
6. Click **Apply**. 7. In the **Items** section, click **Define**. 1. Click **Add slot**. 2. Define the minimum and maximum number of items that will be recommended to the user in each slot. In our example, one slot returns from 5 (minimum) to 10 (maximum) products. 3. Confirm by clicking **Apply**. 8. In the **Boosting** section: 1. Click **Define**. 2. Click **Add rule**. 3. Click **Define rule** and select **Visual Builder**. **Result** The Visual Builder window opens. 4. From the **Select attribute** dropdown list, select the **itemId** attribute. You can use the search field. 5. From the **Operator** dropdown list, select **Equals**. 6. Click the value type icon (Value icon) a few times until it changes to the aggregate icon. 7. From the **Choose aggregate** drop-down list, select an aggregate created in [the previous step](/use-cases/boost-favorite-products#create-an-aggregate). 8. Click **Apply**.
Boosting items added to favorites
Boosting items added to favorites
9. In the **Promote/Demote** selector, select **Promote** (default value). 10. Use the slider to adjust how much you want the rule to affect the results. 11. Save the **Boosting** section settings by clicking **Apply**.
Screenshot of the boosting strength slider
The boosting strength slider
9. Optionally, you can define the settings in the **Additional settings** section. 10. Save the recommendation. ## What's next --- You can display the recommendation to customers in several ways, for example by using the [recommendation insert](/developers/inserts/recommendations-v2) in [dynamic content](/docs/campaign/dynamiccontent/creating-dynamic-content) or in a mobile app using documents - [iOS SDK](/developers/mobile-sdk/displaying-recommendations/content-widget/ios), [Android SDK](/developers/mobile-sdk/displaying-recommendations/content-widget/android). ## Check the use case set up on the Synerise Demo workspace --- You can also check the [AI recommendation configuration](https://app.synerise.com/ai-v2/recommendations/dqc05RBMvEwO) and [aggregate](https://app.synerise.com/analytics/aggregates/8b2c2e9e-24e0-30ff-aca6-a9f024a99306) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Creating aggregates](/docs/crm/aggregates/creating-profile-aggregates) - [Creating recommendations](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign) - [Filters in recommendations](/docs/ai-hub/recommendations-v2/recommendation-filters) - [Requirements for item feed](/docs/ai-hub/recommendations-v2/item-feed-requirements) # Dynamic content survey Understanding customer satisfaction is key to business success. A well-structured survey can provide valuable insights into how customers perceive products and services, their overall experience, and their likelihood of recommending them to others. By gathering this data, businesses can identify strengths, address pain points, and refine their offerings to enhance customer loyalty. Whether measuring satisfaction, improving service quality, or benchmarking against competitors, customer feedback serves as a strategic tool for continuous improvement and long-term growth. In this specific use case, we intend to introduce a dynamic content survey for customers who made a transaction in the last 30 days. This use case provides you with an instruction how to use a ready-made dynamic content template that can be used 1:1 in a business scenario ## Prerequisites --- - [Configure web push notifications](/docs/campaign/Webpush/configuring-web-push) - [Implement SDK to a website](/developers/web/installation-and-configuration) ## Create a dynamic content --- Create a dynamic content campaign targeted at customers who made a transaction in the last 30 days. We will use a predefined template for this message, so there is no need to create a template from scratch. 1. Go to Experience Hub icon **Experience Hub > Dynamic Content > Create new**. 2. Enter the name of the content. 3. Choose the **Web layer** type. ### Define audience --- 1. To select the recipients of the dynamic content, on the **Audience** tab, click **Define**. 3. Select **New Audience** and click **Define conditions**. 1. Choose **Add condition** and select the `transaction.charge` event. 5. In the calendar in the bottom right corner, leave **Last 30 days**. 7. Click **Apply**. ### Define content --- In the next step, you will create the content of the dynamic content campaign with the help of a ready-made template. 1. In the **Content** section, click **Define**. 2. Click **Create message** and from the list of template folders, select **Predefined templates**. 3. Select the **Survey form** template. **Result:** You are redirected to the code editor. 4. Edit the template according to your needs. In the Config tab, you'll find a comprehensive list with descriptions of the core components that make up your survey.
Config panel
Config panel
The configuration of the questions and answers is in the JavaScript tab. There is an object that you have to fill, according to the example given. The object is an array of questions, where each question has its answers and settings depending on the type.
Javascript object with questions and answers
Javascript object with questions and answers
**Example:** You want to add/edit question To add a question to the **QUESTIONS** array, you'll want to follow the pattern established by the existing questions. Each question is an object that may contain different properties depending on its type (single, multi, scale, text). Here's a step-by-step guide on how to do it: Decide on the question you want to add and the type of question it will be. The type determines the properties the question object will have. For instance: - `single` and `multi` types need question, `answers`, and `type`. - `scale` needs `question`, `type`, and `length`. - `text` needs `question`, `type`, and optionally `limit` for the character limit. Construct the question object according to the type you've chosen. Add the new question object to the `QUESTIONS` array. Here's an example of how you can add a new question about a favorite color (a single type question with predefined answers):
const QUESTIONS = [
                  {
                      "type": "single",
                      "question": "What motivated you to download our app?",
                      "answers": [
                          "To browse products",
                          "To make a purchase",
                          "To explore exclusive offers",
                          "To compare prices",
                          { "answer": "Other (please specify):", "options": { "isOpen": true, "limit": 20 } },
                      ],
                      "shuffleAnswers": false,
                      "required": true
                  },
                  {
                      "type": "multi",
                      "question": "What types of products or services are you most interested in?",
                      "answers": [
                          "Fashion",
                          "Electronics",
                          "Home and Kitchen",
                          "Health and Beauty",
                          "Sports and Outdoors",
                          { "answer": "Other (please specify):", "options": { "isOpen": true, "limit": 20 } }
                      ],
                      "shuffleAnswers": false,
                      "required": true
                  },
                  {
                      "type": "single",
                      "question": "How do you prefer to shop?",
                      "answers": [
                      "I like to browse and explore new products",
                      "I prefer targeted recommendations based on my preferences",
                      "I usually know what I want and search directly",
                      "I’m mainly looking for deals and offers",
                      ],
                      "shuffleAnswers": false,
                      "required": true
                  },
                  {
                      "type": "multi",
                      "question": "Which factors influence your purchasing decisions the most?",
                      "answers": [
                      "Product quality",
                      "Price",
                      "Brand reputation",
                      "Customer reviews",
                      "Sustainability",
                      { "answer": "Other (please specify):", "options": { "isOpen": true, "limit": 20 } }
                      ],
                      "shuffleAnswers": false,
                      "required": true
                  },
                  {
                      "type": "scale",
                      "question": "How likely are you to recommend our company to your friends and acquaintances?",
                      "length": 10,
                      "required": true,
                  },
              ];
5. After customising your survey, save the template. ### Define schedule and display settings --- As the final part of the process, you will define the display settings of the dynamic content such as schedule, triggers and delay. 1. In the **Schedule** section, click **Define** and set the time when the message will be active. 2. In the **Display Settings** section, click **Define**. 1. In the **Triggers** section, choose **On exit**. 2. Click **Advanced options**. In our case, we want to display the survey once per user. To do this, set the **Frequency** to **Once**, and in the **Stop ddisplay** section choose option **Dynamic content was shown to a viewer x times** and type `1`. 4. Click **Apply**. 5. Optionally, you can define the UTM parameters and additional parameters for your dynamic content campaign. 6. Click **Activate**. ## Check the use case set up on the Synerise Demo workspace --- You can check the [dynamic content campaign](https://app.synerise.com/campaigns/dynamic-content/create/1aa85a47-18dd-49e8-8179-bb6be80be4e2) configuration directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1), [`form.submit`](/docs/assets/events/event-reference/web-and-app#formsubmit) (~1). ## Read more --- - [Dynamic content](/docs/campaign/dynamiccontent) # In-app campaign with cross-sell products In the world of mobile applications, engaging users effectively and generating revenue are paramount objectives. One powerful strategy for achieving both of these goals is the implementation of in-app cross-sell campaigns. These campaigns are designed to present users with complementary product suggestions precisely when they are most likely to make a purchase, thereby enhancing their experience and increasing the app's revenue potential. A compelling example of the impact in-app cross-sell campaigns can have is demonstrated through the "product.addToCart" event. In this specific use case, when a mobile app user adds an item to their shopping cart within a mobile application, it triggers a dynamic campaign. This campaign's unique feature is its ability to display cross-selling products tailored to the specific item added to the cart, all based on event parameters such as the SKU (Stock Keeping Unit). By leveraging these parameters and the underlying code of the cross-sell recommendation campaign, the app can deliver a highly personalized and targeted experience to its users. The primary purpose of this use case is to optimize the user experience within a mobile application by offering relevant product recommendations at a critical moment in the customer's journey – when they are actively making a purchase. By harnessing the "product.addToCart" event, this in-app campaign can provide users with product suggestions that align with their interests and the specific product they have chosen. In this use case, we provide you with ready-to-use campaign code that you can use 1:1 in your business scenario. ## Prerequisites --- - [Implement Synerise SDK in your mobile app](/developers/mobile-sdk). - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). - [Configure AI engine](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-search). Enable **Cross-sell** recommendations. - [Implement the product.addToCart event in your mobile application](/developers/mobile-sdk/event-tracking#product-added-to-cart). ## Process --- In this use case, you will go through the following steps: 1. [Create AI recommendations](/use-cases/in-app-bestsellers#create-ai-recommendations) with cross-sell products. 2. [Create an in-app campaign](#create-an-in-app-campaign) with the usage of an event parameter. ## Create AI recommendations --- In this stage, you will create an AI recommendation campaign which will be used to display products in your in-app message. It will present cross-sell recommendations. 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. Enter the name of the recommendation (it is only visible on the list of recommendations). 3. In the **Type & Items feed** section, click **Define**. 4. From the **Items feed** dropdown list, select a product feed. 5. Select the **Cross-sell** recommendation type. 6. Confirm the recommendation type by clicking **Apply**. 6. In the **Items** section, click **Define**. 7. Click **Add slot**. 8. Click the **Unnamed slot** that was created. 8. Define the minimum and maximum number of products displayed in the frame according to your needs. 9. In **Static filters**, select the **availability** parameter and set it to **is defined**, so the recommendations will show only available items. 9. Optionally, you can use filters to include specific items in the recommendation frame. 10. Confirm the configuration by clicking **Apply**. 8. Optionally, you can define the **Boosting** factors and settings in the **Additional settings** sections. 9. In the right upper corner, click **Save**. 10. Copy the recommendation ID from its URL to use it in [in-app campaign](#create-an-in-app-campaign). ## Create an in-app campaign --- In this part of the process, you create an in-app campaign triggered by the `product.addToCart` event. After that, the recommendation campaign with cross-sell products for the products added to cart will be displayed. 1. Go to Experience Hub menu icon **Experience Hub > In-app messages > Create in-app** 2. Enter a meaningful name for the in-app campaign. 3. In the **Audience** section: 1. Click **Define**. 2. Select the **Everyone** tab. 3. Click **Apply**. 4. In the **Content** section: 1. Click **Create message**. 2. Go to **Use cases** folder and choose **In-app carousel with personalized recommendations** template.
You can edit the template in two ways, by editing the code of the template ([add inserts](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-snippet-to-the-template-code), [add variables](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-variable)) and/or by filling out the form in the **Config** tab. In this use case, we will use the capabilities of the predefined **Config** tab.
#### Edit form in the Config tab --- The form in the **Config** tab is already filled in with default values. You can keep them or change them to fit your business needs. The fields in **Config** are split into two types: ones for dynamic content (related to Jinja) and ones for in-app appearance. The dynamic content fields must match the values in the catalog and the names of the attributes returned by the recommendations. The appearance fields only affect the visual layer of the in-app message. 1. From the **Recommendation campaign** dropdown list, select the AI recommendation created [in the previous step](/use-cases/in-app-bestsellers#create-ai-recommendations). 2. In the **Header** section, add the text you want to display as the header of the in-app message. 3. In the **Wrapper background color** field, use the color picker to select the color of the wrapper background. 4. In the **Header background color** field, use the color picker to select the color of the header background. 3. In the **Header text color** field, use the color picker to select the text color. 6. In the **Close icon background color** field, use the color picker to select the icon background color. 6. In the **Close icon color** field, use the color picker to select the color of the close icon. 6. **Name of the product attribute with average rating** and **Name of the product attribute with number of reviews** leave empty, because in this case we do not have this kind of attributes in our catalog. 7. Additionally, you can enable the following options: - **Sending additional events of viewing a single product in the carousel** - when enabled, an event is generated when a single product from the carousel is viewed. The event will be available in the customer's profile. - **Use deep links** - when enabled, instead of refering a user to a product on the website, you refer them to a product in the mobile application. 15. To continue the process of configuring the in-app campaign, click **Next**. 16. To save your content changes, click **Apply**. 1. In the **Trigger events** section: 1. Click **Define**. 2. Select **Add event** and from the dropdown list, choose the `product.addToCart` event. 2. Click the **+ where** button and as the parameter, choose `$sku`. 3. As the logical operator, select **is true**. 4. Click **Apply**.
Trigger event settings
Trigger event settings
1. In the **Schedule** section: 1. Click **Define**. 2. Choose the **Run immediately** option. 3. Click **Apply**. 2. In the **Display settings** section: 1. Click **Define**. 2. Define the **Delay display** as **0** and **Priority index** as **1**. 3. Enable the **Frequency limit** toggle to manage the frequency of in-app message display in the application. In our case, we set it to once per hour. 3. Click **Apply**. 1. Optionally, you can define the **UTM parameters**. Otherwise, click **Skip step**. 2. Optionally, you can add the custom parameters in the **Additional parameters** section. Otherwise, click **Skip step**. 3. To start your campaign, click **Activate**.
The in-app configuration
The in-app configuration
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of the campaign components directly in Synerise Demo workspace: - [AI recommendation configuration](https://app.synerise.com/ai-v2/recommendations/bFiHIJu2SdCS) - [In-app campaign](https://app.synerise.com/communications/in-app/aa837e27-ab55-4bfa-820b-090ff5ef24df) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 6 events per profile that completes the flow: [`product.addToCart`](/docs/assets/events/event-reference/items#productaddtocart) (~1), [`inApp.show`](/docs/assets/events/event-reference/inapp#inappshow) (~1), [`inApp.click`](/docs/assets/events/event-reference/inapp#inappclick) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [In-app messages](/docs/campaign/in-app-messages) - [Mobile campaigns](/docs/campaign/Mobile) - [Recommendations](/docs/ai-hub/recommendations-v2) - [Recommendations inserts](/developers/inserts/recommendations-v2) - [Trigger event parameters](/developers/inserts/inapp#trigger-event-parameters) # Lifetime value prediction Knowing how much money customers will spend in the next couple of days or weeks can be crucial for creating precise marketing campaigns. This use case describes how to make a prediction that returns the expected number of transactions in 90 days ahead for a specific group of customers.
LTV prediction
LTV prediction
## Prerequisites --- - [Integrate JS SDK](/developers/web/installation-and-configuration). - [Enable the Custom prediction model](/docs/ai-hub/predictions/enabling-predictions#enabling-regression-and-classification-predictions). ## Process --- In this use case, you will go through the following steps: 1. [Create prediction target](/use-cases/ltv-prediction#create-prediction-target) based on aggregate and expression. 2. [Create the segmentation](/use-cases/ltv-prediction#create-a-segmentation) for whom the prediction will be made. 3. [Create the prediction](/use-cases/ltv-prediction#create-a-prediction). ## Create prediction target --- In the first part of the process, create an analyses based on which the system will make a prediction. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Set the **Analyze profiles by** option to **Sum**. 4. Click **Choose event**. 5. From the dropdown list, select **transaction.charge**.
Events may have different labels between workspaces, but you can always find them by their action name (in this step, it's **transaction.charge**).
6. As the parameter of the event, select **$totalAmount**. 5. Using the date picker in the lower-right corner, set the time range to **Relative time range > Custom > last 90 days**. 6. Save the aggregate.
The formula of the aggregate
The formula of the aggregate
After building the aggregate, you have to create new expression. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. Enter the name of the expression. 3. Set the **Expression** to **Attribute**. Predictions work only with attribute expressions. 4. On the canvas, click **Select**. 5. From the dropdown list, select **Profile**. 6. Click the **unnamed** input that appeared on the canvas. 7. From the **Choose attribute** dropdown list, select the aggregate you created in the previous [part of the process](/use-cases/ltv-prediction#create-prediction-target). 8. **Save** the expression.
Behavioral Data Hub expression formula for LTV prediction using profile aggregate attribute
The formula of the expression
## Create a segmentation --- In this part of the process, create a group of customers for whom the prediction will be made.
The conditions of the segmentation can be very complex. It usually makes sense to analyze customers with some activities observed, so in this use case, the segmentation contains customers who have at least one page visit during the last 30 days.
1. Go to **Decision Hub > Segmentation > New segmentation**. 2. Enter the name of the segmentation. 3. Create a segmentation of customers who visited your website in the last 30 days.
You can find the instructions on creating segmentations [here](/docs/analytics/segmentations/creating-segmentations).
4. **Save** the segmentation.
The formula of the aggregate
Segmentation
## Create a prediction --- In this part of the process, create a prediction that returns the number of transactions that will be made in the 90 days in advance. 1. Go to AI Hub icon **(AI Predictions) Models > New prediction**. 2. On the pop-up, select **Create from scratch**, and then select **Regression**. ### Select the audience In this section, select the group of customers you created in [this part](/use-cases/ltv-prediction#create-a-segmentation) of the process.
Selecting the audience, especially its size, is always a trade-off between reach, duration of calculation and costs of data points produce.
1. In the **Audience** section, click **Define**. 2. Click **Choose segmentation**. 3. Select the the group of customers you created in [this part](/use-cases/ltv-prediction#create-a-segmentation) of the process. 4. Click **Apply**. ### Select the target 1. In the **What would you like to predict?** section, click **Define**. 2. Click **Select expression**. 3. From the dropdown list, select the expression you created in [this part](/use-cases/ltv-prediction#create-prediction-target) of the process. ### Select events [Events](/docs/assets/events/introduction-to-events) are customer activities on the website (visits to a website, adding a product to a shopping cart, and so on) and also your activities towards customers (such as sending messages to them). Select the events that the system will use as input to make a prediction. By default, the list already contains the events recommended for the prediction you are creating. The contents of the list is defined while enabling [Custom predictions](/docs/ai-hub/predictions/enabling-predictions#enabling-regression-and-classification-predictions). 1. Leave the **Auto-select events** option toggle on. ### Schedule recalculation and result settings In this section, define the frequency of recalculating the prediction and settings of the event that is generated for customers for whom the prediction is made. 1. In the **Prediction time window** section, from the **How many days in advance do you want to make a prediction?** dropdown list, select **90 days** as the number of days in advance. The time must correspond to the time range selected earlier in the prediction target. 2. In the **Calculation frequency** section, leave the settings at default (**One-time calculation**). As a result, the prediction is run only one time. 3. In the **Prediction start** section, leave the settings at default (**Immediately**). As a result, the prediction is calculated immediately after saving. 4. In the **How would you like to display results?** section, leave the settings at default (**5-point scale**). 5. In the **Define the value of the score name parameter** section, in the **Name** field, enter the user friendly name of predictions scores. The score name parameter is shown in the `snr.prediction.score` event. In our case it is 'Lifetime value'. 6. Click **Apply**. 7. Complete the prediction by clicking **Save&Calculate**. **Result**: The calculation begins. After it completes, an event named `snr.prediction.score` is saved to the customer profiles selected in the segmentation. The event will be available in the platform, for instance in Decision, Behavioral Data, and Automation Hubs. ## What's next --- You can use the prediction results in your work, for example to [Evaluate results](/use-cases/predictions-dashboard). ## Check the aggregate set up on the Synerise Demo workspace --- Check the settings of all analytics created in this use case in Synerise Demo workspace: - [Aggregate](https://app.synerise.com/analytics/aggregates/84991085-f72c-3684-a1eb-57fc643830a8) - [Expression](https://app.synerise.com/analytics/expressions/ee582e83-0667-4580-b509-1ad1cd4aaad0) - [Segmentation](https://app.synerise.com/analytics/segmentations/11295db2-80c2-464e-b9be-61fa8e78b98b) - [Prediction](https://app.synerise.com/ai-v2/predictions/generic-scoring/ylhrexxshcak) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates 1 event per profile that completes the flow: [`snr.prediction.score`](/docs/assets/events/event-reference/predictions#snrpredictionscore) (~1). ## Read more --- - [Predictions](/docs/ai-hub/predictions) # Sending metrics results to Google BigQuery --- The integration between Synerise and Google BigQuery allows users to export various types of data from Synerise to BigQuery. This is a convenient solution as it allows data to be exported and used for further analysis in BigQuery and other Google tools such as Google Analytics. In this use case, we will show how to send metrics results (CTR, CTOR, and OR) to a BigQuery table using a dedicated node (Upload Data to Table) in our Automation Hub. The process of creating these metrics has already been described in [this use case](/use-cases/calculate-ctr-or-ctor). In the following steps, we will create a workflow for uploading these analytics to BigQuery. ## Prerequisites --- - Check the [requirements](/docs/automation/integration/google-bigquery/upload-data-to-bigquery#prerequisites) you must meet to integrate Synerise with Big Query. - Prepare metrics that counts OR, CTR and CTOR based on the [use case](/use-cases//calculate-ctr-or-ctor). ## Create a workflow --- Create a workflow which sends metrics results to Google BigQuery. The workflow starts at 6 A.M. daily and automatically sends the up-to-date metrics results to BigQuery. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Scheduled Run trigger node --- At this stage, we will configure conditions that launch the workflow. As a trigger, we will use the **Scheduled Run** node. 1. As the trigger node, add **Scheduled Run**. 2. In the configuration of the node: 1. Leave the **Run trigger** option at default (**all time**). 2. From the **Timezone** dropdown list, select the time zone consistent with the timezone selected for your workspace. 3. Define the frequency of the workflow. In this use case, it's every day at 6:00 A.M. 4. Confirm by clicking **Apply**.
Automation Hub Scheduled Run node configuration for triggering BigQuery metrics retrieval
The configuration of the Scheduled Run node
### Configure the Upload Data to Table node --- At this stage, we will configure the BigQuery node. 1. As the next node, add **Google BigQuery > Upload Data to Table**. 2. Fill out the form according to the instructions in the **Define the integration settings** section. 3. In the **Rows** field, enter JSON that extracts the ID of specific metrics.
[{
       "insertId": "{{ currentStep.actionId }}",
       "json": {
               "data": "{% set today = timestamp|timestamp_to_time|datetimeformat('%d.%m.%Y', tz="Europe/Warsaw" ) %}{{today}}",
               "ctr": "{% metricvar d3cbeffb-4883-4621-a403-15e4bddc4650 %}",
               "or": "{% metricvar 69af6a34-02d9-4a11-8436-1c8967b0abf3 %}",
               "ctor": "{% metricvar 373dc09a-552d-4108-a713-e0261ac86516 %}"
           }
   }]
### Add the finishing node --- 1. Add the **End** node. 2. In the upper right corner, click **Save & Run**.
The configuration of the Workflow
The configuration of the Workflow
The metrics presented in this case are just examples. You can export any other analytics you need with the Upload Data to Table node. All you have to do is replace the syntax with relevant jinjava inserts and add the corresponding analytics ID.
## Check the use case set up on the Synerise Demo workspace --- You can check [the configuration of the workflow](https://app.synerise.com/automations/automation-diagram/d161330f-deb9-4a6f-aff5-a07ec13fd945) directly in the Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 4 events per workflow execution: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`bigQuery.uploadData`](/docs/assets/events/event-reference/integration#bigqueryuploaddata) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Uploading data to BigQuery](/docs/automation/integration/google-bigquery/upload-data-to-bigquery) # Personalized SMS with voucher to a previously visited store SMS messages are an effective channel to reach your users. A good solution is to use dynamic SMS campaigns and personalize their content based on customer information such as the last-bought product or favorite store. By sending the customer a discount to a particular store, you can **deepen engagement and loyalty.** ## Example of use - Retail Industry **Challenge** We created a dynamic SMS campaign with discount codes to stores previously visited by specific customers. It was based on a store attribute, which was added after a purchase in an offline store. Based on this information, we knew in which store the customer made a previous purchase. ![Screenshot presenting sms](/api/docs/image/f8a57079df9dd82ae8b22dc747691385d7d51d29/use-cases/all-cases/_gfx/best-store.png) ## Requirements - Customer data base with phone numbers and marketing consent for sending SMS campaigns - Attributes: customer first name, the name of the store in which he made a recent purchase (integration with POS) - Discount coupon list - Integration of SMS gateway with Synerise. Read more about [how to do it >>](/docs/settings/configuration/sms-account) --- ## How to do it 1. **Create SMS campaign** - In the **Audience** section, choose the campaign recipients. The system will automatically show you the customers who have given marketing consent for this type of campaign and have phone numbers on their contact card. You can choose to send the SMS to specific segments, create a new one directly from this place or send the message to everyone. - In **Content**, you have to choose the sender name (based on previously completed integration with a sending platform) and then you can create a message template in the text editor. 2. **Use inserts in SMS creator to use dynamic content in your message** - Use the name of your users to make the message more personalized (search for the “name” insert and copy the code to your message box) - Add the text of your message. - Add info about the user’s favorite store (find the proper attribute e.g. “store” and paste its code to message box) - Add voucher choosing inserts – pools (find the proper attribute e.g. “vouchers” and paste its code to message box). 3. **Set up the campaign schedule and test the campaign** - In Schedule, choose what time the campaign will be sent - The last part is testing. If you want to test your SMS, you have to add your phone number and check how the message is displayed. ## Generated events This use case generates approximately 2 events per profile that completes the flow: [`sms.send`](/docs/assets/events/event-reference/sms#smssend) (~1), [`voucherCode.assigned`](/docs/assets/events/event-reference/loyalty#vouchercodeassigned) (~1). ## Read more --- - Learn how to build [SMS campaign](/docs/campaign/SMS) - Learn more about [Inserts](/developers/inserts) # Personalized in-app campaign with like/dislike swipe feature In today's digital landscape, the majority of internet users access the web through mobile devices. In-app campaigns offer companies a unique opportunity to engage with this large and growing customer base in a personalized and meaningful way. By using a variety of triggers, in-app campaigns can increase customer engagement, conversions, and provide valuable insights into customer preferences. The swiping mechanism is a user-friendly feature commonly used in in-app campaigns. It allows customers to quickly and easily swipe left or right to indicate their level of interest in a product or offer. The mechanism provides companies with valuable insight into customer tastes and behavior, enabling them to make informed decisions about future campaigns and product offerings. Finally, the swipe mechanism adds a fun and interactive element to in-app campaigns, increasing customer engagement and overall user experience. This use case outlines the process of creating an engaging in-app campaign featuring a swiping mechanism with personalized product recommendations. With the use of a predefined in-app template for the swiping mechanism, there is no need for time-consuming creation of a template from scratch, making it quick and easy to launch the campaign. The campaign will be displayed to customers as soon as they add a product to their favorites list, providing a seamless user experience.
In-app swiping mechanism
## Prerequisites --- - [Implement Synerise SDK in your mobile app](/developers/mobile-sdk). - [Configure AI engine](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-search). Enable **Personalized recommendations**. - Implement the `product.addToFavorite` event in your [mobile application](/developers/mobile-sdk/event-tracking#product-added-to-favorites). The event must be sent to Synerise after adding any product to favorites by the customer. ## Process --- In this use case, you will go through the following steps: 1. [Create AI recommendations](/use-cases/in-app-swiping-mechanism#create-ai-recommendations) with personalized products. 2. [Create an in-app campaign](/use-cases/in-app-swiping-mechanism#create-an-in-app-campaign) with swiping mechanism using the predefined template. ## Create AI recommendations --- In this step, create an AI recommendation campaign that will be used to display products in your in-app message. 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. Enter the name of the recommendation (it is only visible on the list of recommendations). 3. In the **Type & Items feed** section, click **Define**. 4. From the **Items feed** dropdown list, select a product feed. 5. Select the **Personalized** recommendation type. 6. Confirm the recommendation type by clicking **Apply**. 6. In the **Items** section, click **Define**. 7. Click **Add slot**. 8. Click the **Unnamed slot** that was created. 8. Define the minimum and maximum number of products displayed in the frame according to your needs. 9. Optionally, you can use filters to include specific items in the recommendation frame.
Learn about the difference among [elastic, static filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#select-conditions-of-displaying-items), and [distinct filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#distinct-filter).
10. Confirm the configuration by clicking **Apply**. 11. Optionally, you can use boosting option to promote or demote any items attributes in the recommendation frame. 12. Optionally, you can also define the settings in the **Additional settings** tab according to your needs. 13. Click **Save**.
AI recommendation configuration
AI recommendation campaign configuration
## Create an in-app campaign --- In this part of the process, you will create an in-app campaign triggered by the `product.addToFavorite` event. We will use a predefined template for the swiping mechanism, so there is no need to create a template from scratch. 1. Go to Experience Hub menu icon **Experience Hub > In-app messages > Create new** 2. Enter a meaningful name for the in-app campaign. ### Define the audience --- 1. In the **Audience** section, click **Define**. 2. Select the **Everyone** tab. 3. Click **Apply**. ### Define content --- 1. In the **Content** section click **Define**. 2. Click **Create message** and from the list of template folders, select **Predefined templates**. 3. Select **Swiping mechanism with recommendation campaign**. **Result:** You are redirected to the code editor.
You can edit the template in two ways, by editing the code of the template ([add inserts](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-snippet-to-the-template-code), [add variables](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-variable)) and/or by filling out the form in the **Config** tab. In this use case, we will use the capabilities of the predefined **Config** tab.
#### Edit form in the Config tab --- The **Config** tab already has default values filled in. You can keep them or change them to fit your business needs. The fields in **Config** are split into two types: ones for dynamic (related to Jinja) content and ones for in-app appearance. The dynamic content fields must match the values in the catalog and the names of the attributes returned by the recommendations. The appearance fields only affect the visual layer of the in-app message. 1. From the **Recommendation Campaign** drop-down list, select the personalized recommendation campaign you created in the previous step. You can find it by typing its name or ID in the search box. 2. In the **Product attribute name with image link** field, change the default value of the `imageLink` attribute to the attribute name from your item catalog. In our case, the attribute corresponding to the image link is `image`. 3. In the **Product attribute name with title** field, change the default value of the `title` attribute to the attribute name from your item catalog. In our case, the attribute corresponding to the title is `name`. 4. In the **Header text** text box, type the header you want to display in the in-app message. 5. Define the color in the following fields: **Header text color**, **Wrapper background color** and **Close icon background color** to your needs. 6. Customize the **Header text on a Thank you view** and **Header description on a Thank you view** to your needs.
The **Thank you** view refers to the last view of the campaign when the user has already clicked through all the items that were supposed to be displayed in-app. It can be previewed only after the campaign is pushed on the mobile app.
7. Adjust the remaining fields corresponding to the **Thank you** view, which includes its text color, text and color and background color of the close button. 8. After you make changes to the template, you can check the preview. 1. Click the **Preview** button on the upper left side. 2. Enter the ID of a customer or a product. 3. Click **Apply**.
Considering that the in-app is very interactive, the preview in the platform may not be enough to test the in-app performance. That's why we suggest checking how this campaign displays altogether directly in the mobile app.
9. If the template is ready, in the upper right corner, click **Save this template > Save as**. 10. On the pop-up: 1. In the **Template name** field, enter the name of the template. 2. From the **Template folder** dropdown list, select the folder where the template will be saved. 3. Confirm by clicking **Apply**.
In-app preview
In-app preview
11. Click **Next** to continue the process of configuring the in-app campaign. 12. Click **Apply** to save your content changes. ### Select events that trigger the in-app message display --- In this part of the process, define the event that triggers the display of the in-app message. In our case, the trigger is adding an item to favorites. 1. In the **Trigger events** section, click **Define**. 2. Select **Add event** and from the dropdown list, choose the `product.addToFavorite` event. 3. Click the **+ where** button and as the parameter, choose `source`. 4. As the logical operator, select **Contain** and as the value add **MOBILE** to analyze events only from the mobile application. 5. Click **Apply**.
The view of In-app trigger event configuration
In-app trigger event configuration
### Schedule the message and configure display settings --- As the final part of the process, you need to set the schedule, display settings configuration, capping, priority of the message among other in-app messages. 1. In the **Schedule** section: 1. Click **Define**. 2. Choose **Run immediately** option. 3. Click **Apply**. 2. In the **Display settings** section: 1. Click **Define**. 2. Define the **Delay display** as **0** and **Priority index** as **1**.
The mobile application can display one in-app message at a time. If the conditions allow the display of several in-apps at a time, the priority is a decisive factor for displaying the message. The messages with lower priority aren’t queued.
3. Enable the **Frequency limit** toggle to manage the frequency of in-app message display in the application. In our case, we want to display the message to the customer a maximum of two times in 7 days. 4. You can additionally enable the **Capping limit** toggle to limit the amount of time the in-app message can be displayed to a customer in general. 5. Click **Apply**. 3. Optionally, you can define the UTM parameters in the **UTM & URL parameters** section. Otherwise, click **Skip step**. 4. Optionally, you can add the custom parameters in the **Additional parameters** section. Otherwise, click **Skip step**. 3. To start your campaign, click **Activate**.
In-app campaign configuration settings
In-app campaign configuration settings
## What's next --- Refer to the What's next section from [this use case](/use-cases/in-app-bestsellers#whats-next) for some ideas on how to use data obtained from user swipes in the in-app campaign you've created. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of the campaign components directly in Synerise Demo workspace: - [AI recommendation configuration](https://app.synerise.com/ai-v2/recommendations/iLhCWkFA771c), - [In-app campaign](https://app.synerise.com/communications/in-app/f6cb088d-0f1f-41b0-bca8-80af671fb56c) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 6 events per profile that completes the flow: [`product.addToFavorite`](/docs/assets/events/event-reference/items#productaddtofavorite) (~1), [`inApp.show`](/docs/assets/events/event-reference/inapp#inappshow) (~1), [`inApp.click`](/docs/assets/events/event-reference/inapp#inappclick) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [In-app messages](/docs/campaign/in-app-messages) - [Using in-app template builder](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template) - [Mobile campaigns](/docs/campaign/Mobile) - [Recommendations](/docs/ai-hub/recommendations-v2) - [Recommendations inserts](/developers/inserts/recommendations-v2) # Personalized in-app promotion triggered by a store visit Personalized in-app promotions can significantly boost customer engagement by delivering relevant, AI-curated promotions exactly when customers are most likely to act on them. This approach allows brands to connect with their audience at the right moment, creating a sense of exclusivity and increasing the likelihood of redemption. In this use case, personalized promotions are sent directly to a customer’s mobile application when a store visit trigger is detected. Using AI models based on past purchases and visit history, the system selects three tailored promotions for each user, ensuring high relevance and impact. Customers receive these personalized promotions immediately upon entering the store, making them timely and actionable. The campaign is built on a predefined no-code template in Synerise. You only need to replace the template ID, and the in-app experience can automatically display the personalized promotions to eligible users. This simplicity reduces setup time while still delivering a deeply personalized customer journey. ## Prerequisites --- - [Integrate Synerise promotions](/docs/ai-hub/promotions/introduction-to-promotions). - Implement promotions in your mobile application using Synerise [mobile SDK](/developers/mobile-sdk/loyalty) or [API](https://hub.synerise.com/api-reference/loyalty-and-engagement#operation/profileLogin). - [Import your product feed to a catalog](/use-cases/import-product-feed-to-catalog). - Apply [this method](https://hub.synerise.com/api-reference/loyalty-and-engagement#operation/getHandbillForClient_GET) to assign personalized promotions to a Profile. - [Create](/use-cases/landing-page-promotions) or [import](/use-cases/personalized-promotions#import-promotions) the list of promotions, based on your business needs. ## Process --- In this use case, you will: 1. [Create a personalized promotions](#create-a-personalized-promotions) presenting 3 personalized promotions for each user. 2. [Create an in app campaign](#create-an-in-app-campaign) to display the personalized promotions in the application. ## Create a personalized promotions --- In this part of the process, create a personalized promotion. The AI engine will select best offers from personalized promotions in check-in. 1. Go to AI Hub icon **AI Hub > Personalized Promotions > New personalized promotion**. 1. As the type, choose **Mobile**. 2. In **A/B Test settings**, click **Define**. 3. Click Plus icon. 4. Click **Advanced options**. 5. Select **AI Engine**. 6. Confirm by clicking **Apply**. 7. In the **Filters and limits** section: 1. In the **Promotions in slot**, enter a number of personalized promotions to be used as candidates to display in a slot. In our case it will be 3. 5. Confirm by clicking **Apply**. 8. In the **Activity** section: 1. Leave the **Lasting** option at default (**Relative**). 2. Set the activity based on your business needs. 3. Confirm by clicking **Apply**. 9. Configure the **Engine settings** section according to your needs.
You can read more about engine settings [here](/docs/ai-hub/personalized-promotions/creating-ai-promotions#ai-engine-boosting-settings).
2. To apply configuration and run the promotion, click **Publish**. ## Create an in app campaign --- In this part of the process, you create an in-app campaign triggered by the `session.start` event. The mobile app user will get a message with 3 personalized offers, created based on the personalized promotions campaign. We will use a predefined template for the message with personalized promotions so there is no need to create a template from scratch. 1. Go to Experience Hub icon **Experience Hub > In-app messages> Create in-app**. 2. Enter the name of the in-app. ### Define the audience --- As the first step, define the target group of customers for the in-app message. In this case, the group will consist of the all customers who have mobile application. 1. In the **Audience** section, click **Everyone**. 2. To save the audience, click **Apply**. ### Define content --- In this part of the process, you will create the content of the in-app message that will appear in the mobile application with the help of ready-made template. 1. In the **Content** section, click **Define**. 2. Click **Create message** and from the list of template folders, select **Predefined templates**. 3. Select the **Personalized promotions** template. **Result:** You are redirected to the code editor.
You can edit the template in two ways, by editing the code of the template [add snippets](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-snippet-to-the-template-code), [add variables](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-variable) and/or by filling out the form in the Config tab. In this use case, we will use the capabilities of the predefined Config tab.
#### Edit form in the Config tab --- The form in the **Config** tab is already filled in with default values. You can keep them or change them to fit your business needs. The fields in Config are split into two types: ones for dynamic content (related to Jinja) and ones for in-app appearance. The dynamic content fields must match the values in the catalog and the names of the attributes returned by the promotions. The appearance fields only affect how the information presents itself in the in-app. 3. In the **Personalized promotion ID** field, enter the identifier of the [personalized promotions campaign, created in the previous step](#create-a-personalized-promotions). 4. In **Number of personalized promotions**, set up how many of them will be displayed on the in-app. 5. In **Enable Elements**, you can decide which element will be visible on your in-app. 6. In the **Buttons, Hero, Footer,** and **General** sections, you can configure the layout and appearance of your message, including fonts, colors, and backgrounds, to ensure it matches your branding.
To preview the template without switched off sections, use the **Preview Contexts** option.
7. After you make changes to the template, you can check the preview. 1. Click the **Preview Contexts** button on the upper left side. 2. Enter the ID of a customer. 3. Click **Apply**.
Considering that the in-app is very interactive, the preview in the platform may not be enough to test the in-app performance. That’s why we suggest checking the preview directly in the mobile app.
11. If the template is ready, in the upper right corner, click **Save this template > Save as**. 12. On the pop-up: 1. In the **Template name field**, enter the name of the template. 2. From the **Template folder** dropdown list, select the folder where the template will be saved. 3. Confirm by clicking **Apply**. 13. To continue the process of configuring the in-app campaign, click **Next**. 14. To save your content changes, click **Apply**.
The view of in-app trigger event configuration
In-app trigger event configuration
### Select events that trigger the in-app message display --- In this part of the process, you will define the event triggering the display of the in-app message. 1. In the **Trigger events** section, click **Define**. 2. Select **Add event** and from the dropdown list, choose `session.start` event. 3. Click the **+ where** button and select `mobile`. 4. As the logical operator, select **Is true**. 5. Click **Apply**.
The view of in-app trigger event configuration
In-app trigger event configuration
### Schedule the message and configure display settings --- As the final part of the process, you will set the display settings of the in-app message such as schedule, capping, priority of the message among other in-app messages. 1. In the **Schedule** section, click **Define** and set the time when the message will be active. 2. In the **Display Settings** section, click **Change**. 3. Define the **Delay display**, **Priority index** and enable the **Frequency limit** toggle to manage the frequency of in-app message display in the application. In our case, we want to display the message to the customer a maximum of 1 time in period of 1 days.
You can additionally enable the **Capping limit** toggle to limit the amount of time the in-app message can be displayed to a user in general.
16. Click **Apply**. 17. Optionally, you can define the UTM parameters and additional parameters for your in-app campaign. 18. Click **Activate**. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration directly in Synerise Demo workspace: - [Personalized promotions](https://app.synerise.com/campaigns/handbills/0219acec-e8bc-4475-bc87-2ebd78f473d1) - [In-app](https://app.synerise.com/communications/in-app/c3acb92b-95ed-4fd7-b8d4-f8771529028c) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 4 events per profile that completes the flow: [`session.start`](/docs/assets/events/event-reference/web-and-app#sessionstart) (~1), [`inApp.show`](/docs/assets/events/event-reference/inapp#inappshow) (~1), [`inApp.click`](/docs/assets/events/event-reference/inapp#inappclick) (~1), [`client.activatePromotion`](/docs/assets/events/event-reference/loyalty#clientactivatepromotion) (~1). ## Read more --- - [Promotions](/docs/ai-hub/promotions) # In-app message with application update walkthrough In-app walkthrough messages provide a seamless and user-friendly way to guide your customers through key features and updates within your application. Ensure your users stay informed about the latest enhancements, functionalities, and essential tips to maximize their experience. Enhance user engagement, foster a smooth onboarding process, and keep your audience effortlessly connected to the most valuable aspects of your application through strategically crafted in-app messages. This scenario describes the process of creating an in-app message with information about new application updates in a walkthrough form for customers who have a new version of the application. This use case provides you with an instruction how to use a ready-made in-app template that can be used 1:1 in a business scenario. ## Prerequisites --- [Implement Synerise SDK in your mobile app](/developers/mobile-sdk). ## Create an in-ap message --- In this part of the process, you create an in-app campaign triggered by the [client.applicationStarted](/docs/assets/events/event-reference/web-and-app#clientapplicationstarted) event. We will adapt a predefined template for the message with information about new application updates, so there is no need to create a template from scratch. 1. Go to Experience Hub icon **Experience Hub > In-app messages> Create in-app**. 2. Enter a meaningful name for the in-app campaign. ### Define the audience --- As the first step, define the target group of customers for the in-app message. 3. In the **Audience** section: 1. Click **Define**. 2. Select the **Everyone** tab. 3. Click **Apply**. ### Define content --- 1. In the **Content** section, click **Define**.: 1. Click **Create message**. 2. Go to **Predefined templates** folder and choose **Walkthrough** template.
You can edit the template in two ways, by editing the code of the template ([add inserts](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-snippet-to-the-template-code), [add variables](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-variable)) and/or by filling out the form in the **Config** tab. In this use case, we will use the capabilities of the predefined the **Config** tab.
#### Edit form in the Config tab --- The form in the **Config** tab is already filled in with default values. You can keep them or change them to fit your business needs. These fields affect only the visual layer of the in-app message. 1. In the **Background** section, use the color picker to select the color of the background or enable background image and enter the link to this image (add the image to **Data Modeling Hub > Files** and then you can find there the URL to this image). 2. In the **Image** section, enable the image in your banner campaign and add the link to this image (add the image to **Data Modeling Hub > Files** and then you can find there the URL to this image). 3. In the **Header** section, enable header and add the text, font size and color of the header you want to display in the in-app message. 4. In the **Description** section, enable description and add the text, font size and color of the description you want to display in the in-app message. 5. In the **CTA button** section, enable the CTA and add the text on the button, corner radius, color, background color of the button, and add the URL to which you want to redirect users afer clicking the button. 6. In the **Close button** section, enable this option and set up the close position. 7. In the **Slide 2** and **Slide 3** sections, enable slide options and repeat steps 1-6. You can create up to 5 slides. 7. After you make changes to the template, you can check the preview. 1. Click the **Preview** button on the upper left side. 2. Enter the ID of a customer or a product. 3. Click **Apply**. 8. To continue the process of configuring the in-app campaign, click **Next**. 9. To save your content changes, click **Apply**.
The view of the in-app content configuration
In-app content configuration
### Select events that trigger the in-app message display --- In this part of the process, you will define the event triggering the display of the in-app message. 1. In the **Trigger events** section, click **Define**. 2. Select **Add event** and from the dropdown list, choose `client.applicationStarted` event.
Event [`client.applicationStarted`](/docs/assets/events/event-reference/web-and-app#clientapplicationstarted) is retained (can be seen on the activity list in the customer profile), and it only generates when the application was closed, and then opened again.
3. Click the **+ where** button and select `version`. 4. As the logical operator, select **Equal**. 5. In the text field, type the latest version of the application. 5. Click **Apply**.
In-app message trigger configured with client.applicationStarted event filtered by app version
In-app trigger event configuration
### Schedule the message and configure display settings --- As the final part of the process, you will set the display settings of the in-app message such as schedule, capping, priority of the message among other in-app messages. 1. In the **Schedule** section, click **Define** and set the time when the message will be active. 2. In the **Display Settings** section, click **Change**. 3. Define the **Delay display**, **Priority index** according to your business needs. 4. Enable the **Capping limit** toggle to limit the amount of time the in-app message can be displayed to a user in general, set it to **1**. 5. Click **Apply**. 6. Optionally, you can define the **UTM parameters** and **Additional parameters** for your in-app campaign.
You can find more on the in-app message settings in our documentation: - [Priority](/docs/campaign/in-app-messages/create-inapp-message#priority) - [Display settings](/docs/campaign/in-app-messages/create-inapp-message#configuration-of-display-settings) - [UTM and URL parameters](/docs/campaign/in-app-messages/create-inapp-message#define-utm-and-url-parameters) - [Additional parameters](/docs/campaign/in-app-messages/create-inapp-message#adding-custom-parameters)
7. Click **Activate**. ## Check the use case set up on the Synerise Demo workspace --- You can check the [in-app message](https://app.synerise.com/communications/in-app/72048dcc-f321-49b0-8fd1-6d9f598b4a64) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`client.applicationStarted`](/docs/assets/events/event-reference/web-and-app#clientapplicationstarted) (~1), [`inApp.show`](/docs/assets/events/event-reference/inapp#inappshow) (~1), [`inApp.click`](/docs/assets/events/event-reference/inapp#inappclick) (~1). ## Read more --- - [In-app messages](/docs/campaign/in-app-messages) - [Using in-app template builder](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template) # Personalized SMS with discount coupon SMS campaigns give you the opportunity to reach users quickly and very effectively. Even if the user does not take advantage of the promotion, you can be almost sure that he will open the message. It is a good idea not to abuse this channel but to use it only in certain situations. One of them is an engaging campaign with a promotional code that gives a specific user a specific value – in this case discounted shopping. ## Example of use - Retail Industry **Challenge** We prepared an engaging SMS campaign with discount codes. It was sent to customers who gave us permission to send SMS messages. They got an individual code with a discount which they could use in the online shop. ![Screenshot presenting personalized sms](/api/docs/image/f8a57079df9dd82ae8b22dc747691385d7d51d29/use-cases/all-cases/_gfx/general-sms.png) ## Prerequisites --- - Customer data base with phone numbers and marketing consent for sending SMS campaigns. - Discount coupons list. - Integration of [SMS gateway with Synerise](/docs/settings/configuration/sms-account). ## Process --- In this use case, you will go through the following steps: 1. [Add Voucher Pools](/use-cases/sms-with-discount#add-voucher-pools). 2. [Prepare the SMS content](/use-cases/sms-with-discount#prepare-the-sms-content). ## Add Voucher Pools --- 1. Go to Data Modeling Hub icon **Data Modeling Hub > Voucher Pools > Add pool**. 2. On the pop-up, fill in the following fields: 1. In the **Pool name** field, enter the name of the pool (the name is only visible on the list of the voucher pools). 2. Optionally, from the **Barcode** type dropdown list, select the type of codes which will be imported in the CSV file to Synerise.
The selection in the dropdown has no influence on the further process. It serves only informational purposes for the users.
3. Optionally, in the **Voucher prefix** field, enter a number that will be added to the beginning of each code. 4. In the **Emission start** and **Emmision end** fields, select the dates when the distribution of the codes starts and finishes, respectively. 5. Optionally, to limit the size of the pool, fill in the **Pool limit** field. 6. Optionally, in the **Limit per profile**, define how many times a customer can get this voucher from the pool. 7. Optionally, in the **Description** field, enter the internal description of the pool that is visible only on the list of voucher pools. 3. Confirm by clicking **Apply**. After importing them, you will be able to see the code with every voucher and information about whether it is assigned or unassigned to any customer. You can also see the assignment date and the date of use. ![Screenshot presenting voucher pools](/api/docs/image/f8a57079df9dd82ae8b22dc747691385d7d51d29/use-cases/all-cases/_gfx/voucher.png) ## Prepare the SMS content --- 1. Go to **Experience Hub > SMS > Create new** 2. In the **Audience** section, choose the campaign recipients. The system will automatically show you the customers who have given marketing consent for this type of campaign and have phone numbers on their contact card. You can choose to send the SMS to specific segments, create a new one directly from this place or send the message to everyone. 3. In **Content**, you have to choose the sender name (based on previously completed integration with a sending platform) and then you can create a message template in the text editor. 4. Click **Inserts** and choose pools with coupon codes you have created in previous step. Find it on the inserts list and copy its code to your message. 5. Add additional text to your message. 6. Save your template. 7. In **Schedule** section, choose what time the campaign will be sent 8. The last part is testing. If you want to test your SMS, you have to add your phone number and check how the message is displayed. 9. Save and run your campaign. ![Screenshot presenting sms](/api/docs/image/f8a57079df9dd82ae8b22dc747691385d7d51d29/use-cases/all-cases/_gfx/sms10.png) ## Check the use case set up on the Synerise Demo workspace --- Check the [SMS campaign settings](https://app.synerise.com/campaigns/create/d56922c7-9eb6-4a9c-9f5b-bc128b4ac356) in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 2 events per profile that completes the flow: [`sms.send`](/docs/assets/events/event-reference/sms#smssend) (~1), [`voucherCode.assigned`](/docs/assets/events/event-reference/loyalty#vouchercodeassigned) (~1). ## Read more --- - [Catalogs](/docs/assets/catalogs) - [Creating SMS campaign](/docs/campaign/SMS) - [Voucher Pools](/docs/assets/code-pools) # Personalized homepage with section recommendation With Section recommendations, you can create a custom page with recommended products divided into sections. These sections display items based on a chosen item attribute and additionally they are automatically adjusted to match the customers' preference. This type of recommendation lets the customer have a product overview, with the items relevant for them, chosen by the AI-based models. In this use case, you can find an instruction on creating a recommendation for a retail website that consists of 5 rows of categories with 4 items for each category type. The categories of the products are represented in the following way: "Clothing > t-shirts and tops > t-shirts > long sleeve". However, we would like to present the section with a smaller granularity of categories, for example, "Clothing > t-shirts and tops". ## Prerequisites --- - The [items feed](/docs/ai-hub/recommendations-v2/item-feed-requirements) must be provided. - You must [configure the AI engine](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations): - Enable the Section page model. - In the **Attributes for distinct filters** section, you must select the attributes which will be available for use in the **Item attribute** field when [creating a section page recommendation](/docs/ai-hub/recommendations-v2/creating-section-recommendations#configure-item-settings). In the **Item attribute** field you will choose the item feature (for example, brand) based on which the items will be selected for a slot in the recommendation. If this step is skipped, the field will remain empty, making it impossible to complete the recommendation. Optionally, you can provide [metadata catalog](/docs/ai-hub/recommendations-v2/item-feed-requirements). ## Create a recommendation --- 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 3. In the top left corner, enter the name of your recommendation. 4. In the **Type & Items feed** section, click **Define**. 5. From the **Items feed** dropdown menu, choose the provided feed. 6. Choose the **Section** recommendation type. 7. Under the section types, from the dropdown list, choose your **Metadata catalog**. 8. Click **Apply**. 9. In the **Items** section, click **Define**. 10. Click **Add slot**. 11. Set the **Number of sections** option to 5. 12. Set the **Number of items per section** option to 4. 13. From the **Items attribute** dropdown, choose the `category` attribute. 14. In the **Category level** input area that appears, define the category level as a numeric value, in our case 2.
If your products categories have a `X > Y > Z` structure, level 0 will be `X > Y > Z`. Level 1 will be `X > Y` and so on. Here, you are defining how granular the category recommendations will be. For example, if you sell shoes, you will have a `Outdoor > Sport > Running` category and a `Outdoor > Sport > Football` category. If level 0 is provided, both categories can be recommended. If level 1 is provided, `Outdoor > Sport` category will be recommended to the customer.
15. Click **Apply**. 16. In the top right corner, click **Save**. ## What's next --- You can display the recommendation on your home page, use [dynamic content](/docs/campaign/dynamiccontent). 1. Go to **Experience Hub > Dynamic content > New dynamic content**. 2. In the body of the dynamic content, use the recommendation insert.
Click here to display the insert
{% recommendations3 campaignId=aIEkwqXw0wLB %} {% for slot in slots_products3 %} {% for row in slot.rows %} <!-- Variable metadata which allows you to access the metadata catalog --> {{ row.metadata.itemId }} {{ row.metadata.imageLink }} <!-- Iterates through items in a given section --> {% for item in row.items %} {{ item.itemId }} {{ item.title }} {% endfor %} {% endfor %} {% endfor %} {% endrecommendations3 %}
Read more about how to use recommendation in inserts [here](/developers/inserts/recommendations-v2).
3. Add CSS and/or HTML to the dynamic content. 4. [Define the rest of the settings](/docs/campaign/dynamiccontent/creating-dynamic-content). ## Check the use case set up on the Synerise Demo workspace --- You can check the [recommendations](https://app.synerise.com/ai-v2/recommendations/Ms42quPJDmQG) which let you implement described basic AI Search on your website. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 5 events per profile that completes the flow: [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1), [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1). ## Read more --- - [Recommendations](/docs/ai-hub/recommendations-v2) # Recommendations for customers with high lifetime value To improve the effectiveness of recommendations, you can use the Predictions feature to set customers with a high lifetime value (LV) as the target group. Based on the prediction results on lifetime value estimation for each customer, you can prepare a segmentation that consists of customers organized according to the score for a customer lifetime value. With an efficient customer segmentation, you have a better understanding of customers and can design a strategy for recommendations that is tailored for these groups. The last step is to combine all information while creating a recommendation - you can encourage customers with low propensity to buy, but to those with a high livetime value (LV) score, you can recommend items that, apart from the matching criterion based on previous interactions, will meet the condition of low price and high margin. The potential purchase won't lower the profit margin generated by the customer. ## Prerequisites --- - Enable the [personalized recommendation model](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). - Create a segmentation based on [the results of the customer lifetime value prediction](/use-cases/ltv-prediction). - Your item catalog must include the attribute that describes profit margin (in this use case, the value of the margin is expressed as a string). ## Create a recommendation --- 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. Enter a meaningful name of the recommendation. 3. In the **Type & Items feed** section, click **Define**. 1. From the **Items feed** dropdown list, select the catalog that contains items for the recommendation. 2. As the type, select **Personalized**. 3. Click **Apply**. 4. In the **Items** section, click **Add slot**. You can name the slot for later reference. 5. In the **Number of items** subsection, set the minimum number of items to `4` and maximum number of items to `6`. 6. Click **Static filter**.
Learn about the difference among [elastic, static filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#select-conditions-of-displaying-items), and [distinct filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#distinct-filter).
7. From the dropdown list, choose **IQL Query**. 7. Click **Select**. 8. From the dropdown list, select **Function**. **Result**: The **ADD** function appears. 8. Click **ADD** and from the dropdown list, select the **IF** function. **Result**:
If function syntax
If function syntax
8. Click the first **Select** node. 1. From the dropdown list, select **Profile segmentations**. 2. Next to the **client.segmentations** node, click the Plus icon icon. 3. From the dropdown list, select **Attribute**. 3. Click the **null** node. **Result**: Property selector appears below. 4. Click **Attribute**. 5. From the dropdown menu, select **Segmentation**. 5. Click **Select value**. 6. From the dropdown list, choose the name of the segment that you created based on the customer lifetime value prediction. 6. Between the **client.segmentations** node and the selected segmentation node, click the plus icon. 7. From the dropdown, choose **HAS**. 9. In the **IF** function, click the middle **Select** node. 1. From the dropdown menu, choose **Attribute**. 2. Click the **null** node. **Result**: Property option appears below. 3. Click **Select value**. 4. From the dropdown list, choose the attribute that describes the items' margin. 4. Next to the selected attribute, click the Plus icon icon and choose **String**. 5. Click the **value** node. **Result**: Property selector appears below. 6. Click **Manual value**. 7. From the dropdown list, select **Attribute value**. 7. Click **Select value**. 8. From the dropdown list, select the attribute that describes items' margin. 8. Click **Select value**. 9. From the dropdown list, choose the margin attribute value. In our example, it is `high`. 9. Between the margin attribute and the **high** node, click the plus icon. 10. Choose the Equal icon sign. 10. In the **IF** function, click the last **Select** node. 11. From the dropdown list, choose **Take all**. **Result**:
The final configuration of the IQL query
The final configuration of the IQL query
11. At the bottom of the static filters pop-up, click **Apply**. 12. In the **Items** section, click **Apply**. 13. In **Boosting**, you can enable [boosting](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#define-the-boosting-factors). 14. In **Additional settings**, optionally you can exclude already bought products and set a metric to sort by. 15. Save the recommendation by clicking **Save**. ## What's next --- You can display the recommendation to customers in a number of ways, for example by using the [recommendation insert](/developers/inserts/recommendations-v2) in [dynamic content](/docs/campaign/dynamiccontent/creating-dynamic-content). ## Check the use case set up on the Synerise Demo workspace --- Check the prepared [recommendations](https://app.synerise.com/ai-v2/recommendations/lvodHInFzhkP) and [segmentation](https://app.synerise.com/analytics-v2/segmentations/2c0ddbb3-261b-4d41-adb3-bc73ec4c29f3) directly in the Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Building elements in IQL builder](/docs/ai-hub/recommendations-v2/recommendation-filters#elements-of-the-formula) - [Calculate customer lifetime value](/use-cases/ltv-prediction) - [Creating recommendations](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign) - [Enable Predictions](/docs/ai-hub/predictions/predictions-introduction#how-can-i-get-started) - [Filters in recommendations](/docs/ai-hub/recommendations-v2/recommendation-filters) - [Requirements for item feed](/docs/ai-hub/recommendations-v2/item-feed-requirements) - [Setting up the predictions](/docs/ai-hub/predictions/predictions-introduction#what-are-predictions) # Pop-up with a reminder about abandoned products in the cart An effective strategy for online businesses to retrieve lost sales is through an abandoned cart pop-up message. Such notifications serve as a reminder to customers about the products they have left in their shopping cart and urges them to finalize their purchase. They often include a personalized message, a list of items left in the cart, and a call-to-action button to encourage the customer to complete their purchase. By using this method, online businesses can potentially increase sales and improve customer engagement while being cost-efficient. This use case describes the implementation of dynamic content (DC) with abandoned cart notification. With predefined dynamic content web layer templates, you can create such a DC much faster without having to create a template from scratch.
The view of the dynamic content pop-up message
## Prerequisites --- - [Implement a tracking code](/docs/settings/tool/tracking_codes). - Implement the [transaction events](/developers/web/transactions-sdk) using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). - [Implement the `cart.status` event](/developers/web/cart), which stores the current status of the basket in the form of an event on the profile's card. The event has to be sent to Synerise after every change in the cart status. - Collect [product.addToCart event](/docs/assets/events/event-definitions). ## Process --- In this use case, you will go through the following steps: 1. [Create an aggregate](#create-an-aggregate) that returns the products in the cart for every individual customer. 2. [Create a dynamic content](#create-a-dynamic-content) with the contents of the abandoned cart using the predefined template. ## Create an aggregate --- In this step, create an aggregate that returns the list of products in a cart. The result of the aggregate will be used to display products in your dynamic content. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last**. 5. From the **Choose event** dropdown list, select the `cart.status` event. 6. As the event parameter, select **products**. 7. Set the period from which the aggregate will analyze the results to **Lifetime**. 12. Save the aggregate.
Decision Hub Last aggregate returning the products parameter of the last cart.status event over a customer's lifetime
Configuration of the aggregate
## Create a dynamic content --- Create a dynamic content campaign with abandoned cart items using a predefined web dynamic content layer template. This dynamic content will be displayed as a pop-up on your site for customers who haven't made a transaction within an hour from adding the product to cart. 1. Go to Experience Hub icon **Experience Hub > Dynamic Content > Create new**. 2. Enter the name of the content. 3. Choose **Web layer** type. ### Define Audience 1. In the **Audience** section, select **New Audience** and click **Define conditions**. 1. From the **Choose filter** dropdown list, select the `product.addToCart` event. 2. Click the calendar in the right bottom of the page. 1. In the **Relative date range** section, define the analyzed period. In this case, choose **Today**. 2. Click **Apply**. 3. Click **Choose filter**, from the dropdown list, select the `product.addToCart` event. 4. Click **add funnel step**. 5. From the **Choose event** dropdown list, select the `transaction.charge` event. 6. Change **matching** to **not matching**. 7. Click the calendar in the right bottom of the page. 1. In the **Relative date range** section, define the analyzed period. In this case, choose **Today**. 2. Click **Apply**. 8. Click the clock next to the calendar. 1. Type `1` and from the dropdown list, select **Hours**. 2. Click **Apply**.
The view of the Dynamic Content Audience configuration
Audience configuration
8. To save the audience, click **Apply**. ### Define content 1. In the **Content** section, click **Create Message**. 2. From the list of template folders, select a folder with the predefined **Web layer templates**. **Result:** You are redirected to the list of predefined templates.
The view of the Web layer templates folder
Web layer templates folder
3. Select the **Abandoned cart** template. **Result:** You are redirected to the template builder.
You can edit the template in two ways, by editing the code of the template ([add snippets](/docs/campaign/dynamiccontent/creating-dynamic-content-templates/dynamic-content-template-builder#adding-a-snippet-to-the-template-code), [add variables](/docs/campaign/dynamiccontent/creating-dynamic-content-templates/dynamic-content-template-builder#adding-a-variable) and/or by filling out the form in the Config tab. In this use case, we will use the capabilities of the predefined Config tab.
#### Edit the form in the Config tab The form in the Config tab is already filled in with default values. You can keep them or change them to fit your business needs. 1. From the **Aggregate with products left in the cart** dropdown list, select the ID of the aggregate you created [in the previous step](#create-an-aggregate). You can find it by typing its name or ID in the search box. 2. In the **Header text** field, define the header you want to display in the pop-up message. 3. In the **Currency** field, specify the currency in which you want to display the prices of the items. 4. In the **Bottom text** field, define the copy you want to appear on the bottom of the page. 5. In the **Font** field, define the font of all text displayed in the dynamic content. 6. Define the colors in the **Bottom bar background** and **Bottom bar text color**. 7. Choose the most suitable carousel scrolling method for you by enabling one or all toggles the same time: - **Carousel autoplay**: activation of this toggle allows automatic scrolling of items in the carousel; - **Carousel loop**: activation of this toggle allows users to navigate to the first article in the carousel by clicking the arrow after the last article displayed in the carousel; - Enabling these two options at the same time will combine these functionalities. In this case, the recommendation carousel will scroll automatically and return to the first item automatically after displaying the last one. - If you don’t activate any of the toggles, users will have to scroll through the carousel on their own, and when they get to the last item, it won’t automatically redirect them to the beginning of the carousel 8. In the following fields, define the item amount that you would like to display in small, medium, large and extra large screens. 9. After you make changes to the template, you can check the preview. 1. Click the **Preview** button on the upper left side. 2. Enter the ID of a customer.
Select a customer who has the `product.addToCart` event in their activity list in **Behavioral Data Hub > Profiles**.
3. Click **Apply**.
If you are using custom attributes in your product feed, you need to replace the names of the standard attributes used in the template code with the names of the attributes used in your feed.
10. If the template is ready, in the upper right corner, click **Save this template > Save as**. 11. On the popup: 1. In the **Template name** field, enter the name of the template. 2. From the **Template folder** dropdown list, select the folder where the template will be saved. 3. Confirm by clicking **Apply**. 12. To continue the process of configuring the dynamic content campaign, click **Next**. 13. To save your content changes, click **Apply**. ### Define schedule and display settings 1. In the **Schedule** section, click **Define** and set the time when the message will be active. 2. In the **Display Settings** section, click **Define**. 3. Specify circumstances for dynamic content to be displayed. Optionally, you can also define the Advanced options. In our case, we will define the frequency of dynamic content to be displayed to **Once per day**. You can also define the type of device you want to show your dynamic content. 4. Click **Apply**. 5. Optionally, you can define the UTM parameters and additional parameters for your dynamic content campaign. 6. Click **Activate**. ## Check the use case set up on the Synerise Demo workspace --- You can check the the configuration of each step from this use case in our Synerise Demo workspace: - [Aggregate](https://app.synerise.com/analytics/aggregates/17d214c4-5644-33b1-b0c6-9fab96b26b3e) - [Dynamic Content](https://app.synerise.com/campaigns/create/3cbc322f-74e4-4fb8-8897-8ef9d96fdd9c) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 4 events per profile that completes the flow: [`product.addToCart`](/docs/assets/events/event-reference/items#productaddtocart) (~1), [`cart.status`](/docs/assets/events/event-reference/items#cartstatus) (~1), [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Dynamic content](/docs/campaign/dynamiccontent) - [Dynamic content template builder](/docs/campaign/dynamiccontent/creating-dynamic-content-templates/dynamic-content-template-builder) - [Snippets](/docs/assets/snippets) # Email notification to call center about expensive abandoned cart You can alert your call center when a customer doesn’t complete a purchase of high value. Send an email alert with their contact details, the products from their abandoned cart and some personalized recommendations for the customer. After your call center receive the email alert, they can contact the customer directly and convince them to finish their purchase. This use case describes how to prepare an automated workflow that is triggered by customer adding products to a cart exceeding specified value. In response, the workflow sends an email alert to your call center with products that the customer abandoned in the cart and contact data of this customer such as phone number after 48 hours, if they have not made a purchase. One of the challenges addressed in this use case is the use of Email Alert node. ## Prerequisites --- - [Create an email account](/docs/campaign/e-mail/configuring-email-account). - [Create an email template](/docs/campaign/e-mail/creating-email-templates) with an alert. - Implement customer identification [on the website](/developers/web/tracking-form-data) and [in your mobile app](/developers/mobile-sdk/user-identification-and-authorization). - Implement a custom event for adding a product to cart, which will be available in the customer profile. In this example, the event is called `product.addToCart`. Implement custom events in your [mobile application](/developers/mobile-sdk/event-tracking#product-added-to-cart) or [website](/developers/web/event-tracking#declarative-tracking-custom-events). ## Prepare a workflow --- Create a workflow which sends an email alert to your call center, after a customer abandons their shopping cart with value exceeding a specific amount. Optionally, you can add additional nodes, depending on your business needs. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Profile Event trigger node --- At this stage, we will configure conditions that launch the workflow. As a trigger, we will use the `product.addToCart` event. 1. As the first node of the workflow, add **Profile Event**. In the configuration of the node: 1. From **Choose event** dropdown menu, choose `product.addToCart` event. 2. Click the + where button, from the **Choose parameter** dropdown menu, choose **product:price:amount**. 3. From the **Choose operator** dropdown, choose **Number**, and then select **More or equal to**. 4. In the next field, type the price amount of the items. 2. Confirm by clicking **Apply**.
Automation Hub Profile Event node configured with product.addToCart event filtered by minimum item price
Configuration of the Profile Event node
### Configure the Event Filter node --- This node will set the workflow to wait for 48 hours for customer conversion (`product.buy`). If the purchase occurs, then the workflow ends. If it doesn't happen, the workflow moves on because the customer meets the abandoned cart scenario. This setting is just an example and can be configured according to your business needs. 1. As the next node, add **Event Filter**. In the configuration of the node: 1. In the **Check** field, from the dropdown menu choose **for period of time**. 2. Set the time range. In our case, it is 48 hours. 3. In the **Define conditions** section, from the **Choose event** dropdown menu, choose `product.buy` event. 4. Click the + where button and from **Choose parameter** dropdown menu, choose **product:price:amount**. 5. From the **Choose operator** dropdown, choose **Number**, and then select **More or equal to**. 6. In the next field, type the price amount of the items, the same as in the previous step. 4. Confirm by clicking **Apply**. 5. For the **Matched** path, add the **End** node. ### Configure the Email Alert node --- 1. To the **Not matched** path, add **Email Alert**. Configure according to your business needs. 2. Define Content: 1. In the **Template for content** field, select an alert email template prepared earlier. 2. In the **Subject** field, enter your message subject. 3. In the **Recipent** section, create a list of call center recipients of the alert email. 4. Confirm by clicking **Apply**.
You need to enrich your email template with customer's contact data and with the data of the product from their abandoned cart. Use [customer attributes inserts](/developers/inserts/insert-usage#customer-attributes) to enrich template with customer's information such as phone number, email address etc. Use [automation inserts](/developers/inserts/automation#event-parameters) to insert the product the customer abandoned in their cart.
You can also include 5 last seen products by this customer, and 5 products from personalized recommendations. Check this [use case](/use-cases/saving-abandoned-carts-using-dynamic-email-recommendations) for inspiration.
### Add the finishing node --- 9. Add the **End** node. 10. In the upper right corner, click **Save & Run**.
Automation Hub workflow for sending an abandoned cart call center notification
The workflow configuration
## Check the use case set up on the Synerise Demo workspace --- You can also check the [workflow configuration](https://app.synerise.com/automations/workflows/automation-diagram/39f6f5ac-fb0b-4195-8875-c474754a2f8f) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 6 events per profile that completes the flow: [`product.addToCart`](/docs/assets/events/event-reference/items#productaddtocart) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~2), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1). ## Read more --- - [Creating email templates](/docs/campaign/e-mail/creating-email-templates) - [Creating workflows](/docs/automation/creating-automation) # Brickworks loyalty template with tiered offer Delivering personalized and context-aware communication often requires combining behavioral insights with dynamically evaluated logic. [Brickworks](/docs/assets/brickworks) allows you to define a communication template that can dynamically assign the most relevant loyalty offer for each customer based on their browsing behavior. In this use case, you will create a schema that enables an email template to return a specific loyalty offer based on an evaluated expression. This supports a next best offer (NBO) approach, where each customer receives the most relevant promotion determined by their behavior. The expression analyzes the price range of the products they viewed and assigns them to one of three predefined tiers. Based on the tier result, customers can automatically receive an email containing the loyalty offer that best matches their browsing behavior.
Email message example
## Prerequisites --- - Implement a [tracking code](/developers/web/installation-and-configuration) into your website. - Implement the [transaction events](/developers/web/transactions-sdk) using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). - Prepare a tier-based loyalty offer. ## Process --- In this use case, you will go through the following steps: 1. [Create an aggregate](#create-an-aggregate) that will return last visited product price. 2. [Create segmentations](#create-segmentations) of customers qualifying for one of the three offer tiers. 3. [Create an expression](#create-an-expression) that returns information on tier which the customer qualifies for. 4. [Create a schema](#create-a-schema) with offer based on the expression result. 5. [Create records](#create-records). 6. [Create an email campaign](#create-an-email-campaign) based on the brickworks schema, using our predefined email template. ## Create an aggregate --- In this step, create an aggregate that returns the price of the last visited product. The result of the aggregate will be used in segmentations determining tiers in the offer. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Last**. 5. From the **Choose event** dropdown list, select the `page.visit` event. 6. As the event parameter, select **price**. 7. Click the **+ where** button. 8. From the **Choose parameter** dropdown list, select **price** once again. 9. From the **Choose** dropdown list, select **String** and the **Is not empty** operator. 7. Set the period from which the aggregate will analyze the results, in our case **Last 30 days**. 12. Save the aggregate.
Decision Hub Last aggregate returning the price of the last visited product page in the past 30 days
Aggregate that returns the price of the last visited product configuration
## Create segmentations --- Based on the [aggregate created in the previous step](#create-an-aggregate), create three segmentations of customers qualifying for one of the three next best offer tiers - Low Cost, Advantage, or All Inclusive. ### Low cost tier segmentation 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of the segmentation. 1. Click **Add condition**. 2. Select the [aggregate created in the previous step](#create-an-aggregate). 3. From the **Choose** dropdown list, select **Number** and the **Less or equal to** operator. 4. In the text field, enter `300` as the upper limit of this tier. 5. Click **Save**.
Decision Hub segmentation configuration for the low-cost loyalty tier
Segmentation that returns customers meeting the conditions of the low cost tier
### Advantage tier segmentation 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of the segmentation. 1. Click **Add condition**. 2. Select the [aggregate created in the previous step](#create-an-aggregate). 3. From the **Choose** dropdown list, select **Number** and the **Less than** operator. 4. In the text field, enter `700` as the upper limit of this tier. 5. Click **Add condition**. 2. Select the [aggregate created in the previous step](#create-an-aggregate). 3. From the **Choose** dropdown list, select **Number** and the **More than** operator. 4. In the text field, enter `300` as the lower limit of this tier. 5. Click **Save**.
Decision Hub segmentation configuration for the advantage loyalty tier
Segmentation that returns customers meeting the conditions of the advantage tier
### All inclusive tier segmentation 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of the segmentation. 1. Click **Add condition**. 2. Select the [aggregate created in the previous step](#create-an-aggregate). 3. From the **Choose** dropdown list, select **Number** and the **More or equal to** operator. 4. In the text field, enter `700` as the upper limit of this tier. 5. Click **Save**.
Decision Hub segmentation configuration for the all-inclusive loyalty tier
Segmentation that returns customers meeting the conditions of the all inclusive tier
## Create an expression --- In this step, create an attribute expression that evaluates the customer's last visited product price and assigns it to the appropriate offer segment. The expression checks whether the profile meets the criteria for the Low Cost, Advantage, or All Inclusive NBO segmentation categories and returns the corresponding offer label. This expression will be later used in the schema. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. Enter the name of the expression. 3. Set the **Expression for** option to **Atribute**. 4. Click **Select** and from the **Function** dropdown list, choose **To string**. 5. Click **Select** in the brackets, and from the **Function** dropdown list, choose **If**. 6. Click the first **Select** in the brackets, and pick **Profile**. 1. Click the **0** node that appeared on the canvas. 3. Scroll down the page and click **Choose attribute**. 4. From the dropdown list, select the [low cost tier segmentation you created earlier](#low-cost-tier-segmentation). 7. Click the second **Select** in the brackets, and pick **Constant**. 1. Click the **0** node that appeared on the canvas. 3. Scroll down the page and type `Low Cost Offer` in the field. 8. Click the third **Select** in the brackets, and from the **Function** dropdown list, choose **If**. 9. Click the first **Select** in the brackets, and pick **Profile**. 1. Click the **0** node that appeared on the canvas. 3. Scroll down the page and click **Choose attribute**. 4. From the dropdown list, select the [advantage tier segmentation you created earlier](#advantage-tier-segmentation). 10. Click the second **Select** in the brackets, and pick **Constant**. 1. Click the **0** node that appeared on the canvas. 3. Scroll down the page and type `Advantage` in the field. 11. Click the third **Select** in the brackets, and from the **Function** dropdown list, choose **If**. 12. Click the first **Select** in the brackets, and pick **Profile**. 1. Click the **0** node that appeared on the canvas. 3. Scroll down the page and click **Choose attribute**. 4. From the dropdown list, select the [all inclusive tier segmentation you created earlier](#all-inclusive-tier-segmentation). 13. Click the second **Select** in the brackets, and pick **Constant**. 1. Click the **0** node that appeared on the canvas. 3. Scroll down the page and type `All inclusive` in the field. 14. Click the thirds **Select** in the brackets, and pick **Constant**. 1. Click the **0** node that appeared on the canvas. 3. Scroll down the page and type `null` in the field. 15. Click **Save**.
The view of the expression configuration
Expression that returns information on tier which the customer qualifies for.
## Create a schema --- In this section, you will configure a [Brickworks schema](/docs/assets/brickworks/quick-start/creating-a-schema) with fields for offer information. 1. Go to Data Modeling Hub icon **Data Modeling Hub > Schemas > New schema**. 2. Choose **Simple Schema**. 3. In **Display name**, enter a name for the schema, for example **Telco offers**. **API names** value is pre-filled with the value from **Display name**. The value in this field is the unique identifier used to reference this schema in API requests. 4. Optionally, add the **Description**. ### Add the Offer title 1. Click **Add new field** and choose **String**. 3. Complete the fileds: - Add the **Display name** for the field in our case `Offer title`. - The **API name** will be pre-filled automatically. - **Description** is optional, in our case `Presents offer title to be displayed for customer`. 4. In **Settings**, select **Use as record title**. 5. Click **Apply** to save your changes.
Brickworks schema field configuration showing Offer title string field
Schema configuration
### Add the Offer image 1. Click **Add new field** and choose **Image**. 3. Complete the fileds: - Add the **Display name** for the field in our case `Offer image`. - The **API name** will be pre-filled automatically. - **Description** is optional, in our case `image of the offer`. 5. To save your changes, Click **Apply**. ### Add other descriptive fields 1. Click **Add new field** and choose **String**. 3. Complete the fileds: - Add the **Display name** for the field. - The **API name** will be pre-filled automatically. - **Description** is optional. 5. To save your changes, click **Apply**. In this use case, we add the following **String** fields: - `Offer short description` - describes the purpose of the offer, - `Package conditions` - minutes, internet packages description, - `Promotion for new subscribers` - new subscribers only - promotion information. ### Add the Price 1. Click **Add new field** and choose **Number**. 2. Choose **Float** to let users type real numbers, also numbers which contain fractional or decimal parts. 3. Complete the fileds: - Add the **Display name** for the field in our case `Price`. - The **API name** will be pre-filled automatically. - **Description** is optional, in our case `monthly price for offer in Euro`. 5. To save your changes, click **Apply**. ### Add the Number of months 1. Click **Add new field** and choose **Number** 2. Choose **Integer** to let users type in a whole number that can be positive, negative, or zero, but does not include any fractional or decimal part. 3. Complete the fileds: - Add the **Display name** for the field in our case `number of months`. the **API name** will be pre-filled automatically. **Description** is optional, in our case `Number of contracted months. -1 equals that the offer has no contract engagement`. 4. In **Settings**, check **Dafault value** and type `-1` 5. To save your changes, click **Apply**.
Brickworks schema field configuration showing Number of months integer field
Brickworks configuration
### Add the Expression 5. Click **Add new field** and choose **Expression**. 3. Complete the fileds: - Add the **Display name** for the field in our case `qualified offer`. - The **API name** will be pre-filled automatically. - **Description** is optional, in our case `informs about offer which qualifies for client`. 4. Choose the [expression created in the previous part of the process](#create-an-expression) from the list. 5. To save your changes, click **Apply**. ### Add the Jinjava code 5. Click **Add new field** and choose **Jinjava code** 3. Complete the fileds: - Add the **Display name** for the field in our case `display offer`. - The **API name** will be pre-filled automatically. - **Description** is optional, in our case `informs if offer should be displayed`. 4. Use jinjava code:
{% if record.offerTitle == record.qualifiedOffer %}true{% else %}false{% endif %}
5. To save your changes, click **Apply**. ### Set up the Audience & Settings 1. Click the **Audience & Settings** tab. 2. In the **Audience** section, click **Define**. 3. Choose the schema recipients according to your needs, in our case choose **Everyone**. 4. Click **Apply**. 5. In the upper-right corner, click **Save** ## Create records --- [Creating a record](/docs/assets/brickworks/quick-start/creating-a-record) means adding the data to the schema. It means that you fill out schema fields. In this case, these are examples of telecommunications offers - one of the three next best offer tiers - Low Cost, Advantage, or All Inclusive. 1. Go to Data Modeling Hub icon **Data Modeling Hub > Data collections > Select schema**. 2. Choose [schema created in the previous step](#create-a-schema). 3. In the upper-right corner, click **New record**. We will create three records in total, for each of the tiers. 4. Add a name for the record. 5. Add a slug for the record. Slug is a unique, URL-friendly version of the name. It usually contains only lowercase letters, numbers, and hyphens. 6. Add **Offer title**. 7. Add coresponding **Offer image**, **Offer short description**, **Package conditions**, **Price**, **Number of months**, **Promotion for new subscribers**. 8. Everything in **Qualified offer** section shouold be pre-filled with data provided in the schema. 9. In the upper-right corner, click **Publish** to publish your record. 10. Repeat steps **3-9** for two remaining tiers. ### Previewing records After saving the record either as a draft (in case of records created based on versioned schemas) or publishing it (in case of both schema types), you can [preview the record for the context of a selected user](/docs/assets/brickworks/quick-start/creating-a-record#previewing-records). This context-driven approach enables your records to adapt dynamically based on the requesting application, user session, or any external factors you define. 1. In Data Modeling Hub icon **Data Modeling Hub > Data collections**. 2. In the header, from **Select schema** dropdown list, select the [schema created in the previous step](#create-a-schema). 3. Find the record which you want to preview. 4. Enter the record configuration. 5. Click **Preview**. 6. Click **Preview contexts**. 7. From the dropdown list, find a profile for which you want to generate record preview. This means the same record can render completely differently depending on the context you provide.
The view of the record results for an example profile
Record results for an example profile
8. You can also see the preview as JSON.
The view of the JSON record results for an example profile
JSON record results for an example profile
## Create an email campaign --- In this part of the process, you [create an email campaign](/docs/campaign/e-mail/creating-email-campaigns). We will use a predefined template, so there is no need to create a template from scratch. 1. Go to Experience Hub icon **Experience Hub > Email campaign > Create new**. 2. Enter the name of the email campaign. 3. In the **Audience** section, define the recipents of your campaign according to your business needs. ### Define content --- In this part of the process, you will create the content of the email message that returns information on tier which the customer qualifies for, with the help of ready-made template. 1. Click **Define** in the **Content** section. 2. From the dropdown in the **From email address** section, select the email account from which the email will be sent. 2. In **Subject**, provide the subject of the email. 3. Click **Create message** and from the list of template folders, select **Predefined templates**. 3. Select the **Brickworks: Telco offer** template. **Result:** You are redirected to the code editor.
You can edit the template in two ways, by editing the code of the template [add snippets](/docs/campaign/e-mail/creating-email-templates/email-code-editor#adding-a-snippet-to-the-template-code), [add variables](/docs/campaign/e-mail/creating-email-templates/email-code-editor#adding-a-variable) and/or by filling out the form in the Config tab. In this use case, we will use the capabilities of the predefined Config tab.
#### Edit form in the Config tab --- The form in the **Config** tab is already filled in with default values. You can keep them or change them to fit your business needs.
The view of the email template configuration
Email template configuration
1. To the **Schema ID** field, add the ID of the [schema created in the previous part of the process](#create-a-schema). 2. To the following fields, add the ID of the [records created in the previous part of the process](#create-records). You can find the ID of the record in the record URL: - **Record ID - Low cost offer**, - **Record ID - All inclusive**, - **Record ID - Advantage** fields**, 3. Optionally, you can edit the copy and design of the template. 10. After you make changes to the template, you can check the preview. 1. Click the **Preview** button on the upper left side. 2. Enter the ID of a customer. 3. Click **Apply**. 11. If the template is ready, in the upper right corner click **Save as...**. 12. On the pop-up: 1. In the **Template name** field, enter the name of the template. 2. From the **Template directory** dropdown list, select the folder where the template will be saved. 3. Confirm by clicking **Save**. 13. To continue the process of configuring the email campaign, click **Next**. 14. To save your content changes, click **Apply**. ### Prepare the final settings 1. In the **Schedule tab**, decide when your email is sent. 3. Optionally: 1. In the **UTM & URL parameters** section, add the parameters to track the email performance. 2. In the **Additional parameters** section, add the custom event parameters with constant values to the automatically generated events in the email channel. 3. In the **Test** section, you can send a test email of your message to verify if the content of the email is displayed correctly. 3. If everything is ready, click **Send**. ## What's next --- After defining this schema, you can reuse the template across other placements as needed. It can be applied in emails, in-apps, or any additional surfaces supported by your setup. ## Check the use case set up on the Synerise Demo workspace --- In Synerise Demo workspace, you can check the configuration of: - [Aggregate](https://app.synerise.com/analytics-v2/aggregates/861fd984-a278-3ff9-aefa-58db40fc21c2) - [Low cost tier segment](https://app.synerise.com/analytics-v2/segmentations/f71be786-8147-4dd3-8099-76434865e284) - [Advantage tier segment](https://app.synerise.com/analytics-v2/segmentations/680bb059-2ce0-4990-b380-39b1bdc932e6) - [All inclusive tier segment](https://app.synerise.com/analytics-v2/segmentations/e377294f-8e6a-42c7-9851-f0eff8a794d8) - [Expression](https://app.synerise.com/analytics/expressions/f7afae27-ad5a-4faf-afe0-ec32f7a89dcd) - [Brickwork schema](https://app.synerise.com/assets/brickworks/schemas/37ef59a6-710d-494f-b8c6-f67fd873a77d) - [Email campaign](https://app.synerise.com/campaigns/email/create/de4862a7-5e5b-4398-acbe-d907bf5ae477) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 6 events per profile that completes the flow: [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1), [`brickworks.generated`](/docs/assets/events/event-reference/brickworks#brickworksgenerated) (~3). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Brickworks](/docs/assets/brickworks) - [Email campaigns](/docs/campaign/e-mail) - [Expressions](/docs/crm/expressions) - [Segmentation](/docs/analytics/segmentations) # Recommendations with products in customer's size The purpose of the recommendation is to present the customer with the products best suited to their behavioral profile built during each visit in your online shop. One of the ways to do it is to recommend items in the customer's size. By analyzing previous transactions, you can save an additional attribute in the customer's profile that stores information about the size of the products that they purchased. Later, you can use this attribute to build a filter in recommendations. This use case shows how to create a recommendation that serves 4 personalized items in a customer's size. ## Prerequisites --- - Enable the [personalized recommendation model](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). - Supplement the customer profiles with the size attribute. ## Create a recommendation --- 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. Enter a meaningful name of the recommendation. 3. In the **Type & Items feed** section, click **Define**. 1. From the **Items feed** dropdown list, select the catalog that contains items for the recommendation. 2. As the type, select **Personalized**. 3. Click **Apply**. 4. In the **Items** section, click **Define**. 5. Click **Add slot**. You can name the slot for later reference. 5. In the **Number of items** subsection, set the minimum and maximum number of items to `4`.
Setting the minimum and maximum number of items to the same number ensures that exactly this many items will appear in the slot.
6. Click **Static filter**.
Learn about the difference among [elastic, static filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#select-conditions-of-displaying-items), and [distinct filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#distinct-filter).
7. From the dropdown list, choose **Visual Builder**. 7. Click **Select attribute**. 8. From the dropdown list, choose the item size attribute. 8. Click **Operator**. 9. From the dropdown list, choose **Equals**. 9. Click the Text value icon icon and keep clicking until you get the Select value icon option. 10. Click **Select value**. 11. From the dropdown list, choose the attribute that contains the customer's size. 11. On the bottom of the elastic filter pop-up, click **Apply**. 12. In the **Items** section, click **Apply**. 13. In **Boosting**, you can enable [boosting](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#define-the-boosting-factors). 14. In **Additional settings**, optionally you can exclude already bought products and set a metric to sort by. 15. Save the recommendation by clicking **Save**. ## What's next --- You can display the recommendation to customers in a number of ways, for example by using the [recommendation insert](/developers/inserts/recommendations-v2) in [dynamic content](/docs/campaign/dynamiccontent/creating-dynamic-content). ## Check the use case set up on the Synerise Demo workspace --- You can check the [recommendation settings](https://app.synerise.com/ai-v2/recommendations/0RaMcz0bJTtr) in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Creating recommendations](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign) - [Filters in recommendations](/docs/ai-hub/recommendations-v2/recommendation-filters) - [Requirements for item feed](/docs/ai-hub/recommendations-v2/item-feed-requirements) # Abandoned cart landing page with similar recommendations
Use Case - Abandoned cart Landing Page with personalized recommendations
Recovering abandoned carts is essential for maximizing revenue and strengthening customer retention. By leveraging customer behavior data, businesses can create a personalized shopping experience that encourages customers to complete their purchases. This approach becomes even more effective when combined with product recommendations, offering alternatives with similar features. A well-designed landing page that displays both abandoned items and similar products can significantly enhance the user experience and drive higher conversion rates by guiding customers toward products they are more likely to buy. This use case demonstrates how to integrate a dynamic product listing into a dedicated landing page and send a mobile communication redirection to it. It presents products customer abandoned in their cart and recommendations for similar products. The purpose is to offer customers a wider selection of items with similar features. The landing page will be built using predefined templates, making it easier to customize the project to meet your business needs. ## Prerequisites --- To be able to implement this use case, you must: - Implement mobile pushes in your mobile application: [iOS](/developers/mobile-sdk/configuring-push-notifications/ios), [Android](/developers/mobile-sdk/configuring-push-notifications/android). - [Import an item catalog for recommendations and configure AI engine](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). Enable Similar recommendations. - Implement the [transaction events](/developers/web/transactions-sdk) using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). - [Implement the `cart.status` event](/developers/web/cart), which stores the current status of the cart in the form of an event on the customer's card. The event has to be sent to Synerise after every change in the cart status. - Collect [product.addToCart event](/docs/assets/events/event-definitions). ## Process --- To create a landing page with similar products recommendations, perform the steps in the following order: 1. [Create an aggregate](#create-an-aggregate) returning products customer abandoned in their cart. 2. [Create an AI recommendation](#create-an-ai-recommendation) that will be used in the landing page template. 3. [Create a landing page](#create-a-landing-page). 4. [Create a mobile push notification](#create-a-mobile-push-notification) with a link to the landing page. 5. [Create a workflow](#create-a-workflow) sending a mobile push. ## Create an aggregate --- In this part of the process, create an aggregate that retrieves the list of products from the abandoned cart. These products will be displayed in the template and the aggregate result will serve as context for the recommendations. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. Enter the name of the aggregate. 3. As the type of the aggregate, select **Last**. 5. From the **Choose event** dropdown list, select the `cart.status` event. 6. As the event parameter, select **products**. 7. Set the analyzed period to **Lifetime**. 12. Save the aggregate.
Decision Hub Last aggregate returning the products parameter of the last cart.status event over a customer's lifetime
Configuration of the aggregate
## Create an AI Recommendation --- In this part of the process, you will configure a similar items recommendation with context of items customers abandoned in their carts. This recommendation will be later used in the landing page. 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. Enter the name of the recommendation (it is only visible on the list of recommendation). 3. In the **Type & Items feed** section, click **Define**. 4. From the **Items Feed** dropdown list, select an item feed. 5. In the **Type** section, choose the **Similar items** recommendation type. 6. Confirm the settings by clicking **Apply**. 7. In the **Items** section, click **Define**. 8. Define the minimum and maximum number of items that will be recommended to the customer in each slot. 9. Optionally, define [Static filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#static-filters) and [Elastic filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#elastic-filters). 10. Confirm by clicking **Apply**. 8. Optionally, you can define the **Boosting** factors. 9. In the **Additional settings** section click **Define**. 1. Enable the **Item context from analytics (aggregate, expression)** switch. 2. From the dropdown list select the aggregate you created [in the previous step](#create-an-aggregate). 3. Click **Apply**. 9. In the right upper corner, click **Save**. ## Create a landing page --- In this part of the process, you will create a landing page. We will use a predefined template for the abandoned cart landing page with similar recommendations, so there is no need to create a template from scratch. 1. Go to Experience Hub icon **Experience Hub > Landing Page > Create new**. 2. In the **Content** section, click **Define**. 2. From the list of template folders, select **Predefined templates**. 3. Select the **Abandoned cart** template. **Result:** You are redirected to the code editor.
You can edit the template in two ways, by editing the code of the template [add inserts](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-snippet-to-the-template-code), [add variables](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-variable) and/or by filling out the form in the Config tab. In this use case, we will use the capabilities of the predefined Config tab.
### Edit form in the Config tab --- The form in the **Config** tab is pre-filled with default values, which you can modify to suit your business needs. 1. In the **Aggregate - Abandoned Cart ID**, provide a unique identifier for the aggregate that retrieves the list of products from the abandoned cart. Provide the [ID of the aggregate you prepared in the previous step](#create-an-aggregate). You can find it by typing its name or ID in the search box. 2. From **Set the maximum number of items**, select the maximum number of items displayed in the abandoned cart section. 3. In the **Aggregate - Abandoned Cart Title**, you can customize the title for the section with products from the abandoned cart. 4. In **Catalog name**, enter the name of the item catalog. 5. In **Aggregate - Abandoned Cart CTA Text**, you can customize the text for the Call to Action button that will appear in the abandoned cart section. 6. To display similar recommendations enable the **Turn on for the additional recommendation to appear** toggle. 7. In **Additional Recommendation ID**, provide a unique identifier for the recommendation. Provide the [ID of the recommendation you prepared in the previous step](#create-an-ai-recommendation). You can find it by typing its name or ID in the search box. 8. 8. From **Set the maximum number of items**, select the maximum number of items to be displayed for similar products recommendation section. 9. In **Additional Recommendation Title**, you can customize the title for the section with recommendation for similar products. 10. In **Additional Recommendation CTA Text**, you can customize the text for the Call to Action button that will appear in the recommendation section. 11. Optionally, you can add an additional recommendation in the **Additional Recommendation** section. You can specify a title, unique ID, and set the maximum number of items to be shown in this secondary recommendation section. 14. In **Hero Header**, you can type the header you want to display on your landing page. 15. In **Hero Image**, you can provide the link to the main image. 17. In **Hero Paragraph**, you can customize the message that will appear beneath the title. 18. In **Hero Button Text**, you can insert the text that will be displayed on the main CTA (Call to Action) button in the Hero section. 19. Optionally, you can adjust the style of the landing page in the **Hero**, **Footer**, **General** and **Main** sections. 20. After you make changes to the template, you can check the preview. 1. Click the **Preview Contexts** button on the upper left side. 2. Enter the ID of a customer. 3. Click **Apply**.
The view of the Edit form in the Config tab
Edit form in the Config tab
8. If the template is ready, click **Use in communication**.
**Additionally, the template also includes extra features such as:** - The ability to add a stroke to the Header in the Hero section; - A switch that allows you to toggle between having a button border; - An option to put the Header First in the Hero Section (Column Look); - An option for your Hero Section to have a Background Image.
### Define schedule settings --- 1. In the **Schedule** section, click **Define**. 1. Select the timezone. 2. Select the time when the landing page will be active according to your business needs. 6. Click **Apply**
The view of the Schedule tab
Edit form in the Schedule tab
### Define the SEO settings --- In this part of the process you can define technical details concerning search engine optimization and increase the chances of placing high in search results. ### Set up the URL --- In this part of the process, you will define the URL to your landing page. 1. From the **Domain** dropdown list, select the address of your landing page. 2. Optionally, if you want to add a part to the address after the domain, in **Nice URL** provide this part, for example, `dresses-and-skirts` (don't use a slash, it is added automatically). 3. In **URL for redirecting users when the landing expires (optional)** enter the URL to which you will redirect users after the landing page expires. 4. Optionally, in **Fallback URL** enter the URL to which users will be redirected if your landing page is unavailable due to errors (for example, when it can't be rendered due to Jinjava syntax error). If you leave this field empty, users will be redirected to a generic error page. 4. In **URL preview**, you are provided with a final link to your landing page. The preview is in real time, so if you fill a domain or URL, you get the preview of the address simultaneously. 5. Confirm the settings by clicking **Apply**. ### Adjust optional settings --- 1. In the **HTTP headers** section, you can add custom HTTP headers to your landing page. In the **Key** and **Value** fields, enter a header and its value, respectively. 2. In the **Customize** section: - you can add CSS and scripts to your landing page - you can define the URLs to external sources or paste the snippets - in the JS section under the **Advanced options** option, to enable tracking users on your landing page, you can paste the [tracking code](/developers/web/installation-and-configuration#adding-the-tracking-code-to-your-site). ### Save your campaign 1. After you make changes to the campaign, you can check the preview. Click the **Preview** button on the upper right side. 2. When your landing page is ready you can **Save it as a draft** or directly click **Publish**. ## Create a mobile push notification --- In this part of the process, create an mobile push with link to the landing page. You can use a predefined template or create your own template from scratch. 1. Go to **Experience Hub > Mobile > Templates**. 2. You can use the template from the folder or create your own one using the mobile push code editor. Click **New Template > Simple Push**. 2. Create your mobile push in the code editor, and place there the link to the landing page created in the [previous step](#create-a-landing-page). For more information on creating a simple mobile push, visit our [User Guide](/docs/campaign/Mobile/creating-mobile-push).
To ensure that the landing page content is personalized and rendered specifically for the customer who is being redirected, you must pass the UUID of the customer in the link. This can be done by adding `snrs_cl` parameter in the URL in the following ways: - by adding manually the Jinjava insert that retrieves UUID to the link, for example: `https://your.landingpage.com?snrs_cl={{customer.uuid}}` - by inserting the link using `{% preparelink %}YOUR_LANDING_PAGE_URL{% endpreparelink %}` tags which automatically adds the `snrs_cl` parameter to the link. You can read more about customer context in landing pages in ["Establishing customer context" section](/docs/campaign/landing-page/creating-landing-page).
4. **Save** your template. ## Create a workflow --- In this part of the process, you will create the workflow which sends a mobile push. The workflow will be triggered by the `product.AddToCart` event. The delay is defined up to 1 day. If a customer does not make a transaction within one day, we will send a mobile push with link to the abandoned cart landing page with similar product recommendations. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the trigger node At this stage, we will configure the conditions that launch the workflow. As a trigger, we will use the **product.addToCart** event. 1. As the first node of the workflow, add **Profile Event**. In the configuration of the node: 1. From the **Choose event** dropdown menu, choose the **product.addToCart** event. 2. Confirm by clicking **Apply**. ### Configure the Delay node 1. Click **Then** and add the **Delay** node. In the node settings: 1. In the **Delay** field, type `1`. 2. From the dropdown list, choose **Day**. 2. Click **Apply**. ### Define the Profile Filter node --- As the next node, choose **Profile Filter** to check if a customer have made a transaction in the last 24 hours. 1. Click **Then** and add the **Profile Filter** node. In the node settings: 1. From the **Choose filter** dropdown, select the `transaction.charge` event. 3. Set the date range to the last 1440 minutes.
Use 1440 minutes instead of 1 day – use smaller granulation, as in this case 1 day would take the time from current hour till the midnight, so such an analysis would not take into consideration all customers who meet the meet the filter conditions.
2. Click **Apply**. ### Define the Send Mobile Push 1. To the **Not matched** path, add the **Send Mobile Push** node. In the node settings: 1. In the **Mobile push type** section, choose **Simple push**. 2. In the **Content** section, [choose the template you prepared in the previous step](#create-a-mobile-push-notification). 5. In the **Additional parameters** section, you can optionally assign parameters, which will be added to every event generated by this communication. 6. In the **Test** section, you can optionally send a test mobile push. 2. Click **Apply**. ### Add the finishing nodes and set capping 1. Add the **End** nodes after **Send Mobile Push** node and to the **Matched** path after the **Profile Filter** node. 2. In the upper right corner, click **Set Capping** and define the limit of workflows a profile can start: 1. Set **Limit** to 1. 2. Set **Time** to 30 days. 4. Confirm by clicking **Save**. 5. In the upper right corner, click **Save & Run**.
Automation Hub workflow for sending abandoned cart recommendation emails
Workflow configuration
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of every element of this process directly in Synerise Demo workspace: - [Aggregate](https://app.synerise.com/analytics/aggregates/05b3c50d-0a58-3565-9b61-de98d7298446) that returns the list of products from the abandoned cart. - [Similar Recommendation](https://app.synerise.com/ai-v2/recommendations/Qgt7QWHu35ZB) - [Landing page](https://app.synerise.com/campaigns/landing-pages/create/16c3b5f0-49ee-4b2b-87ee-3175d582b138:2024-10-02T11:43:09.806646793/content-manager/template/editor?variant=0) with abandoned cart similar recommendations. - [Workflow](https://app.synerise.com/automations/workflows/automation-diagram/907ad7df-4cbd-45a5-bdb8-2821bb273118) sending a mobile push with the link to the landing page. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 13 events per profile that completes the flow: [`product.addToCart`](/docs/assets/events/event-reference/items#productaddtocart) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`push.send`](/docs/assets/events/event-reference/mobile-push#pushsend) (~1), [`push.view`](/docs/assets/events/event-reference/mobile-push#pushview) (~1), [`push.click`](/docs/assets/events/event-reference/mobile-push#pushclick) (~1), [`landingpage.visit`](/docs/assets/events/event-reference/landing-page#landingpagevisit) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Automation Hub](/docs/automation) - [Landing page](/docs/campaign/landing-page) - [Mobile campaigns](/docs/campaign/Mobile) - [Recommendations](/docs/ai-hub/recommendations-v2) # Welcome Promotion and Instant Bonus for Loyalty Club Members Engaging loyalty program users right after they join is crucial to turn a new signup into an active customer. One effective approach is to assign a welcome promotion right after they join. If they don’t use it within the specific time, you send a reminder email to nudge them. If they do use the promotion, you reward them with a second incentive — an instant bonus, automatically assigned. This automated sequence keeps new users engaged, increases the chance of repeated purchases, and builds stronger loyalty through timely and relevant communication. In this specific use case, we will implement an automated process for managing a welcome promotion and follow-up bonus for loyalty program users. - When a user joins the loyalty program, they are automatically assigned a welcome promotion (20% discount). - The promotion can only be used once. - If the user does not use the promotion in 7 days, they will receive a reminder email. - If the user uses the welcome promotion and made a transaction in 7 days, a new promotion (called instant bonus) is assigned automatically. - If the instant bonus will not be used, one reminder will be sent. ## Prerequisites --- - Add [product Feed](/developers/product-feed). - Implement [transaction events](/developers/web/transactions-sdk). - [Create an email account](/docs/campaign/e-mail/creating-email-campaigns). - [Integrate Synerise promotions](/docs/ai-hub/promotions/introduction-to-promotions) and create first promotions in Synerise. - Implement the [custom event](/developers/mobile-sdk/event-tracking) which sends information to Synerise about joining a loyalty program (for example `client.register`). Such an event should be sent each time the the user will join the loyalty program. ## Process --- In this use case, you will go through the following steps: 1. [Create a welcome promotion segmentation](/use-cases/welcome-promo#create-welcome-promotion-segmentation). 2. [Create an instant bonus promotion segmentation](/use-cases/welcome-promo#create-instant-bonus-promotion-segmentation). 1. [Create a welcome promotion](/use-cases/welcome-promo#create-welcome-promotion) for new members of the loyalty program. 2. [Create instant bonus promotion](/use-cases/welcome-promo#create-instant-bonus-promotion) for loyalty member users who used the welcome promotion in the last 14 days. 5. [Create a workflow](/use-cases/discount-promotion-for-first-transaction#create-a-workflow) to manage the process of sending: - welcome promotions, - reminder if the user does not use the promotion in the specific time, - the bonus for those who used the welcome promotion. ## Create welcome promotion segmentation --- In this part of the process, create a segmentation which will be used as a target of the first welcome promotion. 1. Go to Behavioral Data Hub icon **Decision Hub > Segmentation > New Segmentation**. 2. Enter the name of segmentation. 3. On the canvas, click **Add condition**. 4. From the dropdown list, select the event **client.register**. 7. If we want to set a time limit for the promotion's validity, we can set the time range e.g. last 14 days 9. Click **Save**.
The final configuration of the segmentation
The final configuration of the segmentation
## Create instant bonus promotion segmentation --- In this part of the process, create a segmentation which will be used as a target of the instant bonus promotion. 1. Go to Behavioral Data Hub icon **Decision Hub > Segmentation > New Segmentation**. 2. Enter the name of segmentation. 3. On the canvas, click **Add condition**. 4. From the dropdown list, select the event **client.removePoints**. 5. Choose from the attributes parameter **promotionUuid**. 6. As the value set up the ID of the welcome [promotion](#create-welcome-promotion). 7. If we want to set a time limit for the promotion's validity, we can set the time range e.g. last 14 days 9. Click **Save**. Remember to change the name and choose the unique name of the [promotion](/docs/ai-hub/promotions/creating-promotions) which you will create in the next step, for example, **Instant bonus promotion**.
The final configuration of the segmentation
The final configuration of the segmentation
## Create welcome promotion --- In this part of the process, you create a [promotion](/docs/ai-hub/promotions/creating-promotions) assigned to users immediately after joining the loyalty program. 1. Go to AI Hub icon **AI Hub > Regular Promotions > Add promotion**. 2. Select the **For selected items** option. 3. As the name of the promotion choose the same name as you have added to the [segmentation, created in the previous step](#create-welcome-promotion-segmentation). 3. In the **Audience** section of the promotion, select the segmentation created in [this step](#create-welcome-promotion-segmentation). Your promotion will be activated only for this group of customers, for whom the event with the code of this promotion will be generated. Confirm your selection, by clicking **Apply**. 4. In the **Content** section, define the name, description, and an image of the promotion. Confirm the settings by clicking **Apply**.
Save the promotion code from this section because it will be used later in the workflow.
5. Choose the **Single** type of promotion. 5. In the **Limit per profile** field, enter `1` to make sure that this discount can be used only once. 6. In **Type & limits** section: 1. As **Discount type**, choose **Percentage**. 2. As the value, enter `20`, and click **Apply**. 6. In the **Schedule** section, define the distribution period. 7. In **Items** section, choose the main product catalog with all products a customer can buy with this discount. If you want to narrow down the list of categories a customer can choose from, use one of the options presented below (Selected items/Filtered items). 9. In **Exclude items** section, you can exclude a specific product or categories for which the discount is not active. 10. To apply all changes and run the promotion, click **Publish**. ## Create instant bonus promotion ---- Create an instant bonus promotion for loyalty members who used the welcome promotion within the last 14 days. This promotion will be sent 14 days after the first promotion was sent. 1. Go to AI Hub icon **AI Hub > Regular Promotions > Add promotion**. 2. Select the **For selected items** option. 3. As the name of the promotion choose the same name as you have added to the [segmentation, created in the previous step](#create-instant-bonus-promotion-segmentation). 3. In the **Audience** section of the promotion, select the segmentation created in [this step](#create-instant-bonus-promotion-segmentation). Your promotion will be activated only for this group of customers, for whom the event with the code of this promotion will be generated. Confirm your selection, by clicking **Apply**. 4. In the **Content** section, define the name, description, and an image of the promotion. Confirm the settings by clicking **Apply**.
Save the promotion code from this section because it will be used later in the workflow.
5. Choose the **Single** type of promotion. 5. In the **Limit per profile** field, enter `1` to make sure that this discount can be used only once. 6. In **Type & limits** section: 1. As a Discount type, choose **Percentage**. 2. As the value, enter `10`, and click **Apply**. 6. In the **Schedule** section, define the distribution period. 7. In **Items** section, choose the main product catalog with all products a customer can buy with this discount. If you want to narrow down the list of categories a customer can choose from, use one of the options presented below (Selected items/Filtered items). 9. In **Exclude items** section, you can exclude a specific product or categories for which the discount is not active. 10. To apply all changes and run the promotion, click **Publish**. ## Create a workflow --- Create a workflow to manage the entire process: assigning the welcome promotion, sending a reminder if it’s not used, and assigning the instant bonus. This workflow monitors promotion usage and controls the timing of follow-up communications and actions. ### Profile event node --- 1. Go to **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. 3. As the first node of the workflow, add **Profile event node**, and choose the parameter/event which signifies joining the loyalty program. In our case, it will be the `client.register` event.
Automation Hub workflow for a welcome promotional campaign (first variant)
Workflow configuration
### Add the Send Email node --- 1. Add the **Send Email** node. In the node settings: 1. In the **Sender details** section, choose the email account from which the email will be sent. 2. In the **Content** section, type the **Subject** and from the **Template** dropdown, select or directly create a short welcoming message for a new members in loyalty program. 3. Click **Apply** to save your changes. ### Configure the Event Filter node This node lets a customer check if promotion has been used in the last 7 days. This setting is just an example and can be configured according to your business needs. 1. As the next node, add **Event Filter**. In the configuration of the node: 1. In the **Check** field, from the dropdown menu choose **for period of time**. 2. Set the time range. In our case, it is 1 week. 3. In the **Define conditions** field, from the **Choose event** dropdown menu, choose `client.removePoints` event. 4. As a parameter choose **promotionName** and use the exact name of the promotion crested in the [previous step](#create-welcome-promotion). 2. Confirm by clicking **Apply**.
Event filter configuration
Event Filter configuration
### Send Email node --- 1. Add the **Send Email** node to the **Not matched** path. In the node settings: 1. In the **Sender details** section, choose the email account from which the email will be sent. 2. In the **Content** section, type the **Subject** and from the **Template** dropdown, select or directly create a message with the reminder about promotion. The email will be send only to users with this promotion assigned. 3. Click **Apply** to save your changes. ### Configure the Event Filter node This node lets a customer check if promotion has been used in the last 7 days. 1. As the next node, add **Event Filter**. 2. You can duplicate the exact settings of the [Event Filter node, created earlier](#configure-the-event-filter-node) ## Merge Paths --- To the **Not matched** path from the second **Event filter node** and to the **Matched** path from the first **Event filter node** add **Merged path node**. ### Add Send email node with the instant bonus promotion --- 1. Add the **Send Email** node. In the node settings: 1. In the **Sender details** section, choose the email account from which the email will be sent. 2. In the **Content** section, type the **Subject** and from the **Template** dropdown, select or directly create a message with the link to instant bonus promotion. 3. Click **Apply** to save your changes. 2. Additionally you can add another **Event Filter** to check if the instant bonus result in using the promotion or not. If not - you can send email reminder once again. ### Configure the Event Filter node This node lets a customer check if instant bonus promotion has been used in the last 7 days. 1. As the next node, add **Event Filter**. In the configuration of the node: 1. In the **Check** field, from the dropdown menu choose **for period of time**. 2. Set the time range. In our case, it is 1 week. 3. In the **Define conditions** field, from the **Choose event** dropdown menu, choose `client.removePoints` event. 4. As a parameter choose **promotionName** and use the exact name of the promotion crested in the [previous step](#create-instant-bonus-promotion). 2. Confirm by clicking **Apply**.
Event filter configuration
Event Filter configuration
### Add Send email node with the instant bonus promotion --- 1. Add the **Send Email** node to the **Not matched** path. In the node settings: 1. In the **Sender details** section, choose the email account from which the email will be sent. 2. In the **Content** section, type the **Subject** and from the **Template** dropdown, select or directly create a message with the link to instant bonus promotion. 3. Click **Apply** to save your changes. 2. Additionally you can add another **Event Filter** to check if the instant bonus result in using the promotion or not. If not - you can send email reminder once again. ### Final settings --- 7. Set the capping for the workflow to make sure that entrance to the process will be available once for every user (choose very distant date for example, once in 1000 months). 7. Confirm the settings by clicking **Apply**. 7. Add the **End** node to finish the workflow. 8. Click **Save & Run**.
Automation Hub workflow for a welcome promotional campaign (second variant)
Workflow configuration
## Check the use case set up on the Synerise Demo workspace --- In the Synerise Demo workspace, you can check: - [Segmentation for welcome message](https://app.synerise.com/analytics-v2/segmentations/f6d38a7e-fae6-430d-a439-e0bce4e0f66f) - [Segmentation for instant bonus](https://app.synerise.com/analytics-v2/segmentations/8cf011f4-8237-4b0a-a50b-ef4985938f56) - [Promotion with welcome message](https://app.synerise.com/campaigns/promotions/b823b86a-5ea9-4234-bfa5-10d9f5885b1b) - [Promotion with instant bonus](https://app.synerise.com/campaigns/promotions/79f50e74-622e-496b-bd2f-821002779dee) - [Workflow](https://app.synerise.com/automations/workflows/automation-diagram/412fa7df-338e-4f13-aa33-f75d827cc8d5) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 24 events per profile that completes the flow: [`client.register`](/docs/assets/events/event-reference/profiles#clientregister) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~5), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~2), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~2), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~2), [`client.activatePromotion`](/docs/assets/events/event-reference/loyalty#clientactivatepromotion) (~2), [`client.removePoints`](/docs/assets/events/event-reference/loyalty#clientremovepoints) (~2), [`transaction.charge`](/docs/assets/events/event-reference/items#transactioncharge) (~2), [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~4). ## Read more --- - [Creating promotions](/docs/ai-hub/promotions) - [Loyalty programs basics](/use-cases/loyalty-programs-basics) - [Workflow](/docs/automation/creating-automation) # Change date format for analytics It may happen that your implementation sends additional date information, such as the date of first time an app was launched, in the custom attributes of customers. If that date has a different format than the one required by Decision Hub, you can use Expressions to transform it. The example in this article explains how to transform a date in `dd.mm.yyyy` format into a timestamp that can be used in Decision Hub. In the custom attributes of the customer profile, the parameter that stores the date is called `app_first_started`. If you're an advanced user, you can modify the regular expressions in the article to work with different formats of dates in the parameter. ## Prerequisites --- - Implementation of [tracking code](/developers/web/installation-and-configuration#creating-a-tracking-code) on your website. - The attribute with the date (in this example, it's `app_first_started`) must be defined. This can be done in one of the following ways: - [Add the attribute in **Profile attributes**](/docs/crm/customer-properties#adding-profile-attributes-in-the-synerise-portal). - Create or update a customer with the attribute (using the API or SDK). ## Process --- The process consists of three stages: 1. [Create expressions to extract elements of the date](#create-expressions-to-extract-elements-of-the-date). 2. [Create an expression to re-arrange the elements of the date into a format that can be converted into a timestamp](#create-an-expression-to-re-arrange-the-elements-of-the-date). 3. [Convert the date into a timestamp](#convert-into-a-timestamp).
Due to event data retention, such attributes should be stored permanently in a customer's profile, not in event data.
In the course of this procedure, you can use the **Show in profile card** toggle in each expression to preview the results in a test customer's profile.
## Create expressions to extract elements of the date --- Three separate expressions are used to extract the day, month, and year. The only difference between them is the regular expression used. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. From the **Expressions for** dropdown list, select **Attribute**. 3. In the **Formula definition** section, click **Select**. 4. From the list that opens, select **Function > Regexp**. 5. In the brackets, click the left **Select** button and from the list, select **Profile**. 7. Click the **unnamed** node that appeared. 8. At the bottom of the page, click **Choose attribute**. 9. In the list of attributes, find and select `app_first_started` (you can use the search field). 10. In the brackets, click the right **Select** button and from the list, select **Constant**. 11. Click the **0** node that appeared. 12. At the bottom of the page, in the input field, paste the regular expression that extracts the day: `(?<=^)(\d*?)(?=\.)` 13. Above the formula creator, enter a meaningful name for the expression.
Expression to extract the day from a date
Expression to extract the day from a date in dd.mm.yyyy format
14. In the upper-right corner, click **Save**. 15. In the upper-right corner, click **Publish**. 16. Create the month and year expression by performing the following steps twice: 1. Return to the list of expressions and locate the expression you created. 2. To the right, click the Three-dot icon icon and select **Duplicate**. 3. Click the duplicated expression to open it for editing. 4. Change the name of the expression. 5. In the **Formula definition** section, click the node with the regular expression. 6. Change the regular expression to: - For month: `(?<=\.)(\d*?)(?=\.)` - For year: `(?<=\.)(\d*?)(?=$)` 7. Click **Publish**. ## Create an expression to re-arrange the elements of the date --- In this stage, you create an expression that concatenates (joins) the results of the three expressions above into a single string in `yyyy/mm/dd` format. This format can later be converted into a timestamp. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. Create the following attribute expression:
Expression to concatenate the elements of a date
Expression to concatenate the elements of a date
**Explanation**: - **Concat** is a function. - Expression results (green nodes) are treated and inserted like customer attributes. - `/` is a constant. The expression takes three strings (year, month, day) that are the results of the expressions you created before and joins them into one string with `/` as the separator. 3. Click **Save**. 4. Click **Publish**. ## Convert into a timestamp --- In this stage, convert the `yyyy/mm/dd` date into an Analytics-compatible timestamp. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. Create the following expression:
Expression that converts yyyy/mm/dd into a timestamp
Expression that converts yyyy/mm/dd into a timestamp
**Explanation:** - **To timestamp** is a function. - Expression results are treated and inserted like customer attributes. 3. Click **Save**. 4. Click **Publish**. ## What's next --- You can now use the result of the last expression (called "Timestamp from yyyy/mm/dd" in this example) as a timestamp in analytics, for example to create a segmentation of customers who first started the app after a certain date or to find the transactions that a customer made before they first started the application. If you enabled the **Show in profile card** toggles, the expression results are visible in the right panel of a customer card in **Profiles**:
Expression results in a customer profile
Expression results in a customer profile
## Check the use case set up on the Synerise Demo workspace --- You can find five expressions created in this use case in our Synerise Demo workspace at the links listed below: - [expression used to extract the day](https://app.synerise.com/analytics/expressions/4b67b443-c5bd-4637-9f52-a05b5d77ca33) - [expression used to extract the month](https://app.synerise.com/analytics/expressions/f2e2409c-3dff-4205-89b6-5d0525b31e64) - [expression used to extract the year](https://app.synerise.com/analytics/expressions/257b0362-a181-4d21-bfe7-82a8f89ba513) - [expression to re-arrange the elements of the date](https://app.synerise.com/analytics/expressions/3f330b8a-7d11-4ab9-88c4-946a3c3d83b8) - [expression for timestamp from yyyy/mm/dd](https://app.synerise.com/analytics/expressions/25677e70-e82f-4932-8329-1883fb00fe3d) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case does not generate any events. ## Read more --- - [Expressions](/docs/crm/expressions) # Send a segmentation of customers with the highest propensity to buy to Amazon S3 Synerise allows you to collect data from any touchpoint with a customer. With advanced Synerise Decision Hub, you can create precise customer segments that you can use not only in Synerise, but also pass them to external tools. Using Synerise's seamless integration with Amazon S3, you can transfer any data collected in Synerise and use it in other Amazon services. In this use case, we will export a database of customers with the highest propensity to buy to Amazon S3. The process of creating a Propensity prediction and segmentation is already described in [this use case](/use-cases/propensity_based_promotion). The segmentation used in this use case is only an example. You can export any other segmentation or different data types as needed, such as transactions, event data, metrics results, aggregates, expressions, reports, and more. ## Prerequisites --- - You must have an account on AWS. - Create propensity prediction and segmentation with customers with the highest propensity to buy selected product category based on [this use case](/use-cases/propensity_based_promotion). ## Create a workflow --- Create a workflow which sends the customers' data to Amazon S3 every day. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the launch date 3. As the trigger node, add **Scheduled Run**. 4. In the configuration of the node: 1. Leave the **Run trigger** option at default (**all time**). 2. From the **Timezone** dropdown list, select the time zone consistent with the timezone selected for your workspace. 3. Define the frequency of the workflow (for example, every day at 6.00 A.M.). The workflow will automatically launch at the scheduled time. 4. Confirm by clicking **Apply**.
Automation Hub Scheduled Run node configuration for triggering file export to Amazon S3
The configuration of the Scheduled Run node
### Select customers to export 5. Add a **Get Profiles** node. 6. In the configuration of the node: 1. Select the segmentation you created earlier. 2. In the **Attributes** section, select the profile attributes which you want to export. In the example, `email`, `newsletter_agreement`, `firstName` and `lastName` are selected. 3. Confirm by clicking **Apply**. ### Configure Send file to Amazon S3 Bucket node 1. Click **Amazon S3 Bucket > Send File**. 2. Click **Select connection**. 3. From the dropdown list, select the connection. - If no connections are available or you want to create a new one, see [Create a connection](/docs/automation/integration/amazon-s3-bucket/send-file-amazon-s3-bucket#create-a-connection). - If you selected an existing connection, proceed with the integration settings. 4. In the **Region** field, enter the region of your bucket. 5. In the **Bucket** field, enter the name of an existing container in your storage. 6. In the **Path to directory** field, enter the path to the existing bucket in which the file will be saved. 7. In the **File name** field, enter the name of the file you want to send to the storage. If the file already exists, the contents of the file will be overwritten. 8. From the **File format** dropdown list, select the format in which the file will be saved in the storage. 9. Confirm by clicking **Apply**.
The configuration of the Send file to Amazon S3 Bucket node
The configuration of the Send File node
### Add the finishing node 12. Add the **End** node. 13. In the upper right corner, click **Save & Run**.
Automation Hub workflow for sending a file to Amazon S3
The workflow configuration
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of the [workflow](https://app.synerise.com/automations/automation-diagram/1a6f82da-b364-4d5a-aebb-e7c411783daf) created in this use case on our Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 4 events per workflow execution: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~2), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1). ## Read more --- - [Send File (Amazon S3 Bucket)](/docs/automation/integration/amazon-s3-bucket/send-file-amazon-s3-bucket) - [Workflows](/docs/automation) # User Intelligence Panel with real-time profile data in an in-app message Customers expect personalized, data-driven experiences that reflect their real activity and status. Instead of building separate dashboards or static profile pages, you can use [Brickworks](/docs/assets/brickworks) to create a single, structured data model that dynamically assembles customer profile information and serves it directly inside an in-app message. In this use case, you will build a **User Intelligence Panel** — a self-updating profile view displayed as an in-app message in a mobile application. The panel aggregates the following data for each customer in real time: - First name - Loyalty level (derived from an expression based on loyalty points thresholds) - Total transaction value - Total loyalty points (earned minus expired) - Number of transactions - Top visited product categories - Active promotions assigned to the customer (fetched dynamically via an External Source) - Historical transaction list with product names, amounts, dates, and loyalty points earned Each customer sees a personalized version of the panel based on their own behavioral and transactional data. Every new purchase or interaction automatically updates what is displayed. This approach eliminates the need for custom frontend-backend integrations by leveraging Brickworks as the single source of truth for the profile UI.
User Intelligence Panel in-app message example
## Prerequisites --- - [Implement Synerise SDK in your mobile app](/developers/mobile-sdk). - Implement the [transaction events](/developers/web/transactions-sdk) using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). - Implement [tracking code](/developers/web/installation-and-configuration) on your website. - Have a loyalty program configured in Synerise with loyalty points earning and expiration logic, including the `points.loyalty` event. Check this [use case](/use-cases/rolling-points-expiration) - Have [promotions](/docs/ai-hub/promotions) configured and assigned to customers. - [Create API keys](/docs/settings/tool/api#adding-api-keys) with permissions required for the Promotions API (used in the External Source configuration for the Brickworks schema). ## Process --- In this use case, you will go through the following steps: 1. [Create aggregates for loyalty points](#create-aggregates-for-loyalty-points) to compute earned and expired points. 2. [Create aggregates for transaction and behavioral data](#create-aggregates-for-transaction-and-behavioral-data). 3. [Create expressions](#create-expressions) to compute loyalty points balance and loyalty level. 4. [Create segmentations for loyalty tiers](#create-segmentations-for-loyalty-tiers) that define thresholds for each loyalty level. 5. [Create additional aggregates for transaction history](#create-aggregates-for-transaction-history) to power the transaction list in the panel. 6. [Create a Brickworks schema](#create-a-brickworks-schema) that defines the data structure. 7. [Create a record](#create-the-record) that binds schema fields to actual data sources. 8. [Create an in-app campaign](#create-an-in-app-campaign) that renders the panel using the Brickworks schema. ## Create aggregates for loyalty points --- In this part of the process, you will create two aggregates based on the `points.loyalty` event. These aggregates are later used in the expression that calculates the customer's net loyalty points balance, and in segmentations that determine the loyalty tier. ### Aggregate for earned loyalty points sum --- This aggregate sums all loyalty points ever earned by the customer. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 3. Enter the name of the aggregate, for example `[UC] loyalty points sum`. 4. Click **Analyze profiles by** and select **Sum**. 5. From the **Choose event** dropdown list, select the `points.loyalty` event. 6. As the event parameter, select `points`. 7. Define the period to **Lifetime**. 8. Save the aggregate.
Configuration of the earned loyalty points sum aggregate
Configuration of the earned loyalty points sum aggregate
### Aggregate for expired loyalty points --- This aggregate sums only the loyalty points that have expired. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 3. Enter the name of the aggregate, for example `[UC] expired loyalty points`. 4. Click **Analyze profiles by** and select **Sum**. 5. From the **Choose event** dropdown list, select the `points.loyalty` event. 6. As the event parameter, select `points`. 7. Click the **+ where** button and add the condition: `$source` **Equal** `expiration`. 8. Define the period to **Lifetime**. 9. Save the aggregate.
Configuration of the expired loyalty points aggregate
Configuration of the expired loyalty points aggregate
## Create aggregates for transaction and behavioral data --- In this part of the process, you will create aggregates that supply transaction and browsing data to the Brickworks schema fields. ### Aggregate for sum of transactions --- This aggregate calculates the total monetary value of all customer transactions. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 3. Enter the name of the aggregate, for example `[UC] Sum of transactions`. 4. Click **Analyze profiles by** and select **Sum**. 5. From the **Choose event** dropdown list, select the `transaction.charge` event. 6. As the event parameter, select `$totalAmount`. 7. Define the period to **Lifetime**. 8. Save the aggregate.
Configuration of the sum of transactions aggregate
Configuration of the sum of transactions aggregate
### Aggregate for number of transactions --- This aggregate counts the total number of transactions for each customer. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 3. Enter the name of the aggregate, for example `[UC] Number of transactions`. 4. Click **Analyze profiles by** and select **Count**. 5. From the **Choose event** dropdown list, select the `transaction.charge` event. 6. Define the period to **Lifetime**. 7. Save the aggregate.
Configuration of the number of transactions aggregate
Configuration of the number of transactions aggregate
### Aggregate for top 5 visited categories --- This aggregate returns the most frequently visited product categories for each customer. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 3. Enter the name of the aggregate, for example `[UC] Top 5 visited categories`. 4. Click **Analyze profiles by** and select **Top Multi**. 5. From the **Choose event** dropdown list, select the `page.visit` event. 6. As the event parameter, select `product:category`. 7. Click the **+ where** button and add the condition that `product:category` **is not null**. 8. In the **Size** field, enter `5`. 9. Define the period to the **Last 30 days**. 10. Save the aggregate.
Configuration of the top 5 visited categories aggregate
Configuration of the top 5 visited categories aggregate
## Create expressions --- In this part of the process, you will create expressions that compute derived values used in the Brickworks schema. ### Expression for loyalty points --- This expression calculates the customer's current net loyalty points balance by subtracting expired points from the total earned points. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. Enter the name of the expression, for example `[UC] Loyalty points`. 3. Set **Expressions for** to **Attribute**. 4. Enable **Show in profile card** if you want the result visible on customer profiles. 5. In the **Formula definition**, define the formula as: - `earned loyalty points sum` **minus** `expired loyalty points` where the first operand references the `[UC] loyalty points sum` aggregate and the second references the `[UC] expired loyalty points` aggregate, both created in the [previous step](#create-aggregates-for-loyalty-points). 6. Click **Publish**.
Configuration of the Loyalty points expression
Configuration of the Loyalty points expression
### Expression for loyalty level --- This will expression determine the customer's loyalty tier based on the segmentations. #### Create segmentations for loyalty tiers --- In this part of the process, you will create segmentations that define the loyalty point thresholds for each tier. The loyalty tiers in this example are based on the following point thresholds: | Tier | Condition | |---|---| | Base | Loyalty points sum ≤ 1 | | Silver | Loyalty points sum > 1 AND < 4,000 | | Gold | Loyalty points sum ≥ 4,000 AND < 10,000 | | Premium | Loyalty points sum ≥ 10,000 | ##### Segmentation for Gold loyalty level --- This example shows how to configure a loyalty tier segmentation. The remaining tiers follow the same pattern with different thresholds. 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of the segmentation, for example `[UC] Loyalty level - Gold`. 3. Name the segment `Gold`. 4. Click **Add condition**. 5. From the dropdown list, select **Has property**. 6. Choose the `[UC] loyalty points sum` expression. 7. From the **Choose operator** dropdown, select **Less than** and enter the value `10 000`. 8. Click **Add condition**. 9. Again select **Has property** and choose the `[UC] loyalty points sum` expression. 10. From the **Choose operator** dropdown, select **More than** and enter the value `4 000`. 11. Connect these conditions with the **And** operator. 12. Save the segmentation.
Configuration of the Gold loyalty level segmentation
Configuration of the Gold loyalty level segmentation
##### Remaining loyalty tier segmentations --- Create the remaining segmentations following the same approach as above, adjusting the thresholds: - **[UC] Loyalty level - Silver**: `[UC] loyalty points sum` **More than** `1` **AND** `[UC] loyalty points sum` **Less than** `4 000`.
Configuration of the Silver loyalty level segmentation
Configuration of the Silver loyalty level segmentation
- **[UC] Loyalty level - Premium**: `[UC] loyalty points sum` **More or equal to** `10 000`.
Configuration of the Premium loyalty level segmentation
Configuration of the Premium loyalty level segmentation
- **[UC] Loyalty level - Base**: `[UC] loyalty points sum` **Less or equal to** `1`.
Configuration of the Base loyalty level segmentation
Configuration of the Base loyalty level segmentation
#### Create Expression with Loyalty Tiers For this expression use segmentation created in the [previous step](#create-segmentations-for-loyalty-tiers). 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. Enter the name of the expression, for example `[UC] Loyalty level`. 3. Set **Expressions for** to **Attribute**. 4. Enable **Show in profile card** if desired. 5. In the **Formula definition**, build a conditional formula using the following logic: - If `[UC] Loyalty level - Base` → return `Base member` - If `[UC] Loyalty level - Silver` → return `Silver member` - If `[UC] Loyalty level - Gold` → return `Gold member` - If `[UC] Loyalty level - Premium` → return `Premium member` - Otherwise → return `null` Each condition references the corresponding segmentation created in the [next step](#create-segmentations-for-loyalty-tiers). 6. Click **Publish**.
Configuration of the Loyalty level expression
Configuration of the Loyalty level expression
## Create aggregates for transaction history --- The transaction history section of the panel requires six additional aggregates that are referenced inside a Jinjava code field in the Brickworks schema. Each aggregate collects a specific dimension of transaction data so it can be combined into a structured JSON list. ### Aggregate for transaction IDs --- Collects the order IDs of the customer's transactions. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 3. Enter the name of the aggregate, for example `[UC] Transaction IDs`. 4. Click **Analyze profiles by** and select **Last Multi**. 5. From the **Choose event** dropdown list, select the `transaction.charge` event. 6. As the event parameter, select `$orderId`. 7. In the **Size** field, enter `25`. 8. Define the period to **Lifetime**. 9. Save the aggregate.
Configuration of the transaction IDs aggregate
Configuration of the transaction IDs aggregate
### Aggregate for transaction loyalty points --- Collects the loyalty points associated with each transaction. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 3. Enter the name of the aggregate, for example `[UC] Transaction loyalty points`. 4. Click **Analyze profiles by** and select **Last Multi**. 5. From the **Choose event** dropdown list, select the `points.loyalty` event. 6. As the event parameter, select `points`. 7. Click the **+ where** button and add the condition: `$revenue` **Is not null**. 8. In the **Size** field, enter `25`. 9. Define the period to **Lifetime**. 10. Save the aggregate.
Configuration of the transaction loyalty points aggregate
Configuration of the transaction loyalty points aggregate
### Aggregate for transaction amounts --- Collects the monetary amount of each transaction. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 3. Enter the name of the aggregate, for example `[UC] Transaction amounts`. 4. Click **Analyze profiles by** and select **Last Multi**. 5. From the **Choose event** dropdown list, select the `transaction.charge` event. 6. As the event parameter, select `$totalAmount`. 7. In the **Size** field, enter `25`. 8. Define the period to **Lifetime**. 9. Save the aggregate.
Configuration of the transaction amounts aggregate
Configuration of the transaction amounts aggregate
### Aggregate for transaction dates --- Collects the timestamps of each transaction. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 3. Enter the name of the aggregate, for example `[UC] Transaction dates`. 4. Click **Analyze profiles by** and select **Last Multi**. 5. From the **Choose event** dropdown list, select the `transaction.charge` event. 6. As the event parameter, select `TIMESTAMP`. 7. In the **Size** field, enter `25`. 8. Define the period to **Lifetime**. 9. Save the aggregate.
Configuration of the transaction dates aggregate
Configuration of the transaction dates aggregate
### Aggregate for product names from transactions --- Collects the product names from individual bought items. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 3. Enter the name of the aggregate, for example `[UC] Transaction product names`. 4. Click **Analyze profiles by** and select **Last Multi**. 5. From the **Choose event** dropdown list, select the `product.buy` event. 6. As the event parameter, select `$name`. 7. In the **Size** field, enter `1 000`. 8. Define the period to **Lifetime**. 9. Save the aggregate.
Configuration of the transaction product names aggregate
Configuration of the transaction product names aggregate
### Aggregate for order IDs from product buy events --- Collects the order IDs associated with each product buy event, so products can be grouped by transaction. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 3. Enter the name of the aggregate, for example `[UC] Product buy order IDs`. 4. Click **Analyze profiles by** and select **Last Multi**. 5. From the **Choose event** dropdown list, select the `product.buy` event. 6. As the event parameter, select `$orderId`. 7. In the **Size** field, enter `1 000`. 8. Define the period to **Lifetime**. 9. Save the aggregate.
Configuration of the product buy order IDs aggregate
Configuration of the product buy order IDs aggregate
## Create a Brickworks schema --- In this part of the process, you will create a [Brickworks](/docs/assets/brickworks) Simple schema that defines the structure of the User Intelligence Panel. The schema specifies the field names, types, and configuration options. The actual binding of fields to data sources (expressions, aggregates, profile attributes) happens at the [record level](#create-the-record), where values are resolved via API at generation time for the requesting customer.
Use a **Simple Schema**. Simple schemas support [External Sources](/docs/assets/brickworks/quick-start/creating-a-schema) fields (such as the Promotion list), which is required for dynamically fetching promotion data in the in-app context.
1. Go to **Data Modeling Hub > Brickworks > New schema**. 2. Choose **Simple Schema**. 3. Enter the **Display name**, for example `User Intelligence Panel`. 4. Optionally, add a description. ### Add First name field --- 1. Click **Add new field** and choose the appropriate field type. 2. In the **Field basics** section, complete the fields: - **Display name**: `First name` - **API name**: `firstName` 3. In the **Configuration** section, enable the **Return null when object is missing** checkbox. 4. In the **Validation** section, enable the **Required field** checkbox. 5. Click **Apply**.
Configuration of the First name field in the Brickworks schema
Configuration of the First name field in the Brickworks schema
### Add Loyalty level field --- 1. Click **Add new field** and choose the appropriate field type. 2. In the **Field basics** section, complete the fields: - **Display name**: `Loyalty level` - **API name**: `loyaltyLevel` 3. In the **Configuration** section, enable the **Return null when object is missing** checkbox. 4. In the **Validation** section, enable the **Required field** checkbox. 5. Click **Apply**.
Configuration of the Loyalty level field in the Brickworks schema
Configuration of the Loyalty level field in the Brickworks schema
### Add Transaction total field --- 1. Click **Add new field** and choose the appropriate field type. 2. In the **Field basics** section, complete the fields: - **Display name**: `Transaction total` - **API name**: `transactionTotal` 3. In the **Configuration** section, enable the **Return null when object is missing** checkbox. 4. In the **Validation** section, enable the **Required field** checkbox. 5. Click **Apply**.
Configuration of the Transaction total field in the Brickworks schema
Configuration of the Transaction total field in the Brickworks schema
### Add Loyalty points total field --- 1. Click **Add new field** and choose the appropriate field type. 2. In the **Field basics** section, complete the fields: - **Display name**: `Loyalty points total` - **API name**: `loyaltyPointsTotal` 3. In the **Configuration** section, enable the **Return null when object is missing** checkbox. 4. In the **Validation** section, enable the **Required field** checkbox. 5. Click **Apply**.
Configuration of the Loyalty points total field in the Brickworks schema
Configuration of the Loyalty points total field in the Brickworks schema
### Add Number of transactions field --- 1. Click **Add new field** and choose the appropriate field type. 2. In the **Field basics** section, complete the fields: - **Display name**: `Number of transactions` - **API name**: `numberOfTransactions` 3. In the **Configuration** section, enable the **Return null when object is missing** checkbox. 4. In the **Validation** section, enable the **Required field** checkbox. 5. Click **Apply**.
Configuration of the Number of transactions field in the Brickworks schema
Configuration of the Number of transactions field in the Brickworks schema
### Add Top visited categories field --- 1. Click **Add new field** and choose the appropriate field type. 2. In the **Field basics** section, complete the fields: - **Display name**: `Top visited categories` - **API name**: `topVisitedCategories` 3. In the **Configuration** section, enable the **Return null when object is missing** checkbox. 4. In the **Validation** section, enable the **Required field** checkbox. 5. Click **Apply**.
Configuration of the Top visited categories field in the Brickworks schema
Configuration of the Top visited categories field in the Brickworks schema
### Add Promotions field --- This field uses the [External Source](/docs/assets/brickworks/quick-start/creating-a-schema) type to dynamically fetch the customer's active promotions from the Synerise Promotions API. Unlike other fields in the schema which only define a name and configuration, this field includes a data source configuration directly — it specifies an HTTP request that will be executed at generation time to retrieve the current list of promotions assigned to the customer. 1. Click **Add new field** and choose **External Data** > **Promotion list**. 2. In the **Field basics** section, complete the fields: - **Display name**: `Promotions` - **API name**: `promotions` 3. In the **Configuration** section, the field is preconfigured as a **Promotion list**. The **Preview cURL** section shows the HTTP request that will be sent: ``` curl -X GET "https://api.synerise.com/v4/promotions/v2/promotion/get-for-client/clientId/{{customer.id}}?status=ACTIVE,ASSIGNED&fields=code,name,expireAt,discountType,discountValue,uuid,description" \ -H "Authorization: Basic USERNAME:PASSWORD" ``` 4. Click **Apply**.
Configuration of the Promotions field in the Brickworks schema
Configuration of the Promotions field in the Brickworks schema
### Add Transaction data field --- This field uses **Jinjava code** that is executed at generation time. Inside the Jinjava code, six aggregates created in the [transaction history step](#create-aggregates-for-transaction-history) are called directly by their hashes using the `{% aggregate HASH %}` syntax. These aggregates are **not** configured as separate fields in the schema — they exist only inside this Jinjava code, which combines their results into a single structured JSON output. 1. Click **Add new field** and choose **Jinjava code**. 2. In the **Field basics** section, complete the fields: - **Display name**: `Transaction data` - **API name**: `transactionData` 3. In the **Configuration** section: 1. Enable the **Cast to** toggle and select **JSON Object** as the type. 4. In the **Validation** section, enable the **Required field** checkbox. 5. In the **Jinjava code** editor, paste the following code. Replace the aggregate hashes with the hashes of the aggregates you created in the [transaction history step](#create-aggregates-for-transaction-history):
{% set txn_ids = [] %}{% set txn_points = [] %}{% set txn_amounts = [] %}{% set txn_dates = [] %}{% set buy_names = [] %}{% set buy_order_ids = [] %}{% aggregate TRANSACTION_IDS_AGGREGATE_HASH %}{%- for res in aggregate_result -%}{% do txn_ids.append(res) %}{%- endfor -%}{% endaggregate %}{% aggregate TRANSACTION_POINTS_AGGREGATE_HASH %}{%- for res in aggregate_result -%}{% do txn_points.append(res) %}{%- endfor -%}{% endaggregate %}{% aggregate TRANSACTION_AMOUNTS_AGGREGATE_HASH %}{%- for res in aggregate_result -%}{% do txn_amounts.append(res) %}{%- endfor -%}{% endaggregate %}{% aggregate TRANSACTION_DATES_AGGREGATE_HASH %}{%- for res in aggregate_result -%}{% set splitDate = res|split(':') %}{% set splitDateLength = splitDate|length %}{% set finalDate = splitDate[0:splitDateLength-1]|join(':') ~ splitDate[splitDateLength-1] %}{% set finalDateFormatted = datetimeformat(finalDate|strtotime("yyyy-MM-dd'T'HH:mm:ss.SSSZ"), '%b %d, %Y') %}{% do txn_dates.append(finalDateFormatted) %}{%- endfor -%}{% endaggregate %}{% aggregate PRODUCT_NAMES_AGGREGATE_HASH %}{%- for res in aggregate_result -%}{% do buy_names.append(res) %}{%- endfor -%}{% endaggregate %}{% aggregate PRODUCT_ORDER_IDS_AGGREGATE_HASH %}{%- for res in aggregate_result -%}{% do buy_order_ids.append(res) %}{%- endfor -%}{% endaggregate %}{% set orders = [] %}{% for i in range(txn_ids | length) %}{% set order_id = txn_ids[i] %}{% set products = [] %}{% for j in range(buy_order_ids | length) %}{% if buy_order_ids[j] == order_id %}{% set _ = products.append(buy_names[j]) %}{% endif %}{% endfor %}{% set _ = orders.append({'orderId': order_id,'date': txn_dates[i],'amount': txn_amounts[i],'loyaltyPoints': txn_points[i],'products': products}) %}{% endfor %}{{ orders | reverse | tojson }}
This Jinjava code collects data from six aggregates (transaction IDs, loyalty points per transaction, transaction amounts, transaction dates, product names, and product order IDs), then combines them into a JSON array of order objects. Each order object contains the order ID, formatted date, total amount, loyalty points earned, and a list of product names. The result is reversed so the most recent transactions appear first.
6. Click **Apply**.
Configuration of the Transaction data field in the Brickworks schema
Configuration of the Transaction data field in the Brickworks schema
### Overview of the complete schema --- After adding all fields, the schema should contain the following fields:
Overview of all fields in the User Intelligence Panel Brickworks schema
Overview of all fields in the User Intelligence Panel Brickworks schema
### Set up the Audience & Settings --- 1. Click the **Audience & Settings** tab. 2. In the **Audience** section, click **Define**. 3. Choose **Everyone**. 4. Click **Apply**. 5. In the upper-right corner, click **Save**. ## Create the record --- [Creating a record](/docs/assets/brickworks/quick-start/creating-a-record) means filling the schema structure with actual data source bindings. In a Simple schema, the record is where you assign concrete expressions, aggregates, and profile attributes to the fields defined in the schema. When the in-app message is displayed, the Brickworks engine uses the record configuration to resolve all field values via API in real time for the requesting customer. 1. Go to **Data Modeling Hub > Data collections > Select schema**. 2. Choose the [schema created in the previous step](#create-a-brickworks-schema). 3. Click **Add record**. 4. Add a name for the record, for example `User Intelligence Panel`. 5. Add a slug for the record. Slug is a unique, URL-friendly version of the name containing only lowercase letters, numbers, and hyphens. For example: `user-intelligence-panel`. 6. Fill in the field values by assigning the appropriate data sources to each field: - **First name** → select the `firstname` profile attribute - **Loyalty level** → select the [`[UC] Loyalty level` expression](#expression-for-loyalty-level) - **Transaction total** → select the [`[UC] Sum of transactions` expression](#aggregate-for-sum-of-transactions) - **Loyalty points total** → select the [`[UC] Loyalty points` expression](#expression-for-loyalty-points) - **Number of transactions** → select the [`[UC] Number of transactions` expression](#aggregate-for-number-of-transactions) - **Top visited categories** → select the [`[UC] Top 5 visited categories` aggregate](#aggregate-for-top-5-visited-categories) - **Promotions** → pre-configured via External Source (Promotion list) at the [schema level](#add-promotions-field) - **Transaction data** → pre-configured via Jinjava code at the [schema level](#add-transaction-data-field) 7. Click **Publish** to publish your record.
After publishing the record, note the **schema ID** and **record ID** from the URL. You will need these IDs in the in-app template code to reference the Brickworks data via the `{% brickworksgeneratevar %}` tag.
## Create an in-app campaign --- In this part of the process, you will create an [in-app campaign](/docs/campaign/in-app-messages/create-inapp-message) that renders the User Intelligence Panel using data from the Brickworks schema. 1. Go to Experience Hub icon **Experience Hub > In-app messages > Create in-app**. 2. Enter the name of the in-app message. ### Define the audience --- 1. In the **Audience** section, click **Define**. 2. Click **Everyone** (or define a specific segment according to your needs). 3. Click **Apply**. ### Define content --- 1. In the **Content** section, click **Define**. 2. Click **Create message**. 3. In the code editor, paste the in-app template code provided below. The template uses the `{% brickworksgeneratevar %}` tag to fetch all schema fields for the current customer and renders the profile panel with sections for stats, top interests, dynamically loaded promotions, and past transactions.
{% brickworksgeneratevar schemaId=SCHEMA_ID recordId=RECORD_ID %}
     <div class="profile-container">
       <button id="close-btn" onclick="SRInApp.close()">&times;</button>
       <div class="profile-header">
         <div class="avatar">{{ brickworks_result.firstName|default('P')|truncate(1, true, '') }}</div>
         <div class="header-info">
           <h1 class="user-name">{{ brickworks_result.firstName|default('Profile') }}</h1>
           <span class="member-badge {{ brickworks_result.loyaltyLevel | lower | replace(' ', '-') }}">{{ brickworks_result.loyaltyLevel }}</span> 
         </div>
       </div>
       <div class="stats-row">
         <div class="stat-card">
           <div class="stat-icon">&#128176;</div>
           <div class="stat-value">${{ brickworks_result.transactionTotal|default('0') }}</div>
           <div class="stat-label">Total Spent</div>
         </div>
         <div class="stat-card highlight">
           <div class="stat-icon">&#127942;</div>
           <div class="stat-value">{{ brickworks_result.loyaltyPointsTotal|default('0') }}</div>
           <div class="stat-label">Loyalty Points</div>
         </div>
         <div class="stat-card">
           <div class="stat-icon">&#128717;</div>
           <div class="stat-value">{{ brickworks_result.numberOfTransactions|default('0') }}</div>
           <div class="stat-label">Transactions</div>
         </div>
       </div>
       {% set topVisitedCategories = brickworks_result.topVisitedCategories %}
       <div class="section-card">
         <div class="section-title">&#128293; Top Interest</div>
         <div class="interest-bar">
           {%- if topVisitedCategories|length > 0 -%}
           {%- for category in topVisitedCategories -%}
             {% set splitCategory = category[0]|split('Default Category > ') %}
             <div class="interest-item">
               <span class="interest-label">{{ splitCategory[1] }}</span>
             </div>
           {%- endfor -%}
           {%- else -%}
           <p class="empty-message">Browse our products to see your interests</p>
           {%- endif -%}
         </div>
       </div>
       <div class="section-card">
         <div class="section-title">&#127873; Active Promotions</div>
         <div class="promo-list">
           {%- if brickworks_result.promotions.data|length > 0 -%}
           {%- for promo in brickworks_result.promotions.data -%}
             <div class="promo-item">
               <div class="promo-badge">{%- if promo.discountType != "NONE" -%}{{ promo.discountValue }}{%- endif -%}{%- if promo.discountType == "PERCENT" -%}% OFF{%- elif promo.discountType == "AMOUNT" -%}$ OFF{%- else -%}PROMO{%- endif -%}</div>
               <div class="promo-info">
                 <div class="promo-name">{{ promo.name }}</div>
                 <div class="promo-exp">{{ promo.description|truncate(35) }}</div>
               </div>
             </div>
           {%- endfor -%}
           {%- else -%}
           <p class="empty-message">There are no promotions available for you</p>
           {%- endif -%}
         </div>
       </div>
       <div class="section-card">
         <div class="section-title">&#128203; Past Transactions</div>
         <div class="transactions-list">
           {%- if brickworks_result.transactionData|length > 0 -%}
             {%- for transaction in brickworks_result.transactionData -%}
             <div class="tx-item">
               <div class="tx-info">
                 <div class="tx-name">{{ transaction.products | join(', ') }}</div>
                 <div class="tx-date">{{ transaction.date }}</div>
               </div>
               <div class="tx-right">
                 <div class="tx-amount">{{ transaction.amount }}</div>
                 <div class="tx-points">+{{ transaction.loyaltyPoints }} pts</div>
               </div>
             </div>
             {%- endfor -%}
           {%- else -%}
           <p class="empty-message">You haven't made any transactions yet</p>
           {%- endif -%}
         </div>
       </div>
     </div>
     {% endbrickworksgeneratevar %}
Replace `SCHEMA_ID` and `RECORD_ID` with the actual IDs of your Brickworks schema and record. You can find the schema ID and the record ID in the URL when viewing them in the Synerise platform.
4. Add the appropriate CSS styles to the template to style the profile panel (avatar, stats row, section cards, transaction list, promotion badges, and so on). 5. If the template is ready, in the upper right corner click **Save this template > Save as**. 6. On the pop-up, enter the template name and select the folder. Confirm by clicking **Apply**. 7. To continue configuring the in-app campaign, click **Next**. 8. Click **Apply**. ### Select events that trigger the in-app message display --- Define which event triggers the display of the User Intelligence Panel. For example, you can display it when the customer opens a specific section of the application or taps a profile button. 1. In the **Trigger events** section, click **Define**. 2. Select **Add event** and from the dropdown list, choose the appropriate event (for example, `screen.view` with a parameter matching your profile screen). 3. Configure the event parameters according to your application's navigation structure. 4. Click **Apply**. ### Schedule the message and configure display settings --- 1. In the **Schedule** section, click **Define** and set the time when the message will be active. 2. In the **Display Settings** section, click **Change**. 3. Define the **Delay display**, **Priority index**, and enable the **Frequency limit** toggle to manage the frequency of display according to your business needs. 4. Click **Apply**. 5. Optionally, define UTM parameters and additional parameters. 6. Click **Activate**. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of each step directly in the Synerise Demo workspace: - [Aggregate - loyalty points sum](https://app.synerise.com/analytics-v2/aggregates/27578b05-c68e-364d-be42-bd5034604a1b) - [Aggregate - expired loyalty points](https://app.synerise.com/analytics-v2/aggregates/4963fed8-1784-352c-8777-27138eb9ded0) - [Aggregate - Sum of transactions](https://app.synerise.com/analytics-v2/aggregates/55cf86a5-acd9-3540-8293-13737a495300) - [Aggregate - Number of transactions](https://app.synerise.com/analytics-v2/aggregates/24011aa2-632d-319f-9047-8f13712105c8) - [Aggregate - Top 5 visited categories](https://app.synerise.com/analytics-v2/aggregates/3280a45c-9319-364a-9b56-4a2b99ae6116) - [Expression - Loyalty points](https://app.synerise.com/analytics/expressions/5b71b588-0088-4170-8489-6d18ab5ae010) - [Expression - Loyalty level](https://app.synerise.com/analytics/expressions/08075ec6-e77e-40ef-a13e-f65e40e67369) - [Segmentation - Gold loyalty level](https://app.synerise.com/analytics-v2/segmentations/64f1fa6e-a5aa-49ce-843f-a434b6bde9a0) - [Brickworks schema](https://app.synerise.com/assets/brickworks/schemas/556629ff-fac9-494b-9471-45b9c689443e) - [In-app campaign](https://app.synerise.com/communications/in-app/4f575259-5ce9-4e34-bd3d-e1d29d147352) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 4 events per profile that completes the flow: [`screen.view`](/docs/assets/events/event-reference/web-and-app#screenview) (~1), [`inApp.show`](/docs/assets/events/event-reference/inapp#inappshow) (~1), [`inApp.click`](/docs/assets/events/event-reference/inapp#inappclick) (~1), [`brickworks.generated`](/docs/assets/events/event-reference/brickworks#brickworksgenerated) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Brickworks](/docs/assets/brickworks) - [Expressions](/docs/crm/expressions) - [In-app messages](/docs/campaign/in-app-messages) - [Promotions](/docs/ai-hub/promotions) - [Segmentations](/docs/analytics/segmentations) # Display list of available coupons in a mobile app In this use case, you can easily set up a list of available promotions inside your mobile app, shown to the user after selecting the My Promotions section. All you need is an in-app campaign targeted to all users, with the display of the promotions list triggered by tapping that section. You can adjust the copy and other elements directly in the template, since the entire setup is based on predefined in-app templates that are simple to adapt. ## Prerequisites --- - Create an [item catalog](/docs/assets/catalogs). - Integrate Synerise [mobile SDK](/developers/mobile-sdk) in your mobile application. - Implement the [transaction events](/developers/web/transactions-sdk) using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). - Implement [basic loyalty program with points](/use-cases/loyalty-programs-basics). - [Integrate Synerise promotions](/docs/ai-hub/promotions/introduction-to-promotions). ## Implement a promotions catalog template --- This template provides an in-app catalog of coupons that can be redeemed with points. You can: - Display the list of coupons available - Show possibility to copy the code ### Create an in-app message --- In this part of the process, you create an in-app campaign triggered by your custom event. The trigger should come from a dedicated event generated by your mobile application — for example, an action such as tapping the ‘My promotions’ button. This ensures that the in-app is displayed only when the user intentionally requests it. 1. Go to Experience Hub icon **Experience Hub > In-app messages> Create in-app**. 2. Enter the name of the in-app. ### Define the audience --- As the first step, define the target group of customers for the in-app message. 1. In the **Audience** section, click **Define**. 4. Click **Everyone**. 8. To save the audience, click **Apply**. ### Define content --- In this part of the process, you will create the content of the in-app message that will appear in the mobile application with the help of ready-made template.
The template is designed so that the user can copy a specific coupon to the clipboard and paste it later in the checkout in the appropriate field.
1. In the **Content** section, click **Define**. 2. Click **Create message** and from the list of template folders, select **Predefined templates**. 3. Select the **Promotions catalog** template. **Result:** You are redirected to the code editor.
You can edit the template in two ways, by editing the code of the template ([add snippets](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-snippet-to-the-template-code), [add variables](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-variable) and/or by filling out the form in the Config tab. In this use case, we will use the capabilities of the predefined Config tab.
The view of in-app configuration
In-app configuration
#### Edit form in the Config tab --- The form in the **Config** tab is already filled in with default values. You can change them to fit your business needs.
This template automatically pulls all active promotions from your promotion list in which the customer fits the defined audience. To make sure the more important promotions appear first for the user, adjust their priority. Here’s how to do it:

In the Type and limits section of specific promotion - in the Priority field, enter a number that defines the promotion’s priority.

Priority controls the display order in the customer’s view. 1 is the highest. If multiple applicable promotions share the same priority, the one created earlier will be shown first.

2. Edit the copy using Title, and all the fileds connected with the Headers of the loyalty card. 9. Define the colors and style for the following fields: Borders, Backgrounds,and Text colors. 10. Set up the maximum number of promotion displayed for the user. 10. After you make changes to the template, you can check the preview. 1. Click the **Preview** button on the upper left side. 2. Enter the ID of a customer. 3. Click **Apply**.
Considering that the in-app is very interactive, the preview in the platform may not be enough to test the in-app performance. That’s why we suggest checking the preview directly in the mobile app.
11. If the template is ready, in the upper right corner click **Save this template > Save as**. 12. On the pop-up: 1. In the **Template name field**, enter the name of the template. 2. From the **Template folder** dropdown list, select the folder where the template will be saved. 3. Confirm by clicking **Apply**. 13. To continue the process of configuring the in-app campaign, click **Next**. 14. To save your content changes, click **Apply**. ### Select events that trigger the in-app message display --- In this part of the process, you will define the custom event triggering the display of the in-app message. 1. In the **Trigger events** section, click **Define**. 2. Select **Add event** and from the dropdown list, choose your custom event. 4. As the logical operator, select **Exists**. 5. Click **Apply**. ### Schedule the message and configure display settings --- As the final part of the process, you will set the display settings of the in-app message such as schedule, capping, priority of the message among other in-app messages. 1. In the **Schedule** section, click **Define** and set the time when the message will be active. 2. In the **Display Settings** section, click **Change**. 3. Define the **Delay display**, **Priority index** and enable the **Frequency limit** toggle to manage the frequency of in-app message display in the application.
You can additionally enable the **Capping limit** toggle to limit the amount of time the in-app message can be displayed to a user in general.
16. Click **Apply**. 17. Optionally, you can define the UTM parameters and additional parameters for your in-app campaign. 18. Click **Activate**. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of [promotion catalog in-app campaign](https://app.synerise.com/communications/in-app/a12e8289-4b81-4b10-a631-4c100a597858) in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: `custom trigger event` (~1), [`inApp.show`](/docs/assets/events/event-reference/inapp#inappshow) (~1), [`inApp.click`](/docs/assets/events/event-reference/inapp#inappclick) (~1). ## Read more --- - [In-app messages](/docs/campaign/in-app-messages) - [Using in-app template builder](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template) - [Promotions](/docs/ai-hub/promotions) # Identifying Customers' Preferred Communication Channel In today's data-driven world, understanding user preferences is the key to effective marketing. Knowing whether your audience prefers the mobile or desktop channel helps you effectively reach a specific audience by connecting with customers through channels they love most. In this use case, you will create aggregates and segmentations that will help identify user preferences between mobile and desktop channels, enabling more targeted and effective communication. ## Prerequisites --- - [Implement a tracking code](/docs/settings/tool/tracking_codes). - Integrate Synerise [mobile SDK](/developers/mobile-sdk) in your mobile application ## Process --- In this use case, you will go through the following steps: 1. [Create two aggregates](#create-two-aggregates), one that returns the number of the `Visited page` events on desktop and the other that returns the number of `screen.view` events in a mobile application. 2. [Create a segmentation](#create-a-segmentation) based on these aggregates, so you can divide your customers according to their preferred communication channel. ## Create two aggregates --- The first step is creating two aggregates that count page visits (based on the [`page.visit` event](/docs/assets/events/event-reference/web-and-app#pagevisit) on the website and views in the mobile application (based on the [`screen.view` event](/docs/assets/events/event-reference/web-and-app#screenview). ### Aggregate returning number of visits on the desktop --- 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Count**. 4. From the **Choose event** dropdown list, select the **Visited page** event. 5. Set the period from which the aggregate will analyze the results. In our case, it's **last 30 days**. 6. Save the aggregate.
The view of the aggregate counting visited pages
The aggregate counting visited pages
### Aggregate returning number of visits in the mobile application --- 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 9. Click **Analyze profiles by** and select **Count**. 10. From the **Choose event** dropdown list, select the **mobile screen viewed** event. 11. Set the period from which the aggregate will analyze the results. In our case, it's **last 30 days**. 12. Save the aggregate.
The view of the aggregate counting mobile screen views
The aggregate counting mobile screen views
## Create a segmentation --- In this part of the process, we create a segmentation that consists of two segments. One segment comprises customers who have a higher number of website visits compared to visits on the mobile application, while the other segment consists of customers who have a lower number of page visits compared to visits on the mobile application. 1. Go to Decision Hub icon**Decision Hub > Segmentations > New Segmentation**. 2. Enter the name of the segmentation. 3. From the **Add condition** dropdown list, select the [aggregate counting page visits](#create-two-aggregates) you created in the previous part of the process. 4. Click the **Choose** button, and from the list of operators, choose **More than**. 5. Next to the opperator, change the **Number** to **Parameter**. 6. From the **Parameter** dropdown list, select the [aggregate counting screen views in the mobile application](#create-two-aggregates) you created in the previous part of the process. 7. Name the segment as follows: `Desktop preference`.
The view of the segment with more website visits
The segment with more website visits
8. Duplicate the segment, and rename it as follows: `Mobile preference`. 9. In the new segment, change the opperator to **Less than**. 10. Next to the opperator, change the **Number** to **Parameter**. 11. From the **Parameter** dropdown list, select the [aggregate counting screen views in the mobile application](#create-two-aggregates) you created in the previous part of the process.
The view of the segment with more mobile application visits
The segment with more mobile application visits
12. Save the segmentation. ## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of all elements used in the use case, directly in Synerise Demo workspace: - [Agreggate counting website visits](https://app.synerise.com/analytics/aggregates/4cd80712-6463-3f55-ac5f-29b3abc08153) - [Aggregate counting mobile visits](https://app.synerise.com/analytics/aggregates/61738e01-69c6-3864-ac1e-12ba9065a522) - [Segmentation](https://app.synerise.com/analytics-v2/segmentations/ba36aeb9-1c69-4362-bbf1-ecbd7cfce590) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case does not generate any events. ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Segmentation](/docs/analytics/segmentations) # Discount for a product complementary to the product viewed Personalized discount coupons can be an effective incentive to buy a product. They are a great tool that businesses frequently use successfully, helping them find new customers and **encouraging more sales.** Properly directed, coupons can meet the client's needs and at the same time direct them towards the purchase of a specific type of product or brand. ## Example of use - Home appliances industry **Challenge** A customer from the electronics and home appliances industry decided to encourage customers to buy equipment from a certain brand. To start the promotion, the client prepared a discount coupon for a product complementary to another item from the same brand. The offer was personalized and addressed to users interested in buying this type of equipment. A customer who viewed various home projectors received after 5 minutes an email with a discount coupon for an electric screen with the purchase a projector of a given brand. The rebate code was valid during shopping in the online store and to use it the customer just had to enter the code in the appropriate place when making purchase. ![Screenshot presenting discount for complementary product](/api/docs/image/f8a57079df9dd82ae8b22dc747691385d7d51d29/use-cases/all-cases/_gfx/discount-for-complementary-product.png) ## Prerequisites --- - Synerise web SDK implemented. - [OG tags](/developers/web/og-tags) implemented. - Import of [code pool](/docs/assets/code-pools) from which the discount codes will be taken. - Email account [configuration](/docs/campaign/e-mail/configuring-email-account). ## Process --- 1. Create an [email template](/use-cases/discount-for-complementary-product#create-an-email-template-with-code-pools) with code pools. 2. Create a [workflow](/use-cases/discount-for-complementary-product#create-a-workflow). ## Create an email template with code pools --- 1. Go to **Experience Hub > Email**. 2. Prepare an email template that will be sent to the client and place the code in Jinjava in it, which will be responsible for collecting the coupon from the pool. 3. Select the appropriate code pool from the snippets in email creator. 4. **Save** your template. ## Create a workflow --- Prepare the automation that will start on the event of visiting the page with the given type of product and will send the email with discount code after specific delay. 1. Go to **Automation Hub > Workflows**. 2. Choose **Profile Event** as a trigger. 3. Choose event `page.visit` and define the pages with the given type of products. 4. After visiting the product page there should be an appropriate delay. 4. Add action node - sending an email with a discount code, created in previous step. 5. Add end node and **save** your workflow.
`Screenshot presenting Automation`
Automation
## Check the workflow set up on the Synerise demo workspace --- Check the [workflow](https://app.synerise.com/automations/automation-diagram/27716cf5-2b10-4182-893e-9b1d8666cba8) settings directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 9 events per profile that completes the flow: [`page.visit`](/docs/assets/events/event-reference/web-and-app#pagevisit) (~1), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~2), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`voucherCode.assigned`](/docs/assets/events/event-reference/loyalty#vouchercodeassigned) (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1). ## Read more --- - [Automation](/docs/assets/code-pools) - [Creating email templates](/docs/campaign/e-mail/creating-email-templates) - [Snippets](/docs/assets/snippets) - [OG tags](/developers/web/og-tags) # Identify products purchased at a promotional price In order to better match the offer with the customer's needs, a company needs to conduct an in-depth analysis of the customers' behavior and buying habits on its website. Knowing what products have been purchased as part of a promotion can prove to be very important and beneficial and can be used later while creating different campaigns. ## Prerequisites --- - A [tracking code](/developers/web/installation-and-configuration) implemented into the website. - Send information about transactions through [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). ## Process --- In this use case, you will go through the following steps: 1. [Create an expression](/use-cases/create-event-attribute#create-an-expression). 2. [Create a metric](/use-cases/create-event-attribute#create-a-metric). 3. [Create segmentation](/use-cases/create-event-attribute#create-a-segmentation). 4. [Create report](/use-cases/create-event-attribute#create-a-report). ## Create an expression --- After a purchase is made, the **product.buy** event appears in the customer's profile. This event contains two parameters: **product:price:amount** - describing the original price of the product and **$finalUnitPrice** - describing the final price of the product. The transaction event does not indicate whether the purchased product was covered by a promotion (unless such a parameter has been implemented into the workspace).
Example of the product.buy event
Example of the product.buy event
Using Decision Hub, you can create an event expression that deducts the price of the purchased product from the regular price. Create an expression that calculates the difference between the initial and the final price of the product. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expression > New expression**. 2. Enter the name of the expression. 3. Set the Expression for option to **Event**. 4. From the dropdown list, select **Bought products**. 5. Click the **unnamed** node. 6. From the **Choose attribute** dropdown list, select **product:price:amount**. 7. Click the plus icon. 8. From the dropdown list, select **Event attribute**. 9. From the **Choose attribute** dropdown list, select **$finalUnitPrice**. 10. Change the mathematical operator between these two parameters to minus. 11. Save the expression.
Behavioral Data Hub expression formula calculating discount amount from product price and final unit price
Formula of the expression
## Create a metric --- In this part of the process, you create metrics to see how many products were purchased at a discount. This metric will include the [expression](/use-cases/create-event-attribute#create-an-expression) - if the result of this expression is greater than 0, it means that the product was bought at a discount. 1. Go to Behavioral Data Hub icon **Decision Hub > Metrics > New metric**. 2. Enter a meaningful metric name. 3. Leave the metric kind at default (**Simple**). 4. As the aggregator type, select **Sum**. 5. Select the **Bought product** event. 6. Add the **$quantity** parameter. 7. Select the **where** input that appeared on the canvas. 8. Select the expression created in the [previous step](/use-cases/create-event-attribute#create-an-expression). 8. Choose the **More than** number operator. 9. Keep clicking the icon next to the logical operator until you get **#** icon. 10. In the blank field, enter `0`. 11. Select the date range of the metric (for example, last 30 days) 11. Save the metric.
Metiric configuration
Metric configuration
## Create a segmentation --- Create a segmentation to see how many customers bought discounted products. 1. Go to Behavioral Data Hub icon **Decision Hub > Segmentation > New Segmentation**. 2. Enter the name of segmentation. 3. On the canvas, click **Choose filter**. 4. From the dropdown list, select the **Bought product** event. 5. Select the **where** input that appeared on the canvas. 6. Select the expression created in the [previous step](/use-cases/create-event-attribute#create-an-expression). 7. Choose the **More than** number operator. 8. Keep clicking the icon next to the logical operator until you get **#** icon. 9. In the blank field, enter `0`. 10. Select the date range of the segmentation (for example, last 30 days). 11. Save the segmentation.
Segment configuration
Segment configuration
## Create a report --- In this part of the process, create a report to clearly show the most frequently purchased discounted products, displaying the product parameters that interest you the most (in our example, we display the product names). 1. Go to Behavioral Data Hub icon **Decision Hub > Report > New report**. 2. Enter the name of the report. 3. Select the metric you created in [this part](/use-cases/create-event-attribute#create-a-metric) of the process. 4. From the **Range** dropdown list, select the number of top (the most frequently bought products) to be shown in the preview of the report. 5. In the **Dimension** section, choose a parameter from **product.buy** suggesting what the product is. Among the most common parameters, you can choose **$name** or **$sku**. 6. In the date range, select the time that will be analyzed.
Select the same date range as you selected for the metric and the segmentation.
7. Save the report. 8. Click preview to see the results.
Segment configuration
The configuration of report with products bought on promotion
The report will return information about how many, for example, XYZ shoes were purchased at a discount.
Segment configuration
Report preview
## Check the use case set up on the Synerise Demo workspace --- You can find the analyses created in this use case in our Synerise Demo profile at the following links: - [expression](https://app.synerise.com/analytics/expressions/ca0777e4-19c3-4c1d-84a3-e5d439dc7184), - [metric](https://app.synerise.com/analytics/metrics/9b948b8c-8728-42a7-b4e4-2526be5d151f), - [segmentation](https://app.synerise.com/analytics/segmentations/4f4722e9-2b80-4dcb-a483-98f11e1bd812), - [report](https://app.synerise.com/analytics/reports/883d2dc2-b438-487c-8aee-7c9ee65911e9). If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case does not generate any events. ## Read more --- - [Expressions](/docs/crm/expressions) - [Metrics](/docs/analytics/metrics) - [Segmentation](/docs/analytics/segmentations) # Transform and import product data to a catalog In this use case, we will focus on the process of importing and transforming product data from an `.XML` file using data transformation. This method of data transformation is beneficial as it eliminates the need for the data to be in a predetermined, structured format. In this use case, we will make the following modifications to the file: - Add 2 new columns: - **discounted**: this column will contain the `true` value for all products which have a value (price) assigned in the `g:sale_price` column. - **percentage_discount**: this column contains the percentage value of the discount based on `g:price` and `g:sale_price` columns. - Edit values: Replace the value of `g:availability` column from `1`/`0` to `in stock`/`out of stock`. ## Input data in use case --- In this use case, we use two files: - the complete `.XML` file in the Google Merchant Format which contains the full set of products. The file contains the following attributes: `g:id,g:title,g:description,g:image_link,g:price,g:sale_price,g:availability`. - the sample of the product data in the `.XML` format. To reproduce this scenario in your workspace, [create a catalog](/docs/assets/catalogs/creating-catalogs) and prepare the files.
If your product data is complete, you can skip transforming data. But if you need to modify the file with product data before an import to Synerise, you can modify the data in **Automation > Data Transformation**. To do so, create a sample of your product data and include all attributes you want to modify. If you miss the attributes in the sample file, but import the actual product data with them, the data will be imported as delivered in the actual file.
Example XML file

```xml Your Store Name https://www.yourstore.com Your Store with clothes 1 Shirt white cotton shirt with a round neck https://www.yourstore.com/product-1 https://www.yourstore.com/product-1-image.jpg 19.99 10.99 1 2 Jeans blue cotton jeans https://www.yourstore.com/product-2 https://www.yourstore.com/product-2-image.jpg 29.99 20.99 0 ```

## Process --- In this use case, you will go through the following steps: 1. [Create a data transformation rule](/use-cases/import-xml-file#create-a-data-transformation) to transform the data in the sample file. 2. [Create a workflow](/use-cases/import-xml-file#create-a-workflow) to import the .`XML` file to Synerise. ## Create a data transformation --- In this part of the process, you define the rules of modifying data before sending it to the Synerise based on the sample file. Each of the following sub-steps describes the individual changes performed on the file. We will add follwing rules: - Add 2 new columns: - **discounted**: this column will contain the `true` value for all products which have a value (price) assigned in the `g:sale_price` column. - **percentage_discount**: this column contains the percentage value of the discount based on `g:price` and `g:sale_price` columns. - Edit values: Replace the value of `g:availability` column from “1/0“ to “in stock/out of stock“ 1. Go to Automation Hub icon **Automation Hub > Data Transformation > Create transformation**. 2. Enter the name of the transformation. 3. Click **Add input**. Before you proceed with selecting sample data and defining transformation rules, optionally, you can select a goal to help you structure the data. If you want to create a transformation diagram without a specific goal and you know the structure of the output data, skip this step. Goals will suggest you the required data for the import into Synerise. ### Add file with sample data This node allows you to add a data sample. In further steps, you define how the data will be modified. Later, when [this transformation is used in the Automation workflow](/docs/automation/operation/data-transformation-node), the system uses the rules created for the sample data as a pattern for modifying actual data. 1. On the canvas, click the **Add input** node. 2. On the pop-up, click **Upload a new file** or drag one here. 3. Upload the `.XML` file created as the part of prerequisites. 4. You can preview the file, then click **Apply**. ### Add the new column 7. On the **Data Input** node, click the grey dot. 8. From the dropdown list, select **Add column**. 9. Click the **Add column** node. 10. In the configuration of the node: 1. In the **Add column** field, enter the name of the column. In this use case, it's `discounted`. 3. From the dropdown list, select **Dynamic value**. 4. In the **Type value** box, add the Jinja code, which adds the `true` value for all products with `g:sale_price` attribute in this new column. You can use the code presented below:
{% if root["g:sale_price"] is defined %}true{% endif %}
5. Leave **Handle incomplete data** at default (**Skip row if error occurred**) to skip missing or invalid data which may occur during transformation. 7. Confirm by clicking **Apply**. ### Add the new column 7. On the **Add column** node, click **THEN**. 8. From the dropdown list, select **Add column**. 9. Click the **Add column** node. 10. In the configuration of the node: 1. In the **Add column** field, enter the name of the column. In this use case, it's `percentage_discount`. 3. From the dropdown list, select **Dynamic value**. 4. In the **Type value** box, add the Jinja code, which counts the percentage value of the discount based on `g:price` and `g:sale_price` attributes and adds it to this new column. You can use the code presented below:
{% if root["g:sale_price"] is defined %}{{ root["g:sale_price"]*100/root["g:price"] }}{% endif %}
5. Leave **Handle incomplete data** at default (**Skip row if error occurred**) to skip missing or invalid data which may occur during transformation. 7. Confirm by clicking **Apply**. ### Edit values 7. On the **Add column** node, click **THEN**. 8. From the dropdown list, select **Edit values**. 9. Click the **Edit values** node. In the configuration of the node: 1. Click **Add rule**. 2. Click **Add column**. 3. From the dropdown list, select column name, in this case it's `g:availability`. 4. Set the **Edit values** values option to: 1. **Replacing** 2. **Dynamic value**. 4. In the **Type value** field, enter the Jinja code which replaces the value of `g:availability` attribute from `1` and `0` to `in stock`/`out of stock`. You can use the code presented below:
{% if root['g:availability'] == 1 %}in stock{% else %}out of stock{% endif %}
5. Leave **Handle incomplete data** at default (**Skip row if error occurred**) to skip missing or invalid data which may occur during transformation. 7. Confirm by clicking **Apply**. ### Add the finishing node This node lets you preview the output of the modifications to the sample data. 1. On the **Edit values** node, click **THEN**. 2. From the dropdown list, select **Data Output**. 3. To preview the results, click the **Data Output** node.
The preview of modifications to the file
The preview of modifications to the file
4. Close the preview 3. In the upper right corner, click **Save and publish**. **Result**:
Data Transformation diagram for importing an XML product database file
The diagram of data transformation
## Create a workflow --- The scenario for this use case describes a one-time import of the `.XML` file with a product database to Synerise. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the launch date 3. As the trigger node, add **Scheduled Run**. 4. In the configuration of the node: 1. Change the **Run trigger** option to **one time**. 2. Select **Immediately**. 3. Confirm by clicking **Apply**.
Automation Hub Scheduled Run node configuration for triggering XML file import
The configuration of the Scheduled Run node
### Select file to import 1. Add a **Local File** node. 2. In the configuration of the node: 1. Upload the file. 2. Confirm by clicking **Apply**.
Local File transfer
Local File transfer
### Add data transformation node 1. Add a **Data Transformation** node. 2. In the configuration of the node: 1. Choose the name of the data transformation, which you have created in the [previous part of the process](/use-cases/import-xml-file#create-a-data-transformation). 2. Confirm by clicking **Apply**.
Data Transformation node
Data Transformation node
### Add import to catalog 1. On the **Data Transformation** node, click **THEN**. 2. From the list that opens, select **Synerise > Import to Catalog**. 3. Open **Import to Catalog** node. 4. Choose the catalog from the list. 5. As a primary key, choose `g:id` parameter. 5. Click **Apply**. ### Add the finishing node 1. Add the **End** node. 2. In the upper right corner, click **Save & Run**.
Automation Hub workflow for importing an XML product feed
The workflow configuration
You can monitor the flow of the workflow in the **Transformation logs** tab. It contains information about the execution of the workflow.
Automation Hub Transformation logs tab showing workflow execution history
The logs for the workflow
## Check the use case set up on the Synerise Demo workspace --- You can check the [data transformation](https://app.synerise.com/automations/data-transformation/baebb542-133f-4e13-9d18-29fdaef74fc8) and [automation process](https://app.synerise.com/automations/workflows/automation-diagram/4ccfae2d-3525-4cba-a7dc-0615e3f96cf3) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 5 events per workflow execution: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Data Transformation](/docs/automation/data-transformation-and-imports) - [Data Transformation node](/docs/automation/operation/data-transformation-node) ``` # Send emails with dynamic attachments There are various business cases in which personalized attachments need to be sent to customers through email. One reason for this is the specific nature of industries like finance, banking, insurance, or healthcare. Email communication in various industries often involves sending dedicated documents to customers, often due to legal requirements. Additionally, personalizing attachments can be beneficial for specific marketing campaigns aiming to meet particular business needs. Our Dynamic Attachments feature enables the process of sending customized attachments to each customer by email. In this use case, we demonstrate how to add two dynamic attachments to an email communication, with each attachment tailored to individual customer. To do this, we create a workflow in which we upload selected files then attach them to an email and send them to customers. This use case illustrates a scenario where we send two requests with a single file. ## Prerequisites --- - [Create an email account](/docs/campaign/e-mail/configuring-email-account) which you will use to send emails. - [Create an email template](/docs/campaign/e-mail/creating-email-templates) that you will use in your communication. - You must integrate your system that generates files dedicated to customers and upload them to Synerise through the [Synerise API](https://hub.synerise.com/api-reference/asset-management#operation/addClientFiles) (with content encoded in base64).
To see the event reference related to attachment upload events, click [here](/docs/assets/events/event-reference/automation).
## Create a workflow --- Create a workflow in which you specify the files you want to attach to the email communication. In this use case, we follow a scenario in which the workflow is triggered by the **attachment.upload** event, which retrieves information about the Insurance Agreement files. Then, we wait for the Policy Certificate to be uploaded, and then send email with both of these documents in attachments, where each attachment is dedicated to an individual customer. Event **attachment.upload** can be extended with any custom attributes. In our case, we are sending an additional parameter **docType**, which contains information about the type of the uploaded file. We will use this parameter to specify the event from which we want to get the uploaded files. 1. Go to **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the Profile Event trigger node --- The trigger for starting this workflow is the **attachment.upload** event that appears in the customers profiles when files sent from the external source have been successfully uploaded and are ready to be used as a dynamic attachment. The first event from which we want to get file was send with **docType** parameter value - `Insurance agreement`. 1. As the first node of the workflow, add **Profile Event**. 2. Name this node with a unique name. 2. From **Choose event** dropdown menu, choose the **attachment.upload** event. 3. Click the **+ where** button and from the dropdown list, choose the parameter that specify the type of uploaded file. In our case, it is the **docType** parameter. 4. From the **Choose operator** dropdown, select **Equal(String)**. 5. In the text field, type the type of the file. In our case, it is `Insurance agreement`. 6. Confirm by clicking **Apply**.
Profile
Profile Event trigger node
### Define Event Filter --- After the first file is uploaded, define the second event from which you want to upload file. We use **attachment.upload** event with the **docType** parameter value - `Certificate of policy`. 1. Add the **Event Filter** node. 2. Name this node with a unique name. 2. From **Choose event** dropdown menu, choose the **attachment.upload** event. 3. Click the **+ where** button and from the dropdown list, choose the parameter that specify the type of uploaded file. In our case, it is the **docType** parameter. 4. From the **Choose operator** dropdown, select **Equal(String)**. 5. In the text field, type the type of the file. In our case, it is `Certificate of policy`. 6. Confirm by clicking **Apply**.
Event
Event Filter node
### Define the Send Email node --- When all files are already uploaded, add them as attachments to the email communication. 1. Add the **Send Email** node. 2. In the **Sender details** section, choose the email account from which the email will be sent. 3. In the **Content** section, in the **Subject** field, enter the subject of the email, and from the **Template** dropdown, select [the template you created as part of the prerequisites](#prerequisites). 4. In the **Dynamic Attachment** section select the files which will be added.
Send
Send Email node
5. In the **UTM & URL parameters** section, you can define the UTM parameters added to the links included in the email. 6. In the **Additional parameters** section, you can optionally describe campaigns with [additional parameters](/docs/campaign/e-mail/creating-email-campaigns#adding-custom-parameters). 7. Click **Apply**. ### Add the finishing node --- 1. Add the **End** node. 2. In the upper right corner, click **Save & Run**.
Automation Hub workflow for sending emails with dynamic attachments
Workflow configuration
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of the [workflow](https://app.synerise.com/automations/automation-diagram/eca92056-9e89-4199-a7fb-77dc72330c82) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 9 events per profile that completes the flow: [`attachment.upload`](/docs/assets/events/event-reference/automation#attachmentupload) (~2), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~2), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Dynamic attachments](/docs/automation/actions/send-email#dynamic-attachments) # Calculate transactions with the use of promotional codes To implement effective promotional campaigns, it is important to carefully analyze the results of past campaigns, draw conclusions and use this knowledge in the future. This use case describes how to calculate the number of transactions with the use of promotional codes. ## Prerequisites --- - Implement a [tracking code](/developers/web/installation-and-configuration). - Implement [transactional events](/developers/web/methods-reference#tracking-transactions). - Create and activate a [promotion](/docs/ai-hub/promotions). ## Process --- In this use case, you will go through the following steps: 1. [Prepare a regular expression](/use-cases/event_data_modification#prepare-a-regular-expression). 2. [Create an expression](/use-cases/event_data_modification#create-an-expression). 3. [Create an aggregate](/use-cases/event_data_modification#create-an-aggregate). 4. [Create a metric](/use-cases/event_data_modification/#create-a-metric). ## Prepare a regular expression --- When a promotion is assigned to a customer, the event appears on the customer’s profile (for example, a `handbill.assign` event). This event contains a parameter (in this use case, `promo3`) with the promotion number. If a customer uses the promotion code during the purchase, a transaction event appears on the customer’s profile with the parameter that contains the promotion number as well. However, the values of these parameters are slightly different for the two events. In the transaction event, two zeros at the beginning of the promotion number are deducted, so the challenge is to turn these values into an identical format as it is in the **handbill.asign** event.
Comparison of the handbil.assign and transaction event
Comparison of the handbil.assign and transaction event
For this purpose, prepare a regular expression that will extract the number of promotion from the parameter of the transaction event. In our use case, the regular expression will take the following form `(?<="promoId":")(.+?)(?=\"|$)`. You will use it in the next part of the procedure.
The regular expression matches a promoID in an example value of the transaction event parameter
The regular expression matches a promoID in an example value of the transaction event parameter
## Create an expression --- Create an expression for the transaction event. Using the **Concat** function in the expression, add two zeros to the **loyalRewards** parameter (which contains the number of the promotion). As a result, the two zeros are added at the beginning of the promotion number and the expression returns the number of promotion which matches the number of promotion in the **handbill.asign** event. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expression > New expression**. 2. Enter the name of the expression. 3. Set the Expression for option to **Event**. 4. From the dropdown list, select **transaction.charge**. 5. In the Formula definition section of the page, click **Select**. Result: A dropdown list appears. 6. From the list that opens, select **Function > Concat**. 7. In the brackets, click the left **Select** button and from the list, select again **Function > Concat**. 8. In the brackets, click the left and right Select button from the list and select **Constant** with value `0`. 9. After the brackets click the **Select** button and from the list select **Function > Regexp**. 10. In the brackets, click the left Select button and from the list, select **Event attribute loyalRewards**. 11. Click the right **Select** button and from the list, select **Constant** with value `(?<="promoId":")(.+?)(?=\"|$)`. 12. Save the expression.
Expression adding zeros to the parameter
Expression adding zeros to the parameter
## Create an aggregate --- In this part of the process, create an aggregate that returns the id of the assigned promotion from promo3 parameter. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Click **Analyze profiles by** and select **Last Multi**. 3. In the Size field choose how many values you would like to return. 4. Select **Consider only distinct occurrences of the event parameter**. 5. Select the **handbill.assign** event. 6. Select the **promo3** parameter. 7. Select the **id** and **variantName** parameter for which you want to get results.
An aggregate that will return the most recently assigned promotions
An aggregate that will return the most recently assigned promotions
## Create a metric --- In this step you will create a metric that calculates the number of transactions made by customers who had the promotional code assigned to their profile and used it during the purchase process. 1. Go to Behavioral Data Hub icon **Decision Hub > Metrics > New metric**. 2. Enter the name of the metric. 3. Leave the Aggregator at default **(Count)**. 4. Select the **product.buy event**. 5. Add the ”**promoId z loyalRewards**” parameter - additional parameter created with [expression](/use-cases/event_data_modification#create-an-expression). 6. Select **In** operator. 7. Keep clicking the icon next to the logical operator until you get **Choose value** button. 8. Select the aggregate that returns last multi assigned personalized promotions created in [this step](/use-cases/event_data_modification#create-an-aggregate). 9. Add a filter with people who had a `handbill.assign` event from a specific campaign id. 10. Select the date range of the metric. 11. Save the metric.
Metrics configuration
Metrics configuration
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of every element of this process directly in Synerise Demo workspace: - [Expression](https://app.synerise.com/analytics/expressions/c0d65888-178e-4c48-84f1-f348b553c486) - [Aggregate](https://app.synerise.com/analytics/aggregates/f1b6d24c-8541-3f85-b7e5-ec5482d0c3f4) - [Metric](https://app.synerise.com/analytics/metrics/44da8800-568f-4f1c-9014-0627580225f1) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case does not generate any events. ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Expressions](/docs/crm/expressions) - [Metrics](/docs/analytics/metrics) # Group customers by purchase days In this use case, you will learn how to create a segmentation that allows you to divide your customers into segments based on the time of week on which they bought a product. You may use that information further for targeted communication. ## Prerequisites --- - Implement transaction events using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). ## Create a segmentation --- Create a segmentation that organizes customers into two groups: - Weekend - It gathers the customers who bought products on weekends, - Week days - It gathers the customers who bought products on week days. 1. Go to Decision Hub icon **Decision Hub > Segmentations > New Segmentation**. 2. Enter the name of the segmentation. 3. Name the first segment, in our case `Weekend` 4. To add the first step to the segment, click the **Performed event...** button. 5. From the dropdown list, select the `product.buy` event. 6. For the event parameter, click the **+ where** button and select `TIMESTAMP`. 7. As the logical operator, select **Custom** date. 8. Click **Start date -> End date**: 1. In the **Relative date range** section, click **Custom**, type 365 and from the the dropdown list, select **Days**. 2. In the **Filter** section, click **Add filter** and then **Every week**. 3. Select **Sat** and **Sun**. 4. Click **Add time**. 4. Click **Apply**.
Conditions of the date range
Conditions of the date range
9. Click **Apply**. 10. In the calendar in the right bottom of the page: 1. In the **Relative date range** section, click **Custom**, type 365 and from the the dropdown list, select **Days**. 2. Click **Apply**.
Conditions of the segment
Conditions of the segment
11. Create the second segment by duplicating the one you have just created. 12. Name this segment `Week days`. 13. Change the date range: 1. In the **Filter** section, click **Change** . 2. Click on **Select all** and clear selection of **Sat** and **Sun**. 4. Click **Add time**. 3. Click **Apply**.
Conditions of the date range
Conditions of the date range
14. Click **Apply**.
Conditions of the segment
Conditions of the segment
15. In the calendar in the right bottom of the page: 1. In the **Relative date range** section, click **Custom**, type 365 and from the the dropdown list, select **Days**. 2. Click **Apply**. 16. Click **Save**. The segments are saved and can be viewed in **Preview** where you can preview how your customer base splits according to the defined conditions. ## What's next --- To use this segments in **Experience Hub**: 1. Click **Define** in the **Audience** section. 2. Click **New Audience**. 3. Click **Define conditions**. 1. Click **Choose filter** and from the dropdown list choose the segmentation you have created in [this step](/use-cases/number-of-transactions-weekend-vs-workdays#create-a-segmentation). 2. Choose operator **Equal**. 3. Type the name of the segment. Depending on whether you want to send the communication to customers who buy on the weekend, enter the name of the segment `Weekend`, and if to those who buy during week days - `Week days`. 4. Click **Apply**. 4. Click **Apply**.
Example of audience
Example of audience
## Check the use case set up on the Synerise Demo workspace --- You can also check the [segmentation configuration](https://app.synerise.com/analytics-v2/segmentations/0d06b767-6168-4e8f-8c08-9bfb2ad6544c) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case does not generate any events. ## Read more --- - [Segmentations](/docs/analytics/segmentations) # Sync Online and Offline Transaction Data with RTB House for Retargeting The RTB House engine, one of its kind powered by deep learning algorithms, identifies potential buyers and boosts performance via 1:1 ultra-personalized retargeting up to 50 percent more efficient than standard machine learning AI-based approaches. Thanks to the RTB House integration with Synerise, you can enhance your advertising performance by creating segments of people based on behavioral and contextual activities in your integrated online and offline ecosystem. You can choose among various segments in Synerise, for example - customers who are ready to buy or those with the highest propensity to purchase. The following example shows how to create a simple integration - sending all online and offline transactions to RTB House so that this data can be used in, for example, retargeting activities. ## Prerequisites --- Obtain the following data from RTB House (you need to contact their support): - `pkey`, which is a static key unique to your RTB house account, - hash of the source, needed to put into the `tag` parameter. ## Building the workflow --- 1. Go to **Automation Hub > Workflows > New workflow**. 1. Add a Profile Event trigger node, where the condition is only that the event is `transaction.charge` 2. Add an outgoing integration node: 1. As the integration type, choose **Custom webhook**. 2. As the method, select **POST**. 3. As the URL, paste the following string: `https://omni.creativecdn.com/partner/omni/postbacks?pkey=&uid={{customer['uuid']}}&time={{event.params.time}}&tag=pr__orderstatus2_{{event.params.$totalAmount}}_{{event.params.$orderId}}_{% set tab = [] %}{% for p in event.params.products %}{% do tab.append(p.sku) %}{% endfor %}{{tab|join(',')}}`
Click to see the explanation of the parameters
  • `pkey`: the unique static key of your RTB House account
  • `uid={{customer['uuid']}}`:the customer's identifier; UUID from Synerise database; inserted dynamically by Jinjava
  • `time={{event.params.time}}`: the timestamp of the event; Synerise uses Unix time; inserted dynamically by Jinjava
  • `tag`: contains the source hash and variables inserted dynamically by Jinjava: the cost of the transaction, the ID of the transaction in Synerise database, and all items in the transaction
1. In the URL, replace : 1. `` with the pkey you received from RTB House. 2. `` with the source hash you received from RTB House. 2. Leave the other integration parameters (headers, body, authorization) at default. **Result:**
Outgoing Integration definition
Outgoing Integration definition
1. Add an end node. 2. Click **Save and Run**.
Overview of the workflow
The structure of a complete workflow
## What's next --- To test the automation: 1. Send a `transaction.charge` event from a test customer profile. 2. Verify that an automation event is visible in the test profile's customer card. 3. Verify that the data from the test event was uploaded to RTB House. ## Generated events This use case generates approximately 7 events per profile that completes the flow: [`transaction.charge`](/docs/assets/events/event-reference/items#transactioncharge) (~1), [`product.buy`](/docs/assets/events/event-reference/items#productbuy) (~2), [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`webhook.response`](/docs/assets/events/event-reference/integration#webhookresponse-and-custom-webhook-response-names) (~1). ## Read more --- - [Automation Hub](/docs/automation) - [Integration](/docs/automation/integration) # Interest-Based Segmentation Using URL Fragments from Page Visits Having more product categories in your store, you can easily measure which category a customer visits most frequently. Based on the URL of the visited page, you can find a lot of information. In this use case, we treat visits to specific URL as visits to specific categories (for example, if the URL contains "/shoes/", we assume that the customer has visited the "Shoes" category). Using the Decision Hub, we can define how many times a customer visited specific categories and then extract the one most frequently visited by them. Additionally, you can create a segmentation by grouping these customers by favorite category. In this use case, we will show you how to create such a segmentation on the example of 4 selected categories using aggregates and expressions that use the URL fragment in the page visit event. ## Prerequisites --- Implement [tracking code](/developers/web/installation-and-configuration#creating-a-tracking-code) on your website.
If there are more product categories, we recommend additionally implementing [OG tags](/developers/web/og-tags). Thanks to that, an additional parameter will be collected in the `page.visit` event with the exact path of the category visited by the customer. Based on that, you can simplify the presented analyses and reduce them to one aggregate with the "TOP" aggregator and segmentation (there would be no need to create an expression and aggregates for each category).
## Process --- This procedure consists of three stages: 1. Create [aggregates](/use-cases/segmentation-based-on-interests#create-aggregates) that count visits on each of four product categories. 2. Create an [expression](/use-cases/segmentation-based-on-interests#create-an-expression) that returns the highest result for every category. 3. Create a [segmentation](/use-cases/segmentation-based-on-interests#create-a-segmentation) that groups customers by the most frequently visited category. ## Create aggregates --- Create aggregates that count visits on each of product categories. In this stage, we assume that visiting a given fragment of the URL equals visiting a category. To measure the results, create 4 aggregates that count the number of visits to each of the four categories. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate (in this example, the name of the aggregate will be the same as the category name). 3. By clicking the Expander arrow icon button, set **Count** as the type of the aggregate result. 4. From the **Choose event** dropdown list, select the `page.visit` event. 5. Click the **Where** button and from the **Choose parameter** dropdown list, select `uri`. 6. Select the **Contain** logical operator. 7. In the text field, next to the logical operator, enter the name of the product category. 8. Save the aggregate. 9. Create another one or more aggregates for their respective categories. Repeat the steps 1-8. **Result**: The aggregates will count visits of individual users to the product category. The aggregates are available in Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates**.
Filled settings of the category A aggregate
Filled settings of the category A aggregate
## Create an expression --- In this step, create an expression that will use the max function. This function returns the highest value in a set of values. Use it in order to return the result of the category most frequently visited by the user. It will be used later in building the segmentation. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Expressions > New expression**. 2. Enter the name of the expression. 3. From the dropdown list, select **Attribute**. 4. To start creating the formula of the expression, click the **Select** button. 5. Create the formula as presented on the video below:
6. Save the expression by clicking **Save**. The expression returns the highest values for every category.
Filled settings of the expression
Filled settings of the expression
## Create a segmentation --- In this stage, create a segmentation based on previously created aggregates and expression. It will contain four segments, each dedicated to one category. This way you will find out which of the categories is most popular. 1. Go to Decision Hub icon **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of the segmentation. 3. Click **Choose filter**. 4. Select the **Profiles** tab. 5. Select **Expressions**. 6. Find the expression created in the previous steps. 7. Choose the **Equal** operator. 8. Click the icon next to the logic operator and keep clicking until you get Choose value icon. 9. From the **Choose value** dropdown list, click the Three-dot icon icon, and then select **Aggregates**. 10. Find the aggregate for the first product category. 11. From the **Choose filter** dropdown list, select an aggregate for the same product category for which you are creating a segment. 12. From the **Choose operator** dropdown, choose **Number**, and then select **More or equal to**. 13. Next to the logical operator, in the text field, enter `1`.
With this additional condition, you ensure to include in the segment only those users who have at least 1 visit on the selected page category.
14. Create the next segments for the remaining product categories by clicking the Plus icon icon. 15. To save the segmentation, click **Save**. 16. To preview the visual form of the segmentation, click **Preview analyze**.
If you want to include a customer in more than one segment when the customer met all the conditions, you can enable the **Multi-match** toggle. Remember, however, that **this option is only available for preview proposals and cannot be used for targeting, communication or in building further analyses**.
Adjusted segmentation form
Adjusted segmentation settings
## What's next --- You can use the created segmentation on the [dashboard](/docs/analytics/analytics-dashboard) or use it as an audience in any [communication channel](/docs/campaign). You can also display personalized communicates on the website using [dynamic content](/docs/campaign/dynamiccontent) depending on the most often visited category by your customers. ## Check the use case set up on the Synerise Demo workspace --- The list below contains the aggregates from the use case with example categories created in our Synerise Demo workspace: - [Aggregate that returns the number of visits to the men shirts category](https://app.synerise.com/analytics/aggregates/15dfe25c-49d0-3f55-a148-6948ebc96de6) - [Aggregate that returns the number of visits to the men trousers category](https://app.synerise.com/analytics/aggregates/4bcc37f7-ca21-3fac-91fe-344532d1203e) - [Aggregate that returns the number of visits to the men ties category](https://app.synerise.com/analytics/aggregates/84e94e08-75df-39a7-a361-0fd1e440c726) - [Aggregate that returns the number of visits to the men polo category](https://app.synerise.com/analytics/aggregates/8850e1eb-6a9c-3147-8ad0-b306f2a55b32) In our Synerise Demo workspace you can also find the configuration of [the expression that returns the most frequently visited category by a customer](https://app.synerise.com/analytics/expressions/a2d2b9ca-dc01-484a-8c6b-b5d6d1e83f3a) and [segmentation that organizes customers according to the visits to the categories](https://app.synerise.com/analytics/segmentations/b641998d-d035-4fd4-9b57-d7829c5e1528). If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case does not generate any events. ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Expressions](/docs/crm/expressions) - [Segmentation](/docs/analytics/segmentations/creating-segmentations) # Displaying personalized recommendations before typing a search query AI search phrases that are well-built and adaptable can become a key tool enabling maximum shortening of the user's path, leading to more purchases. To enable customers to find items they need as quickly as possible, it is important to take care of the accuracy of search results, monitor its behavior and calibrate it accordingly. Various types of recommendations allow **adding** other modules with **recommended products to the search engine**.
Screenshot presenting AI search filter
AI search
--- ## Example of use - construction industry **Challenge** A client from the construction industry wanted to shorten the user's path as much as possible to find the needed product using AI search. For this purpose, the client decided to display product suggestions in the form of a list already at the stage when the user clicks on the search engine, but has not yet enter the desired phrase. The displayed offers were selected based on a personalized recommendations model. **Results** - CTR **11%** - Campaign conversion **1.4%** - Increase in the number of people using the search engine by **9%** within **21 days** from introducing the AI search modification. ## Prerequisites --- Before you start implementing this use case, you must fulfill the requirements listed below: - [Implement event tracker](/developers/mobile-sdk/event-tracking). - [Implement OG tags](/developers/web/og-tags). - [Import product feed to Synerise](/developers/product-feed). - [Track transaction events](/developers/web/event-tracking). ## Process --- To prepare such a scenario, you have to follow 2 important steps. 1. [Prepare personalized recommendations](/use-cases/ai-search-improvements#prepare-personalized-recommendations). 2. [Set up dynamic content](/use-cases/ai-search-improvements#set-up-a-dynamic-content). ## Prepare personalized recommendations --- 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. From the drop down list, choose **Catalog** based on which your recommendations will be built. 3. Choose **Personalized** as the recommendation type.
Screenshot presenting site with type and source of recommendation
Select the type of recommendation
4. In **Items** define more details about your recommendation.
You must select the minimum and maximum number of products displayed in the recommendation frame. Optionally, you can set the filters (for example, narrow down the number of items from a specific category), however, in this use case the client didn't add the filters. You can also create filters by following the instructions in [this](/docs/ai-hub/recommendations-v2/recommendation-filters) article.
## Set up a dynamic content --- To insert personalized recommendations in the search results right before a user starts typing a search phrase, use dynamic content. 1. Choose **Insert Object** type. 2. Select your **Audience**. You can target your communication to everyone or select segment of users. In our example we target communcation to **everyone**. 3. In the **Content** section, click **simple message** and specify the CSS selector where you want to insert recommendations. 4. In the **Content** tab section, click **Create message** insert Jinjava code with AI recommendation and add your own CSS.
Check the Jinjava code
<!-- Opening the tag that retrieves the value from recommendation prepared in point 1--> {% recommendations3 campaignId=xxx %} for loop below: <!-- In the section {% for r in recommended_products3 %} a {% endfor %} there is access to all variables from a given object (products here) - which parameters you add to the template depends on you. --> {% for r in recommended_products3 %} <!-- {{ r.itemId }} {{ r.title }} {{ r.imageLink }}{{r.price.value}}{{r.salePrice.value}} - parameters taken from the recommendation. The itemId is a standard name, but others (like category, price, salePrice, title, imageLink) only depend on names defined in the feed--> {{r.itemId}} {{r.title}} {{r.imageLink}} {{r.price.value}} {{r.salePrice.value}} {% endfor %} <!-- Closing of the tag that gets the value from the recommendation prepared in point 1 --> {% endrecommendations3 %}
Implementation of the script above results in displaying recommendation personalized for individual user after clicking the AI search. Remember to replace `xxx` in the `campaignID` with the ID of the recommendation you prepared in the previous steps.
6. Skip **UTM** section. 7. In **Display Settings**, define where dynamic content is shown: **Always**, **On landing**, on **All pages**. 8. In the upper right corner, click **Schedule** and **Activate** when the dynamic content has to be active. ## Check the use case set up on the Synerise Demo workspace --- You can check [recommendations](https://app.synerise.com/ai-v2/recommendations/PsDLh5DdTlk3) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 5 events per profile that completes the flow: [`dynamicContent.show`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentshow) (~1), [`dynamicContent.click`](/docs/assets/events/event-reference/dynamic-content#dynamiccontentclick) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [AI recommendation](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign) - [Dynamic content](/docs/campaign/dynamiccontent) - [Jinjava inserts](/developers/inserts/filter) - [Recommendations](/docs/ai-hub/recommendations-v2) # AI-Powered Store Locator for Finding Nearest Shops Customers are looking for solutions that maximize their benefits and allow them to meet their needs promptly. A widespread behavior among customers is to check store locations on the store page, which enables them to find a store in the most convenient location. Therefore, it is beneficial to have a solution prepared to satisfy this need. This use case describes configuring an AI search to return information about a company's store locations.
Example of store location Search Engine
## Prerequisites --- - Prepare `.CSV` file with main information regarding a store location. The file should contain required columns - **itemId** and **category** and other custom values like postal code, street address, city, and so on. You can find the requirements for the `.CSV` file format [here](/docs/assets/catalogs/creating-catalogs#requirements).
Click to see a sample CSV file

category,city,itemId,lat,lon,postalCode,state,streetAddress,streetName,streetNumber,title STORE,Washington,497,38.897,-77.0251,20073,District of Columbia,3960 Killdeer Terrace,Hanson,8,Nienow and Sons STORE,Brooklyn,69,40.6924,-73.9666,11205,New York,7720 Mockingbird Circle,Bultman,39231,Baumbach-Glover STORE,Los Angeles,742,33.9754,-118.417,90094,California,85774 Stone Corner Street,Washington,652,Grimes LLC STORE,Little Rock,197,34.6725,-92.3529,72209,Arkansas,97498 Bunting Road,Boyd,712,Frami Inc STORE,Salem,622,44.8685,-123.0438,97306,Oregon,40 Dorton Court,Esch,79,Roberts and Sons STORE,Brea,550,33.9187,-117.8892,92822,California,92 Di Loreto Street,Golden Leaf,16877,Hermann-Bergnaum STORE,Sacramento,966,38.3774,-121.4444,94207,California,7250 Green Ridge Center,Kensington,6,Jacobson-Cronin STORE,Baton Rouge,492,30.3795,-91.1671,70820,Louisiana,3351 Grim Lane,Del Mar,5638,Bahringer Inc STORE,Dallas,710,32.7673,-96.7776,75387,Texas,0 Talisman Junction,Glendale,480,"Rippin, Wiza and Borer"

## Process --- 1. Import `.CSV` file to a [catalog](/use-cases/ai-search-store-location#create-a-catalog). 2. [Configure AI Engine](/use-cases/ai-search-store-location#configure-ai-engine). 3. Create and configure [search index](/use-cases/ai-search-store-location#create-an-ai-search-index). ## Create a catalog --- In the first part of the process, import the `.CSV` file into the catalog.
Import CSV
Import CSV
1. Go to Data Modeling Hub icon **Data Modeling Hub > Catalogs > New Catalog**. **Result**: A pop-up opens. 2. Enter the name of the catalog. 3. Confirm it by clicking **Apply**. **Result**: A catalog appears on the list. Its position on the list is defined by alphabetic order (the list is arranged from Z-A). 4. Click the catalog on the list. 5. On the upper right corner, click **Import CSV** button. **Result**: A pop-up opens. 6. Click **Upload file** button. **Result**: A pop-up opens. 7. Select the file to be uploaded. Confirm with **OK**. 8. In the **Order key** field, type the name of the column whose values are treated as the key. In our case, the `itemId` value will function as the key. 9. Confirm by clicking **Import**. **Result**: Imported records are available in the catalog.
Example of a catalog
Example of a catalog
## Configure AI Engine --- In this part of the process, create and configure feed for AI engine based on the catalog created [earlier](/use-cases/ai-search-store-location#create-a-catalog).
A product feed uploaded to a catalog
A catalog configured for AI engine
1. Go to **Settings > AI engine configuration**. 2. Click **Add feed**. **Result**: A pop-up appears. 3. Select the product feed you want to use. In this case select **Catalog**. 4. On the pop-up, select the type of catalog: **Data catalog**. 5. From the dropdown list, select a catalog created in the [previous step](/use-cases/ai-search-store-location#create-a-catalog). 6. Confirm by clicking **Apply**. 7. On the list of feeds, click the feed created earlier. 8. In the **Applied search engines** tab, click **Show**. 9. Switch the **Search engines** toggle on. 10. Confirm by clicking **Apply**. 11. Click **Save**.
Launching Search Engine
Launching Search Engine
## Create an AI Search index --- In this part of the process, create an index of AI search that facilitates searching for a store by city, postal code, street address, and street name. 1. Go to AI Hub icon **AI Hub > Indexes**. 2. Click **Add index**. **Result**: The index creation screen opens. 3. In the **Index name** field, type the meaningful name of the index. 1. From the **Choose catalog** dropdown list, select an [item catalog](/use-cases/ai-search-store-location#configure-ai-engine) to use as the source for the search results.
Remember that the value of an item attribute in the item catalog cannot be longer than 1000 characters. It applies both for creating a new index and updating it.
2. From the **Choose search engine language** dropdown, select the language of your search engine. 4. Click **Next step**.
Example of basic index settings
Example of basic index settings
5. Define response and searchable attributes. More detailed information about these attributes can be found [here](/docs/ai-hub/ai-search/define-attributes/?helpCenterAi=define#response-attributes). In this case, `city`, `postal code`, `street address`, and `street name` are selected a searchable attributes, so the customer will be able to search for stores using them. 6. Click **Next step**. **Result**: The Filters & Facets screen opens. 7. Skip this step by clicking **Next step**. **Result**: The Ranking screen opens. 8. Click **Complete**. 7. The Ranking screen opens. Click **Complete**. 8. Wait until the index is ready. Refresh the page until you receive information in the upper right corner of the screen that the index is ready.
Your index is ready
Your index is ready
9. Check the results by clicking **Preview**. 10. In the search field, enter the name of the store or store location. **Result**: A list with the defined search results appears. ## What's next --- Once AI search is configured, it can be implemented in any channel, such for example a website using [dynamic content](/docs/campaign/dynamiccontent/creating-dynamic-content).
We recommend enriching the integration with a store location map. This can be achieved using public tools such as **Azure Maps**. You can find extensive documentation for Azure Maps [here](https://docs.microsoft.com/en-gb/azure/azure-maps/) or use this [quick demo application](https://docs.microsoft.com/en-gb/azure/azure-maps/quick-demo-map-app). The `.CSV` file to be used in this case must contain the longitude and latitude to create the map.
## Check the use case set up on the Synerise Demo workspace --- You can also check the [AI search configuration](https://app.synerise.com/ai-v2/search/indices/cbc43b41c46dea9f6d187e9f32b3dc7f1729689355/settings) directly in Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 2 events per profile that completes the flow: [`item.search`](/docs/assets/events/event-reference/search#itemsearch) (~1), [`item.search.click`](/docs/assets/events/event-reference/search#itemsearchclick) (~1). ## Read more --- - [AI engine configuration](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-search#selecting-attributes-for-preview) - [AI search](/docs/ai-hub/ai-search/introduction-to-ai-search) - [Catalogs](/docs/assets/catalogs) - [Dynamic content](/docs/campaign/dynamiccontent/creating-dynamic-content) # Brickworks product template with AI-based similar recommendations Presenting accurate and up-to-date product content across channels often requires combining product catalog data with dynamically generated recommendations. [Brickworks](/docs/assets/brickworks) allows you to define a product template that can pull product attributes directly from your catalog and extend it with AI-based similar products. In this use case, you will create a schema enabling templates to return: - dynamic product information coming from a Synerise catalog - dynamically computed similar products based on an AI recommendation model Additionally, this schema will serve as an in-app template derived from a template available in the Synerise Demo workspace (ID: 1590) and will be displayed directly within the application. The goal is to enable an in-app view that appears when a user adds a product to their favorites from that product’s page (triggered by the product.addToFavorite event). This view will display the selected product alongside AI-generated recommendations of similar items.
In-app message example
## Prerequisites --- - Import a product feed to Synerise. You can find instructions [here](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-search). - Implement a [tracking code](/developers/web/installation-and-configuration) into your website. - [Configure AI engine](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). - [Configure an item catalog for recommendations](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). Enable similar items recommendations. - Implement the [transaction events](/developers/web/transactions-sdk) using [SDK](/developers/web/transactions-sdk) or [API](https://hub.synerise.com/api-reference/data-management#operation/CreateATransaction). - Implement a custom event for adding a product to favorites, which will be available in the customer profile. In this example, the event is called `product.addToFavorite`. Implement custom events in your [mobile application](/developers/mobile-sdk/event-tracking#product-added-to-favorites) or [website](/developers/web/event-tracking#declarative-tracking-custom-events). ## Process --- In this use case, you will go through the following steps: 1. [Create an AI recommendatons](#create-an-ai-recommendations) with similar products. 2. [Create a schema](#create-a-schema) with similar AI recommendations. 3. [Create the record](#create-the-record). 3. [Create an in-app campaign](#create-an-in-app-campaign) based on the brickworks schema. ## Create an AI recommendations --- In this part of the process, you will configure a [similar items recommendation](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign) with context. This recommendation will later act as a reusable data source inside the schema, so any component that uses the schema will automatically access consistent recommendations. 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. Enter the name of the recommendation (it is only visible on the list of recommendation). 3. In the **Type & Items feed** section, click **Define**. 4. From the **Items Feed** dropdown list, as an item feed, select an item catalog which you configured as a part of [prerequisites](#prerequisites). 5. In the **Type** section, choose the **Similar items** recommendation type. 6. Confirm the settings by clicking **Apply**. 7. In the **Items** section, click **Define**. 8. Define the minimum and maximum number of items that will be recommended to the customer in each slot. 9. Optionally, define [Static filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#static-filters) and [Elastic filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#elastic-filters). 10. Confirm by clicking **Apply**. 8. Optionally, you can define the **Boosting** factors. 9. In the right upper corner, click **Save**. ## Create a schema --- In this section, you will [create a Brickworks schema](/docs/assets/brickworks/quick-start/creating-a-schema) with fields for product information and AI recommendations. The schema acts as a structured container for all data that will later be displayed to users in different channels. By defining fields here, you create a single place where product-related information is stored, updated, and reused across templates, campaigns, and runtime contexts. 1. Go to **Data Modeling Hub > Schemas > New schema**. 2. Choose **Simple Schema**. 3. Enter a name for the schema, in **Display name** for example **Product template**. **API names** value is pre-filled with the value from Display name. The value in this field is the unique identifier used to reference this schema in API requests. 4. Optionally, fill in the **Description** field. ### Add Product Name 5. Click **Add new field** and choose **String** 3. Complete the fields: - Add **Display name** for the field in our case `Product name`. - **API name** will be pre-filled automatically. 4. Set the field as **Required** by selecting the **Required field** checbox. 5. To save your changes, click **Apply**.
Brickworks schema field configuration showing Product name string field
Brickworks configuration
### Add Item ID 5. Click **Add new field** and choose **Jinjava code** 3. Complete the fields: - Add the **Display name** for the field in our case `Item ID`. - The **API name** will be pre-filled automatically. 4. Check the **Cast to** field. By default, Jinjava output is cast to string. Use this option to cast the result to another type (number, boolean, JSON). 5. Choose type as the `Integer`. 5. To save your changes, click **Apply** .
Brickworks schema field configuration showing Item ID Jinjava field
Brickworks configuration
### Add Product Catalog 5. Click **Add new field** and choose **Catalog**. 3. Complete the fields: - Add the **Display name** for the field in our case `Product Catalog`. - The **API name** will be pre-filled automatically. 4. From the catalogs list, choose the catalog with the product feed which you imported as a part of [prerequisites](#prerequisites) 5. Optionally you can enter the primary key used to identify items in the catalog (string or JINJAVA). In this case it will be Jinjava primary key with the value: `{{ record.itemid }}`. 5. Click **Apply** to save your changes. ### Add the AI Recommendations 5. Click **Add new field** and choose **AI Recommendations** 3. Complete the fields: - Add the **Display name** for the field in our case `Similar Products`. - The **API name** will be pre-filled automatically. 4. Choose from the list AI Recommendations created in the [previous step](#create-an-ai-recommendations) 5. Enter the Product context - Item ID passed as context for recommendations. In pur case it will be Jinjava primary key with the value:`{{ record.itemid }}`. It is required in similar/complementary campaigns. Optional in personalized ones. 5. To save your changes, click **Apply**.
Brickworks schema field configuration showing Similar Products AI recommendations field
Brickworks configuration
### Set up the Audience & Settings 1. Click the **Audience & Settings** tab. 2. In the **Audience** section, click **Define**. 3. Choose the schema recipients, in our case, choose **Everyone**. 4. Click **Apply**. 5. In the upper-right corner, click **Save.** ## Create the record --- [Creating a record](/docs/assets/brickworks/quick-start/creating-a-record) means adding the data to the schema. It means that you fill out schema fields with the actual values. This step fills the structure you created earlier with real data that will be rendered to the user. Anything you enter here becomes the source of truth for templates, recommendations, and dynamic elements across your communication channels. By storing product-specific information inside the record, you ensure that all in-app messages, PDP blocks, or emails referencing this schema always draw from the same, consistent data set. 1. Go to **Data Modeling Hub > Data collection > Select schema**. 2. Choose [schema created in the previous part of the process](#create-a-schema). 3. Click **Add record**. 4. Add a name for the reocrd. 5. Add a slug for the reocrd. Slug is a unique, URL-friendly version of the name. It usually contains only lowercase letters, numbers, and hyphens. In our case it will be `dynamic`. 6. As an itemId add `{{ context.itemid }}`. 7. Click **Publish** to publish your record. ### Previewing records After saving the record either as a draft (in case of records created based on versioned schemas) or publishing it (in case of both schema types), you can [preview the record](/docs/assets/brickworks/quick-start/creating-a-record#previewing-records) for the context of a selected user. This context-driven approach enables your records to adapt dynamically based on the requesting application, user session, or any external factors you define. 1. Go to **Data Modeling Hub > Data collections**. 2. In the header, from **Select schema* dropdown list, select the [schema](#create-a-schema) created previously. 3. Find the record which you want to preview. 4. Enter the record configuration. 5. Click the **Preview context**. 6. From the dropdown list, find a profile for whom you want to generate record preview. This means the same record can render completely differently depending on the context you provide. 6. Click **Add parameter** and choose the parameter from your catalog you want to preview, in our case it will be `itemid`. As the value of this field add the example itemid value for exemplary product.
Brickworks record preview context with itemid parameter configuration
Brickworks configuration
**Result**: You will see the dynamic preview with the data about the specific product from your catalog.
Brickworks record dynamic preview showing product data from catalog
Brickworks configuration
What is more you can see what similar recommendations will be generated for this specific product for the choosen user.
Brickworks record preview showing similar AI recommendations for a product
Brickworks configuration
## Create an in-app campaign --- In this part of the process, you [create an in-app campaign](/docs/campaign/in-app-messages/create-inapp-message) triggered by the `product.addTofFavorite` event. We will use a template available on the Demo Workspace (1590), so there is no need to create a template from scratch, you can copy the template to your workspace and use it. 1. Go to Experience Hub icon **Experience Hub > In-app messages> Create in-app**. 2. Enter the name of the in-app. ### Define the audience --- As the first step, define the target group of customers for the in-app message. 1. In the **Audience** section, click **Define**. 4. Click **Everyone**. 8. To save the audience, click **Apply**. ### Define content --- In this part of the process, you will create the content of the in-app message that will appear in the mobile application with the help of ready-made template. 1. In the **Content** section, click **Define**. 2. Click **Create message**.
We’re using a ready-made template available in the 1590 Synerise Demo workspace. You can use this template as a base and copy it into your own workspace.
**Result:** You are redirected to the code editor.
You can edit the template in two ways, by editing the code of the template [add snippets](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-snippet-to-the-template-code), [add variables](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-variable) and/or by filling out the form in the Config tab. In this use case, we will use the capabilities of the predefined Config tab.
#### Edit form in the Config tab --- The form in the **Config** tab is already filled in with default values. You can keep them or change them to fit your business needs.
Brickworks in-app Config tab with Schema ID, Record ID, and ContextID fields
In-app configuration
1. To the **Schema ID** field, add the ID of the [schema created as the part of prerequisites](#create-a-schema). You can find schema ID in the URL of the schema. 2. To the **Record ID** field, add the ID of the [record created as the part of prerequisites](#create-the-record). You can find the record ID in the URL of the record. 3. To the **ContextID** field, insert a value of the context parameter of the product used in the record. In our case it will be an example itemid for example: `e579487933852f3a83abd9e840175c`. 3. You can optionally edit the copy and design of the template. 10. After you make changes to the template, you can check the preview. 1. Click the **Preview** button on the upper left side. 2. Enter the ID of a customer. 3. Click **Apply**.
Considering that the in-app is very interactive, the preview in the platform may not be enough to test the in-app performance. That’s why we suggest checking the preview directly in the mobile app.
11. If the template is ready, in the upper right corner click **Save this template > Save as**. 12. On the pop-up: 1. In the **Template name field**, enter the name of the template. 2. From the **Template folder** dropdown list, select the folder where the template will be saved. 3. Confirm by clicking **Apply**. 13. To continue the process of configuring the in-app campaign, click **Next**. 14. To save your content changes, click **Apply**. ### Select events that trigger the in-app message display --- In this part of the process, you will define the event triggering the display of the in-app message. 1. In the **Trigger events** section, click **Define**. 2. Select **Add event** and from the dropdown list, choose `product.addTofFavorite` event. 3. Click the **+ where** button and select `mobile`. 4. As the logical operator, select **Exists**. 5. Click **Apply**. ### Schedule the message and configure display settings --- As the final part of the process, you will set the display settings of the in-app message such as schedule, capping, priority of the message among other in-app messages. 1. In the **Schedule** section, click **Define** and set the time when the message will be active. 2. In the **Display Settings** section, click **Change**. 3. Define the **Delay display**, **Priority index** and enable the **Frequency limit** toggle to manage the frequency of in-app message display in the application. In our case, we want to display the message to the customer a maximum of 1 time in period of 7 days.
You can additionally enable the **Capping limit** toggle to limit the amount of time the in-app message can be displayed to a user in general.
16. Click **Apply**. 17. Optionally, you can define the UTM parameters and additional parameters for your in-app campaign. 18. Click **Activate**. ## What's next --- After defining this schema, you can reuse the template across other placements as needed. It can be applied not only in PDP blocks, emails, or in-app views, but also in any additional surfaces supported by your setup—for example homepage modules, product carousels, or campaign-specific placements. This allows you to keep product data consistent while still generating similar items dynamically. ## Check the use case set up on the Synerise Demo workspace --- In Synerise Demo workspace, you can check the configuration of: - [Similar Recommendation](https://app.synerise.com/ai-v2/recommendations/Qgt7QWHu35ZB) - [Brickwork schema](https://app.synerise.com/assets/brickworks/schemas/4f90172f-2439-4e32-9588-77a156a8c6e1) - [In-app campaign](https://app.synerise.com/communications/in-app/7f5cc48e-d9d2-4bac-97cc-fb2384d358d1) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 7 events per profile that completes the flow: [`product.addToFavorite`](/docs/assets/events/event-reference/items#productaddtofavorite) (~1), [`inApp.show`](/docs/assets/events/event-reference/inapp#inappshow) (~1), [`inApp.click`](/docs/assets/events/event-reference/inapp#inappclick) (~1), [`brickworks.generated`](/docs/assets/events/event-reference/brickworks#brickworksgenerated) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Brickworks](/docs/assets/brickworks) - [In-app messages](/docs/campaign/in-app-messages) - [Recommendations](/docs/ai-hub/recommendations-v2) # Use Countdown Timers in Email Campaigns to Drive Sales with Sendtric Countdown timers in email campaigns are a proven way to create urgency, boosting engagement and driving conversions for limited-time offers. In this use case, we will describe how to send an email campaign for a 48-hour special sale. To emphasize urgency, it will embed a live countdown timer created using Sendtric. This visual element dynamically updates in real-time, showing customers how much time remains to take advantage of the sale, increasing click-through and purchase rates. ## Prerequisites --- - [Email account](/docs/campaign/e-mail/configuring-email-account) configured. - Create an account on [Sendtrick](https://www.sendtric.com/). - In Sendrtick, configure a timer. You can personalize it based on your business needs. Copy the timer's code for use later in the process. - Create a segmentation for the target audience. ## Prepare an email campaign --- In this part of the process, you create an email campaign, targeted to [the segment you created in the prerequisites](#prerequisites) with the countdown prepared as a part of [prerequisites](#prerequisites) 1. Go to Experience Hub icon **Experience Hub > Email campaign > Create new**. 2. In the **Audience** section, choose the segment created in the [prerequisites](#prerequisites) 3. Configure the **Content** section. 1. Choose the email account from which you want to send your message. 2. In the **Subject** field, enter your message subject. 2. Click **Create message** and create or choose an email template from default projects. ### Create the email template using Visual Builder --- 1. Prepare the email template based on your business needs. 2. Drag and drop the **Image** component where you want the countdown to appear. 3. In the image settings, in the **URL** field, paste the image address from the Sendtric code generated when you created the timer. The address is in the `src` parameter of the code. 6. Apply the changes. **Watch the video below to see how to add the sendtric code step by step.**
Sendtric
### Create the email template using Code Editor --- 1. Prepare the email template based on your business needs. 2. Insert an **img** tag into your email template at the desired location:
The countdown
Remembert to replace **URL** and paste the image address from the Sendtric code generated when you created the timer. 3. Save your changes. ### Add additional settings --- 4. In the **Schedule** section, specify the time when you want to send your communication. 4. Optionally, you can define **UTM & URL parameters**. If you don't need them, click **Skip step**. 4. Confirm by clicking **Apply**. ## Check the use case set up on the Synerise Demo workspace --- Check the [email campaign settings](https://app.synerise.com/campaigns/email/create/6c598f2a-96c1-4a13-bd85-c477c313a284) in the Synerise Demo workspace. If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 3 events per profile that completes the flow: [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1). ## Read more --- - [Creating emails](/docs/campaign/e-mail/creating-email-campaigns) - [Jinjava inserts](/developers/inserts/insert-usage) - [Personalized recommendations](/docs/ai-hub/recommendations-v2/recommendation-types#personalized) - [Segmentation](/docs/analytics/segmentations/creating-segmentations) # Enhance personalized recommendations by applying filter with aggregate
Use Case - Customer's context filter in recommendations
--- Personalized recommendations is a great way to enhance customers experiences while serving them with products tailored for their preferences. With Synerise, you can go a step further and narrow those already personalized recommendations to product attributes specific for each customer. These can be cusomers' favorite color, style, size, or any other attribute. By enhancing personalized recommendations with those attributes, you can increase customers engagement, boost conversion rates and foster brand loyalty. In this use case we will create a set of personalized product recommendations based on recently seen styles for customers who have not made a purchase in the last 30 days and send these recommendations through email. This use case provides you with an instruction how to use a ready-made email template that can be used 1:1 in a business scenario. ## Prerequisites --- - Implement a [tracking code](/developers/web/installation-and-configuration) into your website. - [Import an item catalog for recommendations](/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations). Enable Personalized recommendations. - [Implement OG tags](/developers/web/og-tags), in this use case we use `product:style`. You can implement any other data on which you want to base the aggregate. - Configure a [sender account](/docs/campaign/e-mail/configuring-email-account). ## Process --- In this use case, you will go through the following steps: 1. [Create an aggregate](#create-an-aggregate) returning the top style of products visited by customer, it will be used in the recommendation configuration. 2. [Prepare an AI recommendation](#prepare-an-ai-recommendation). 3. [Prepare an email template](#prepare-an-email-template) with recommendation. 4. [Create a workflow](#create-a-workflow). ## Create an aggregate --- In this part of the process, create an aggregate that returns the most frequently seen style of products by a customer in the last 24 hours. Those products will not be displayed in the template, but the aggregate result will serve as a context for recommendations. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter the name of the aggregate. 3. Click **Analyze profiles by** and select **Top**. 4. From the **Choose event** dropdown list, select the **Visited page** event. 5. As the event parameter, select **product:style**. 6. Click the **+ where** button. 7. From the **Choose parameter** dropdown list, select the **product:style** parameter. 8. From the **Choose operator** dropdown list, select **Is true (Boolean)**. 9. Using the date picker in the lower-right corner, set the time range to **Last 24 hours**. Confirm your choice with the **Apply** button. 7. Click **Save**.
The view of the configuration of the aggregate returning top styles in the last 24 hours
Configuration of the aggregate returning top styles in the last 24 hours
## Prepare an AI recommendation --- In this part of the process, you will configure a personalized recommendation which will be later used in the email template. This recommendation will suggest items based on the [results of the aggregate created in the previous step](#create-an-aggregate). 1. Go to AI Hub icon **AI Hub > (AI Recommendations) Models > Add recommendation**. 2. Enter the name of the recommendation (it is only visible on the list of recommendation). 3. In the **Type & Items feed** section, click **Define**. 4. From the **Items feed** dropdown list, select an item feed. 5. In the **Type** section, choose the **Personalized** recommendation type. 6. Confirm the settings by clicking **Apply**. 7. In the **Items** section, click **Define**. 1. Click **Add slot**. 2. Define the minimum and maximum number of items that will be recommended to the customer in each slot. 3. Click **Define filter** in the [Static filter](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#static-filters) section, and from the dropdown list choose **Visual Builder**. 4. From the **Select attribute** dropdown list, choose **style**. 5. From the **Operator** dropdown list, select **Equals**. 6. Change the **Value** atribute to **Aggregate**. 7. From the **Select value** dropdown list, select the [aggregate created in the previous step](#create-an-aggregate). 8. Click **Apply**.
The view of the configuration of the static filter
Configuration of the static filter
9. Optionally, define [Elastic filters](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign#elastic-filters). 10. Click **Apply**. 8. Optionally, you can define the **Boosting** factors and settings in the **Additional settings** section. 9. In the right upper corner, click **Save**. ## Prepare an email template --- In this part of the process, you will create an email template. We will use a predefined template for the personalized recommendations, so there is no need to create a template from scratch. If you want to create a template from scratch, you can use the following email builders: - [email template builder](/docs/campaign/e-mail/creating-email-templates/email-code-editor) - [basic drag & drop builder](/docs/campaign/e-mail/creating-email-templates/creating-custom-html-block-basic-builder). 1. Go to Experience Hub icon **Experience Hub > Email**. 2. On the left pane, click **Templates** and from the list of template folders, select **Predefined dynamic templates**. 3. Select the **Recommended products** template. **Result:** You are redirected to the code editor.
You can edit the template in two ways, by editing the code of the template ([add inserts](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-snippet-to-the-template-code), [add variables](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#adding-a-variable) and/or by filling out the form in the Config tab. In this use case, we will use the capabilities of the predefined Config tab.
### Edit form in the Config tab --- The form in the **Config** tab is pre-filled with default values, which you can modify to suit your business needs. 1. In the **Logo** section, you have the option to customize the logo's height, link, title, and image source. 2. In the **Main image** section, you can specify the height, link, title, and the source of the main image. 4. In the **First recommendation header** section, you can type the header you want to display and define the background and font colors. 5. In the **First recommendation products** section: 1. Set the value in the **Number of product in row** field. 1. From the **Recommendation id** dropdown list select the [recommendation you prepared in the previous step](#prepare-an-ai-recommendation). You can find it by typing its name or ID in the search box. 2. Customize the **Product name font color**, **Font color**, **Button font color**, **Button background color**, **Button border radius** and **Button text** options. 6. Optionally, repeat steps 3-4 for **Second recommendation header** and **Second recommendation products** and configure **Category section**, **Contact section**, **Social media** and **Footer** or hide them by switching off the respective toggle.
To preview the template without switched off sections, use the **Preview Contexts** option.
7. After you make changes to the template, you can check the preview. 1. Click the **Preview Contexts** button on the upper left side. 2. Enter the ID of a customer. 3. Click **Apply**. 8. If the template is ready, click the arrow next to **Use in communication** in the upper right corner, and from the dropdown select **Save as**. 9. On the pop-up: 1. In the **Template name field**, enter the name of the template. 2. From the **Template folder** dropdown list, select the folder where the template will be saved. 3. Confirm by clicking **Save**. ## Create a workflow --- In this part of the process, you will create a workflow which sends emails with personalized recommendations to customers, triggered when they finish their session on the site. The email will be sent maximum once a month, to customers who did not made a purchase in the last 30 days. 1. Go to Automation Hub icon **Automation Hub > Workflows > New workflow**. 2. Enter the name of the workflow. ### Define the trigger node --- The workflow is triggered for specific group of customers every day at a defined time. In our case - customers with email marketing agreement who have not made a transaction, and for whom the [the results of the aggregate created in the previous step](#create-an-aggregate) is valid. 1. As the first node, add the **Audience** node. 2. In the configuration of the node, set the **Run trigger** option to **repeatable**. 3. Set the interval to 1 per day. 4. Choose the day and time when the process starts. 5. Select the time zone. 6. In **Define audience**, choose **New Audience** and click **Define conditions**. 1. As the first condition, from the **Choose filter** dropdown menu, choose **Email agreement** attribute. 2. From the **Choose operator** dropdown list, select **Is true (Boolean)**. 3. As the second condition, from the **Choose filter** dropdown menu, choose the [aggregate created in the previous step](#create-an-aggregate). 4. From the **Choose operator** dropdown list, select **Is true (Boolean)**. 5. As the third condition, from the **Choose filter** dropdown menu, choose the `transaction.charge` event, and change condition to **not matching**. 6. Using the date picker in the lower-right corner, set the time range to **Custom** and set to **30 days**. Confirm your choice with the **Apply** button.
The view of the configuration of the Audience trigger node
Configuration of the Audience trigger node
7. Click **Apply**. 7. Click **Apply**. ### Define the Send Email node --- 1. Add the **Send Email** node. In the node settings: 1. In the **Sender details** section, choose the email account from which the email will be sent. 2. In the **Content** section, type the **Subject** and from the **Template** dropdown, select [the template you created in the previous step](#prepare-an-email-template). 3. In the **UTM & URL parameters** section, you can define the UTM parameters added to the links included in the email. 4. In the **Additional parameters** section, you can assign [additional parameters](/docs/campaign/e-mail/creating-email-campaigns#adding-custom-parameters) to the events generated by sending and interacting with this email. 2. Click **Apply**. ### Add the finishing node and set capping --- 1. Add the **End** node. 2. In the upper right corner, click **Set Capping** and define the limit of workflows a profile can start: 1. Set **Limit** to 1. 2. Set **Time** to 1 month. 2. In the upper right corner, click **Save & Run**.
Automation Hub workflow for filtering AI recommendations
Workflow configuration
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of each step directly in Synerise Demo workspace: - [Aggregate](https://app.synerise.com/analytics/aggregates/7523f982-51b6-3a28-8fbf-183613936caf) - [Personalized Recommendation](https://app.synerise.com/ai-v2/recommendations/qu78KmoKeviP) - [Workflow](https://app.synerise.com/automations/automation-diagram/87212121-30f6-437d-9c39-df60aa492efe) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case generates approximately 9 events per profile that completes the flow: [`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~1), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1), [`message.send`](/docs/assets/events/event-reference/email#messagesend) (~1), [`newsletter.open`](/docs/assets/events/event-reference/email#newsletteropen) (~1), [`newsletter.click`](/docs/assets/events/event-reference/email#newsletterclick) (~1), [`recommendation.generated`](/docs/assets/events/event-reference/recommendations#recommendationgenerated) (~1), [`recommendation.view`](/docs/assets/events/event-reference/recommendations#recommendationview) (~1), [`recommendation.click`](/docs/assets/events/event-reference/recommendations#recommendationclick) (~1). ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Automation Hub](/docs/automation) - [Email templates](/docs/campaign/e-mail/creating-email-templates) - [Recommendations](/docs/ai-hub/recommendations-v2) - [Segmentation](/docs/analytics/segmentations) # Propensity-based customer segmentation This use case is a short continuation of the [Propensity - brand](/use-cases/propensity-brand) use case and it describes the process of creating a segmentation based on the score of the propensity prediction. The result of the segmentation shows the assignment of customers to the likelihood of purchase of particular products. ## Prerequisites --- - Add a [tracking code](/developers/web/installation-and-configuration) to your website. - Create a [Propensity prediction](/use-cases/propensity-brand) that produces the 5-point score (very low, low, medium, high, and very high). - Make a note of the `modelId` parameter (available in the parameters of the `snr.propensity.score` event).
Click to see where to find modelId
Conditions of the segmentation
Conditions of the segmentation
## Process --- In this use case, you will go through the following steps: 1. [Create an aggregate](/use-cases/segmentation-propensity-based#create-an-aggregate). 2. [Create a segmentation](/use-cases/segmentation-propensity-based#create-segmentation). ## Create an aggregate --- As the first part of the process, create an aggregate that returns the latest score of the propensity prediction of a specific model. 1. Go to Behavioral Data Hub icon **Behavioral Data Hub > Live Aggregates > Create aggregate**. 2. As the aggregate type, select **Profile**. 2. Enter a meaningful name of the aggregate. 2. Set **Analyze profiles by** to **Last**. 3. Select the **snr.propensity.score** event. 4. As the event parameter, select **score_label**. 5. Click **+ where**. 6. From the **Choose parameter** dropdown list, select **modelId**. 7. As the logical operator, select **Equal**. 8. In the text field, enter the value of the modelId parameter. 9. As the date range, select **Lifetime**. 10. Save the aggregate.
Conditions of the aggregate
Conditions of the aggregate
## Create segmentation --- 1. Go to **Decision Hub > Segmentations > New segmentation**. 2. Enter the name of the segmentation. 3. By clicking **Add segment** add five segments and name each of them as follows: `Very low`, `Low`, `Medium`, `High`, `Very high`.
Very low
  1. Click Have property....
  2. Select the aggregate you created in the previous step.
  3. As the logical operator, select EQUAL.
  4. In the text field, enter `Very low`
Low
  1. Click Have property....
  2. Select the aggregate you created in the previous step.
  3. As the logical operator, select EQUAL.
  4. In the text field, enter `Low`
Medium
  1. Click Have property....
  2. Select the aggregate you created in the previous step.
  3. As the logical operator, select EQUAL.
  4. In the text field, enter `Medium`
High
  1. Click Have property....
  2. Select the aggregate you created in the previous step.
  3. As the logical operator, select EQUAL.
  4. In the text field, enter `High`
Very high
  1. Click Have property....
  2. Select the aggregate you created in the previous step.
  3. As the logical operator, select EQUAL.
  4. In the text field, enter `Very high`
Conditions of the segmentation
Conditions of the segmentation
### Preview segmentation 1. Click **Show preview**. You receive the number of customers in each segment and the percentage of each segment in relation to the whole population in the segmentation. 2. Additionally you can change the chart type - pie chart and column chart. You can also export the information to CSV/XLSX (data) or JPEG/PNG/PDF (chart).
Preview of the segmentation
Preview of the segmentation
## Check the use case set up on the Synerise Demo workspace --- You can check the configuration of every element of this process directly in Synerise Demo workspace: - [Aggregate](https://app.synerise.com/analytics/aggregates/930e05c6-ec5f-3ade-a00b-c638a0f5bb0b) - [Segmentation](https://app.synerise.com/analytics-v2/segmentations/07e00c22-e99c-4f95-b201-4124e703bd5c) If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace. If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business. ## Generated events This use case does not generate any events. ## Read more --- - [Aggregates](/docs/crm/aggregates) - [Segmentation](/docs/analytics/segmentations)