Dialogues

Retrieving dialogue objects

class DialogueMixin

This class defines all functions related to BlueConic dialogues.

get_dialogue(dialogue_id)

Gets the dialogue with the dialogue ID and returns it as a BlueConic dialogue.

Parameters:

dialogue_id (str) – The dialogue ID of the dialogue

Raises:

HTTPError: Request fails

Returns:

The requested dialogue

Return type:

Dialogue

Usage:
>>> import blueconic
>>> bc = blueconic.Client()
>>> dialogue = bc.get_dialogue('example_dialogue_id')
>>> variants = dialogue.variants
>>> for var in variants:
>>>     print(var.name)
Original (served to the Control Group)
Variant A
get_dialogues(start=0, count=10000000)

Gets all dialogues and returns them in a generator with all BlueConic dialogues.

Parameters:
  • start (int, optional) – The dialogue to start from. Defaults to 0.

  • count (int, optional) – The number of dialogues to retrieve. Defaults to 10000000.

Returns:

Iterator with Dialogue

Return type:

Iterator[Dialogue]

Usage:
>>> import blueconic
>>> bc = blueconic.Client()
>>> dialogues = bc.get_dialogues(start=1, count=3)
>>> for dialogue in dialogues:
>>>     print(dialogue.name)
Ad Blocking Demo Request Form
Ad Blocking Demo Request Form - blog
AdgroupHomepage3 CTA

Using dialogue objects

class Dialogue
property creation_date
Returns:

The creation date of this object.

Return type:

Optional[datetime]

property creator_username
Returns:

The username that created this object.

Return type:

Optional[str]

property description
Returns:

Description of this object.

Return type:

Optional[str]

property id
Returns:

ID of this object.

Return type:

str

property is_active

Returns if the object is active.

property labels
Returns:

The labels this object.

Return type:

Optional[Sequence[str]

property last_modified_date
Returns:

The last modified date of this object.

Return type:

Optional[datetime]

property last_modified_username
Returns:

The last modified username of this object.

Return type:

Optional[str]

property name
Returns:

Name of this object.

Return type:

Optional[str]

property optimizer_settings

Returns the optimizer settings of the dialogue

property statistics

Returns a mapping with the statistics of this object. The following ‘keys’ are available for the mapping:

Mapping key

Description

views

Views

unique_views

Unique views

clicks

Clicks

unique_clicks

Unique clicks

direct_conversions

Direct conversions

unique_direct_conversions

Unique direct conversions

indirect_conversions

Indirect conversions

unique_indirect_conversions

Unique indirect conversions

total_conversions

Total conversions

unique_total_conversions

Unique total conversions

To read more about these statistics, see the Metrics page in the BlueConic Knowledge Base https://support.blueconic.com/hc/en-us/articles/360020105614-Metrics-for-views-clicks-and-conversions.

Return type:

Mapping[str, float]

Usage:
>>> import blueconic
>>> bc = blueconic.Client()
>>> dialogue_id = bc.get_blueconic_parameter_value("My dialogue","dialogue")
>>> dialogue = bc.get_dialogue(dialogue_id)
>>> print(dialogue.statistics)
>>> print("Variant details:")
>>> for variant in dialogue.variants:
>>>     print(variant.name + " | " + str(variant.statistics["views"]))
{'clicks': 2246, 'direct_conversions': 0, 'indirect_conversions': 0, 'total_conversions': 0, 'unique_clicks': 1116, 'unique_direct_conversions': 0, 'unique_indirect_conversions': 0, 'unique_total_conversions': 0, 'unique_views': 94154, 'views': 150498}
Variant details:
Original (served to the Control Group) | 655
Recent Posts | 2
Variant A: Look-alike | 61744
Variant B: Recent high CTRs | 44053
Variant C: Collaborative Filtering | 44044
property variants

Returns the variants of the dialogue.