Running marketing (campaigns, promotions) on Social media platforms such as, Facebook, Google+, Twitter to name a few, have been there for quite some time now. A large no of small and medium businesses use these platforms to reach to a customer which is lot cheaper compared to other more conventional mode of advertising. More ever the reach of social media is so huge that it becomes almost impossible to match that with other forms of advertising.
The end goal of any marketing effort is to generate sales. Although social media is a useful marketing tool, it is often difficult to quantify to what extent it is contributing to profit. ROI can be measured by comparing marketing analytic value to contact database or CRM and connect marketing efforts directly to sales activity.
This blog showcases one such scenario where a promotion on Facebook can be used to create marketing lead in SAP Cloud for Customer system. Another real life scenario can be creating service tickets based on customer complaints posted via the company twitter handle (Will try to come up with a blog in near future..)
The application has 3 major components
- Facebook: the social media platform where we run a promotion
- SAP Cloud for Customer : where the Marketing leads are created based on Facebook like event
- HANA Cloud platform : Acts as a middleware integrating Facebook with SAP Cloud for Customer
To use this application we would need an app on Facebook with an associated page where promotions are run by the company. This Facebook app subscribes to an application running on HANA Cloud Platform and sends data in near real-time about feeds and events (like event for this case). Based on the data HANA Cloud Platform queries Facebook to get user details and creates Marketing lead on SAP cloud for Customer.
Important high level technical details:
- This application uses Facebook feature to receive API Updates in Real-Time. For more information about Facebook real-time updates please refer
to the link here.
- Up on receiving the Facebook real-time updates the HCP app uses Facebook graph API to get relevant user details
- Then using SOAP with Attachments API for Java (SAAJ) creates marketing lead in SAP cloud for customer
- For JSON data parsing, Java API for JSON Processing available with JDK 1.7 onwards, is used
How to deploy and use the project?
Note: Make sure all the prerequisite are met as mentioned in the README file at the github link below
- Download the source code from this SAP github link.
- Import as a maven project into eclipse
- Provide all the required values in the local.properties under directory WebContent/WEB-INF (Note: The VERIFY_TOKEN can be any arbitrary string which will be later used to register real time updates for your Facebook app )
- Run maven build (clean install)
- Deploy the application to HANA Cloud Platform account
- As a final step register the FBCallBackApp servlet URL with Facebook app for real time subscription (example URL: https://<appname><account
name>.hana.ondemand.com/<project root context>/FBCallBackApp/)
The End2End application flow
Step 1: User likes a promotion created on Facebook page
Step 2: Marketing Lead is created in SAP Cloud for Customer. We can see information like user name and email address are captured from Facebook (using proper access tokens) and populated in marketing lead.
Step 3: The above Lead can also be found in the application log on HANA Cloud Platform
Step 4: Optionally you can see all the Leads generated from the HCI application start page
Since the application on HCP connects to SAP Cloud for Customer system, it will not work on HCP trial accounts because of proxy infrastructure. You should run this application on productive HCP account (at https://account.hana.ondemand.com)
That’s it for this blog. Download, build run and enjoy!!! Try extracting more information from Facebook and update the marketing lead service on SAP Cloud for Customer.
For those who are not familiar with Facebook app token please read the follow-up blog here.