Cuadro de Cuentas
VENTAS E INGRESOS POR NATURALEZA
Of course, Marketing Campaigns can only be effective when you also do something with the results. OpenERP offers analysis features to help you better manage future campaigns based on the outcome of past campaigns. Learning from your results, that is.
The Marketing → Reporting → Campaign Analysis report allows you to analyse your campaigns in detail, both ongoing and completed campaigns.
Segments allow you to keep good track of the results of a marketing campaign. You can see from which segment you have most demands, for instance.
Thanks to good insights in the way your respondents answer to your campaign, you can continuously improve your marketing results!
89
Automating your Lead Acquisition
10
Through your website, your company wants to get as much information as possible about the people who visit the website. But how can you make sure that every person who wants to know more about your company is actually registered somewhere?Well, you could use a Contact form for this. And precisely such a form allows you to register contacts automatically in OpenERP. By creating a link from your website’s Contact form to OpenERP, your contact data will automatically be created in the CRM (or any other application of your choice, such as HR).
Let us show you an example of how this can be achieved. The figure below shows a Contact form on a website.
Figure 10.1: Contact Form on your Website
All data entered in this form are linked to the Lead form in the CRM. Each time someone enters this contact form, a new lead is automatically created in OpenERP.
Such a system is a very easy yet flexible way of keeping track of your leads and automatically launch your marketing campaigns.
10.1 How to Link a Web Contact Form to OpenERP?
OpenERP is accessible through XML-RPC interfaces, for which libraries exist in many languages. Python example
import xmlrpclib # ... define HOST, PORT, DB, USER, PASS url = ‘http://%s:%d/xmlrpc/common‘ % (HOST,PORT) sock = xmlrpclib.ServerProxy(url) uid = sock.login(DB,USER,PASS) print “Logged in as %s (uid:%d)” % (USER,uid) # Create a new lead url = ‘http://%s:%d/xmlrpc/object’ % (HOST,PORT) sock = xmlrpclib.ServerProxy(url) args = { ‘name’ : ‘A New Lead’, ‘description’ : ‘This is a new lead from the web contact form’, ‘inventor_id’: uid, } lead_id = sock.execute(DB,uid,PASS,’crm.lead’,’create’,args)
PHP Example
<?php include(“xmlrpc.inc”); // XMLRPC library file $xmlrpc_internalencoding = ‘UTF-8’; $error=””;
class Lead {
function createLead($usr, $pass, $database, $server, $data) { // Function for creating new lead in CRM
// Define variable which is used most frequently $user = $usr; $pass = $pass; $db = $database; $server_url = $server;
$client = new xmlrpc_client($server_url.’common’); // connect with server “common” services use for logging purpose
$msg = new xmlrpcmsg(‘login’); $msg->addParam(new xmlrpcval($db, “string”)); $msg->addParam(new xmlrpcval($user, “string”)); $msg->addParam(new xmlrpcval($pass, “string”));
$res = &$client->send($msg); // Send parse message to server and in response getting id
if(!$res->faultCode()){ // Check for error of response
$val = $res->value(); $id = $val->scalarval(); // Getting a value from response
if (empty($id)){ die(“Connection error.”); } else {
$client2 = new xmlrpc_client($server_url.’object’); // Create second object for manipulation operation
// Make a structure of fields for sending data to server $val = array (
“name” => new xmlrpcval(“”.$data[’company’],”string”), “email_from” => new xmlrpcval($data[’email’], “string”), “phone” => new xmlrpcval($post[’phone’], “string”), “partner_name” => new xmlrpcval(“”.$data[’company’],”string”),
CHAPTER 10. AUTOMATING YOUR LEAD ACQUISITION 91 “contact_name” => new xmlrpcval($data[’firstname’].’
‘.$data[’lastname’], “string”), “function” => new xmlrpcval($data[”jobtitle”], “string”), “zip” => new xmlrpcval($data[’zip’], “string”), “city” => new xmlrpcval($data[’city’], “string”)
);
// Prepare message for creating new lead on server $msg = new xmlrpcmsg(‘execute’); $msg->addParam(new xmlrpcval($db, “string”)); $msg->addParam(new xmlrpcval($id, “int”)); $msg->addParam(new xmlrpcval($pass, “string”)); $msg->addParam(new xmlrpcval(“crm.lead”, “string”)); $msg->addParam(new xmlrpcval(“create”, “string”)); $msg->addParam(new xmlrpcval($val, “struct”));
$res2 = &$client2->send($msg); // Send message using “object” services for new lead generation
if(!$res2->faultCode()) { // Check for error of response
$readVal = $res2->value()->scalarval(); // Getting a new lead id if (!empty($readVal)) {
$caseid = array(new xmlrpcval($readVal, “int”));
// Prepair a message for creating history $msg = new xmlrpcmsg(‘execute’); $msg->addParam(new xmlrpcval($db, “string”)); $msg->addParam(new xmlrpcval($id, “int”)); $msg->addParam(new xmlrpcval($pass, “string”)); $msg->addParam(new xmlrpcval(“crm.lead”, “string”)); $msg->addParam(new xmlrpcval(“history”, “string”)); $msg->addParam(new xmlrpcval($caseid, “array”)); $msg->addParam(new xmlrpcval(“”, “string”)); $msg->addParam(new xmlrpcval(true, “boolean”)); $msg->addParam(new xmlrpcval(“”, “string”)); $msg->addParam(new xmlrpcval(“<From email id>”, “string”)); $msg->addParam(new xmlrpcval(“< Description >”, “string”)); $msg->addParam(new xmlrpcval(“<To email id >”, “string”)); $msg->addParam(new xmlrpcval(“”, “string”)); $msg->addParam(new xmlrpcval(“”, “string”)); $msg->addParam(new xmlrpcval(“”, “string”)); $msg->addParam(new xmlrpcval(“”, “string”)); $msg->addParam(new xmlrpcval(“”, “string”)); $msg->addParam(new xmlrpcval(“”, “string”)); $msg->addParam(new xmlrpcval(“”, “string”));
$res2 = &$client2->send($msg); // Send message using “object” services for creating history } else {
$error=”Lead is not created”; }
} else { // If lead is not generated then return error message $error=”system unavailable [” . $res2->faultString() . “]”; }
}
} else { // If connection is not made with server
$error=”system unavailable [” . $res2->faultString() . “]”; }
}
$arrData = array(); // Make an array(key, value) of post data foreach ($_POST as $var => $value) { $arrData[$var]=is_string($value) ? trim(stripslashes($value)) : $value;
}
$cnt = new Lead (); // Create new object of lead class $cnt->createLead(‘<user>’, ‘<pass>’, ‘<database>’, ‘<server>’, $arrData); // Calling method of a class
?>
How to Link a Web Contact Form to OpenERP?
For more information, you can also refer to the Technical Memento that you can download from http://www.openerp.com/community, the chapter about WebServices – XML-RPC.
93
Profiling your Customers
11
The segmentation tools let you create partner groups (or categories) and act on each segment differently according to questionnaires. For example, you could create pricelists for each of the segments, or start phone marketing campaigns by segment. To allow you to work with segments in OpenERP, you should install the crm_profiling module, which can also be achieved from the Configuration Wizard (Marketing - Profiling).Profiling can be used to qualify your customers according to a questionnaire you define. When you establish a good customer profile, this will surely help you to close your deals. Customer profiles might even help you beat your competitors!
11.1 Establishing the Profiles of Prospects
During presales activities it is useful to qualify your prospects quickly. You can ask a series of questions to find out what product / service to offer to the customer, or how quickly you should handle the request.
Profiling
This method of rapidly qualifying prospects is often used by companies who carry out presales by phone. A prospect list is imported into the OpenERP system as a set of partners and the operators then ask a series of questions to each prospect by phone.
Responses to these questions enable each prospect to be qualified automatically which leads to a specific service being offered based on their responses.
As an illustration, take the case of a software company which offers a service based on the OpenERP software. The company goes to several exhibitions and encounters dozens of prospects over a few days. It is important to handle each request quickly and efficiently.
The products offered at these exhibitions are:
• training on OpenERP – for independent people or small companies,
• partner contract – for IT companies that intend to offer an OpenERP service, • OpenERP as SaaS – for small companies,
• a meeting in conjunction with a partner to provide a demonstration aimed at providing a software integration – for companies that are slightly larger.
The IT company has therefore put a decision tree in place based on the answers to several questions to prospects. These are given in the following figure Example of Profiling Customer Prospects by the OpenERP Company(page 94):
Figure 11.1: Example of Profiling Customer Prospects by the OpenERP Company
The sales person starts by asking the questions mentioned above and then after only a couple of minutes of work, he can decide what to propose to the prospective customer simply by analysing the prospect’s answers.
At the end of the exhibition, prospects’ details and their responses to the questionnaire are entered into OpenERP. The profiling system automatically classifies the prospects into appropriate partner categories.
This enables your sales people to efficiently follow up prospects and adapt their approach according to each prospect’s profile. For example, they can send a letter based on a template developed for a specific partner category. They would use OpenERP’s report editor and generator for their sales proposition, such as an invitation to a training session a week after the show.