Download - Kentico 8 EMS API Deep Dive
![Page 1: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/1.jpg)
Kentico EMS API Deep Dive
by Brian McKeiver, Kentico MVP & Co-Owner at BizStream
part of the Kentico User Group webinar series
![Page 2: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/2.jpg)
Let’s Get This Party Started
http://kenticousergroup.org/
![Page 3: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/3.jpg)
Goals• Gain familiarity with the Online Marketing API in
Kentico• Work within the Kentico framework and not
around it• Take away a few tips for Kentico optimization
![Page 4: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/4.jpg)
Base Assumptions• Intermediate to advanced experience with C#
• Intermediate to advanced experience with Kentico API
• Understand core pattern of InfoObject and InfoProvider UserInfo u= UserInfoProvider.GetUserInfo(“mcbeev”);
![Page 5: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/5.jpg)
Kentico Online Marketing Feature Set
![Page 6: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/6.jpg)
The First Thing To KnowMake it upgrade safe!
Isolate your code away from Kentico’s code
Register classes or ModuleLoaders using the Kentico convention:
http://www.mcbeev.com/.../Registering-Custom-Classes-in-Kentico-8
![Page 7: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/7.jpg)
Web Analytics
![Page 8: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/8.jpg)
Log Via JavaScript
1. Server adds JavaScript snippet to
page3. Web service logs hits
asynchronously
2. Page executing async call to Kentico web
service (using JavaScript)
4. Hits processed
standard way
version 7.0.17 or newer!Enabled by default in
8.x!
![Page 9: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/9.jpg)
API BasicsCMS.WebAnalytics contains most of the APIs you need.
![Page 10: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/10.jpg)
Demo
![Page 11: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/11.jpg)
Custom Metrics for Web AnalyticsDon’t forget you can make your own Custom Report since (4.x)
with a custom set of Custom Metrics if you need them
Examples:Emails sent per monthNew user sign-ups per week
https://docs.kentico.com/display/K82/Creating+reports
![Page 12: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/12.jpg)
Activity Tracking
![Page 13: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/13.jpg)
Website Behavior
![Page 14: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/14.jpg)
Custom Activity Tracking
![Page 15: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/15.jpg)
Result
http://www.mcbeev.com/.../How-to-Connect-Comments-to-Kentico-Activity-Tracking
![Page 16: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/16.jpg)
Marketing Automation
![Page 17: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/17.jpg)
Marketing Automation Process
Action
![Page 18: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/18.jpg)
Contact Actions
ContactAutomationAction gives you the Contact context you need
http://www.mcbeev.com/.../Kentico-8-Marketing-Automation-Sample-Code-Snippets
![Page 19: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/19.jpg)
Contact Actions
AutomationAction gives you the no context but (in theory) is faster to execute. Use this for general actions that don’t need the current contact data.
http://www.mcbeev.com/.../Kentico-8-Marketing-Automation-Sample-Code-Snippets
![Page 20: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/20.jpg)
Custom Triggers
https://docs.kentico.com/.../Handling+marketing+automation+triggershttp://www.mcbeev.com/.../Increase-Subscribers-with-Marketing-Automation
using CMS.Base;using CMS.Automation;using CMS.DataEngine;using CMS.OnlineForms;using CMS.OnlineMarketing;using CMS.WebAnalytics; [TriggerHandler]public partial class CMSModuleLoader{ /// <summary> /// Custom attribute class /// </summary> private class TriggerHandler : CMSLoaderAttribute { /// <summary> /// Called automatically when the application starts /// </summary> public override void Init() { // Assigns a handler to the AutomationEvents.ProcessTrigger.Before event AutomationEvents.ProcessTrigger.Before += ProcessTrigger_Before; } } }
![Page 21: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/21.jpg)
Macros
![Page 22: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/22.jpg)
Macros – Personas / GroupsOnlineMarketingContext.CurrentContact.GetPersona()
OnlineMarketingContext.CurrentContact.IsInPersona(“DigitalMarketer”)OnlineMarketingContext.CurrentContact.IsInContactGroup(“USAContacts")
{% PersonaDocumentWhereCondition %}
![Page 23: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/23.jpg)
Macros – Scoring
OnlineMarketingContext.CurrentContact.GetScore("ClickedLinkInNewsletter")
![Page 24: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/24.jpg)
More Useful MacrosOnlineMarketingContext.CurrentContact.FirstActivityOfType(“formsubmission")
OnlineMarketingContext.CurrentContact.LastActivityOfType(“formsubmission")
OnlineMarketingContext.CurrentContact.Orders.Exists(OrderTotalPrice > 42.42)
And more…https://docs.kentico.com/display/K82/On-line+marketing+macros
![Page 25: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/25.jpg)
Macros – High Volume Scoring/Groups
“By default in 8.x, custom macro rules that are used in scoring and contact group conditions
evaluate individually for each contact” – slow for high volume of contacts
![Page 26: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/26.jpg)
The Issue
![Page 27: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/27.jpg)
Macro Rule Translator to the RescueHow to Resolve - K82 Docs Link
1. Create a new macro rule in admin2. Create custom macro rule translator class3. Macro rule translator logic needs to return ObjectQuery<ContactInfo>4. Register an instance of MacroRuleMetadata - tells the system to run recalculate
on specific Activity or Attribute only
![Page 28: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/28.jpg)
Macro Rule
![Page 29: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/29.jpg)
Demo time
![Page 30: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/30.jpg)
Result
![Page 31: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/31.jpg)
Proof
![Page 32: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/32.jpg)
Ouch
![Page 33: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/33.jpg)
Conclusion
![Page 34: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/34.jpg)
Remember• We learned about the Online Marketing API in
Kentico• How to work within the Kentico framework• Saw a few tips for Kentico optimization
![Page 35: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/35.jpg)
Q&A
?
![Page 36: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/36.jpg)
Next RoundSign up for the next webinar by Avastone on Sept 16.
http://kenticousergroup.org/
![Page 37: Kentico 8 EMS API Deep Dive](https://reader036.vdocuments.us/reader036/viewer/2022062503/58a689f41a28ab31478b4839/html5/thumbnails/37.jpg)
Brian McKeiver, Co-Owner, BizStreamPhone: (616) 481-1631E-mail: [email protected]
@mcbeev
www.linkedin.com/in/brianmckeiver