• No se han encontrado resultados

Cuadro de Cuentas

COMPRAS Y GASTOS POR NATURALEZA 60. COMPRAS

Figure 9.2: Marketing Campaign 0. Introduction

A campaign defines a workflow of activities that items/objects entering the campaign will go through. Items are selected by segments. Segments are automatically processed every few hours and inject new items into the campaign, according to a given set of criteria. It is possible to watch the campaign as it is running, by following the campaign “workitems”. A workitem represents a given object/item passing through a given campaign activity. See it as a step that still can go either way. Workitems are left

CHAPTER 9. LEAD AUTOMATION WITH MARKETING CAMPAIGNS 83 behind when the item proceeds to the next activities. This allows an easy analysis and reporting on the running campaign. Each activity may execute an action upon activation depending on a dynamic condition. When the condition is not met, the workitem is cancelled/deleted; if the condition is met, the action is executed, the workitem is marked as Done, and propagated to the next activities.

1. Campaigns (Marketing → Campaigns → Campaigns)

Campaign Each campaign is made of activities and transitions, and must be defined on any specific object the system knows about (e.g. Leads, Opportunities, Employees, Partners).

Mode

A campaign can be in one of 4 modes:

• Test Directly: processes the whole campaign in one go, ignoring any delay put on transitions, and does not actually execute the actions, so the result is simply the set of corresponding campaign workitems (see below). Any time a segment adds new items in the campaign they will be processed in the same manner.

• Test in Real time: processes the campaign but does not actually execute the actions, so the result is simply the set of corresponding campaign workitems. Any time a segment adds new items in the campaign they will be processed in the same manner.

• Manual confirmation: No action will be executed automatically, a human intervention is needed to let workitems proceed into the flow. It is like a step-by-step manual process using the Campaign Followup menu. You can ignore the time delays and force any step of the campaign, implementing the campaign at your pace i.e. (you have a test email and want to see if the steps and templates do exactly what you want them to do). You will see that the actions set are defined as To Do and Done and the page has to be refreshed to see the next activities defined by the campaign node: the campaign sends real messages to the actual targets, be warned.

• Normal: the campaign is processed normally, all actions are executed automatically at the scheduled date. Pay attention that in this status, the campaign sends real messages to the actual target audience.

Regardless of the current mode of the campaign, any workitem can be manually executed or cancelled at any time (even if it is scheduled in the future) through Campaign Followup.

Resource Specifies where the campaign will get the information from, i.e. the OpenERP object linked (e.g. Leads, Opportunities, Employees, Partners).

Activities Activities are steps in the campaign. Each activity is optionally linked to previous and next activities through transitions.

Each activity has:

• one optional condition that stops the campaign,

• one action to be executed when the activity is activated and the condition is True (could be a ‘do nothing’ action),

• one optional signal (ignore it), • a start flag.

Start Activity

Activities that have the Start checkbox set, will receive a new workitem corresponding to each new resource/object entering the campaign. It is possible to have more than one Start Activity, but not less than one.

Activity Conditions

[a Boolean expression, made of clauses combined using boolean operators: AND, OR, NOT] Each condition is the criterion that decides whether the activity is going to be activated for a given workitem, or just cancelled. It is an arbitrary expression composed of simple tests on attributes of the object, possibly combined using or, and & not operators.

See section 6.1 for more information on Comparators.

The individual tests can use the “object” name to refer to the object/resource it originates from (e.g the lead), using a “dot notation” to refer to its attributes. Some examples on a CRM Lead resource:

• object.name == ‘Insurance Offer Lead’ would select only leads whose title is exactly “Insurance Offer Lead”,

• object.state == ‘pending’ would select Pending leads only,

• object.country_id.code == ‘be’ would select leads whose country field is set to Belgium, • object.country_id.name == ‘Belgium’ would select leads whose country field is set to Belgium. Tests can also use a ‘workitem’ name to refer to the actual item denoting the position of the object in the campaign. This can be useful to access some specific attributes, such as the segment that selected this item. Some examples:

• workitem.segment_id.name == ‘Insurance Offer EU Zone1 - Industry Consulting/Technology’ would select leads that entered this campaign through the “Insurance Offer Lead EU Zone1 - Industry Consulting/Technology” segment,

• ‘EU Zone1’ in workitem.segment_id.name would select only leads that entered the campaign through a segment that has “EU Zone1” in its name.

Help

In the GTK client you can use “Help > Enable Debug mode tooltips” to see the attribute name of every field in a form. These are the same that you can use during import/export with CSV files.

You can also use the special formula re.search(PATTERN_TO_SEARCH, ATTRIBUTE_TO_SEARCH) where PATTERN_TO_SEARCH is a character string delimited with quotes, and ATTRIBUTE_TO_SEARCH uses the dot notation above to refer to a field of the object. An example for CRM leads:

CHAPTER 9. LEAD AUTOMATION WITH MARKETING CAMPAIGNS 85 • re.search(‘Plan to buy: True’, object.description) would be true if the Notes on a Lead contain this text: “Plan to buy: True”. Be careful that all spaces etc. do matter, so you may use the special pattern characters as detailed at the bottom to account for small variations,

• re.search(‘Plan to.*True’, object.description) would be true if the Notes on a Lead contain this text: “Plan to” followed later on by “True”.

You can combine individual tests using boolean operators and parentheses. Some examples on a CRM Lead resource:

• object.state != ‘pending’ and ( re.search(‘Plan to by:.*True’,object.description) and not re.search(‘Plan to use:.*True’,object.description) ) would be true if the lead is NOT in Pending state and it contains “Plan to buy”, but not “Plan to use”.

9.5.1 Guidelines for Creating a Campaign

• It is a good idea to have an initial activity that will change some fields on the objects entering the campaign to mark them as such, to avoid mixing them in other processes (e.g. set a specific state and Sales Team on a CRM lead being processed by a campaign). You can also define a time delay so that the campaign seems more human (note if the answer comes in a matter of seconds or minutes it is computer generated).

• Put a stop condition on each subsequent activity in the campaign to get items out of the campaign as soon as the goal is achieved (e.g. every activity has a partial condition on the state of the item, if CRM Leads stops being Pending, the campaign ends for that case).

2. Email Templates (Marketing → Configuration → Email Template → Templates) Email templates are composed of the following information:

• The Email headers: to, from, cc, bcc, subject

• The raw HTML body, with the low-level markup and formatting • The plaintext body

Headers and bodies can contain placeholders for dynamic contents that will be replaced in the final email with the actual content.

3. Campaign Segments

Segments are processed automatically according to a predefined schedule set in the menu Administration → Configuration → Scheduled Actions. It could be set to process every 4 hours or every minute for example. This is the only entry point in a campaign at the moment.

Segment filters

Segments select resources via filters, exactly the same kind of filter that can be used in advanced search views on any list in OpenERP. You can actually create them easily from any OpenERP screen allowing

you to save filters. Save your advanced search criteria as a new filters and add them to the segment in the Filter field. Filters mainly consist in a domain expressing the criteria of selection on a model (the resource). See section 10.3 for more information on the syntax for these filters.

For Leads, the following filter would select draft Leads from any European country with “Plan for use: True” or “Plan for buy: False” specified in the body:

[ (‘type’,’=’,’lead’), (‘state’, ‘=’, ‘draft’), (‘country_id.name’, ‘in’, [’Belgium’, ‘Netherlands’, ‘Luxembourg’, ‘United Kingdom’, ‘France’, ‘Germany’, ‘Finland’, ‘Denmark’, ‘Norway’, ‘Austria’, ‘Switzerland’, ‘Italy’, ‘Spain’, ‘Portugal’, ‘Ireland’, ]), ‘|’, (‘description’, ‘ilike’, ‘Plan for use: True’), (‘description’, ‘ilike’, ‘Plan for buy: False’) ]

6. Miscellaneous References, Examples 6.1 Reference of Comparison Operators:

• ==: Equal • !=: Not Equal • <: Bigger than • >: Smaller Than

• <=: Bigger than or equal to • >=: Smaller than or equal to

• in: to check that a given text is included somewhere in another text. e.g “a” in “dabc” is True 6.2 Reference of Pattern/Wildcard characters

• . (dot) represents any character (but just one)

• * means that the previous pattern can be repeated 0 or more times • + means that the previous pattern can be repeated 1 or more times • ? means that the previous pattern is optional (0 or 1 times)

• .* would represent any character, repeated in 0 or more occurrences • .+ would represent at least 1 character (but any)

• 5? would represent an optional 5 character 6.3 Reference of filter domains

Generic format is: [ (criterion_1), (criterion_2) ] to filter for resources matching both criteria. It is possible to combine criteria differently with the following operators:

CHAPTER 9. LEAD AUTOMATION WITH MARKETING CAMPAIGNS 87 • ‘&’ is the boolean AND operator and will make a new criterion by combining the next 2 criteria

(always 2). This is also the implicit operator when no operator is specified.

– for example: [ (criterion_1), ‘&’, (criterion_2), (criterion_3) ] means criterion_1 AND (criterion_2 AND criterion_3)

• ‘|’ is the boolean OR operator and will make a new criterion by combining the next 2 criteria (always 2)

– for example: [ (criterion_1), ‘|’, (criterion_2), (criterion_3) ] means criterion_1 AND (criterion_2 OR criterion_3)

• ‘!’ is the boolean NOT operator and will make a new criterion by reversing the value of the next criterion (always only 1)

– for example: [ (criterion_1), ‘!’, (criterion_2), (criterion_3) ] means criterion_1 AND (NOT criterion_2) AND criterion_3

Criterion format is: ( ‘field_path_operand’, ‘operator’, value ) Where:

• field_path_operand specifies the name of an attribute or a path starting with an attribute to reach the value we want to compare

• operator is one of the possible operator: – ‘=’ , ‘!=’ : equal and different

– ‘<’, ‘>’, ‘>=’, ‘<=’ : greater or lower than or equal

– ‘in’, ‘not in’ : present or absent in a list of value. Values must be specified as [ value1, value2 ], e.g. [ ‘Belgium’, ‘Croatia’ ]

– ‘ilike’ : search for string value in the operand

• value is the text or number or list value to compare with field_path_operand using comparator