Skip to content

Commit

Permalink
Feature/documentation (#170)
Browse files Browse the repository at this point in the history
* Splits documentation over multiple folders

* Editor guide documentation intro

* Adds segment dashboard documentation

* Adds editor documenation regarding segment creation

* Adds logo with padding for the documentation

* Updates usage guide documentation

* Splits sandbox and custom rules documentation

* Improves ‘Create a variant’ documentation

* Adds documentation regarding streamfield and template tags

* Consistent StreamField references

* Feedback from M. Dingjan

* Remove ‘coming soon’ section

* Enable sandbox debug toolbar

* Updated documentation
  • Loading branch information
jberghoef committed Jul 17, 2018
1 parent 6f0425c commit 293004f
Show file tree
Hide file tree
Showing 33 changed files with 537 additions and 248 deletions.
16 changes: 14 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ in the admin interface.

Instructions
------------
Wagtail Personalisation requires Wagtail 1.9 or 1.10 and Django 1.9, 1.10 or 1.11.
Wagtail Personalisation requires Wagtail 2.0 or 2.1 and Django 1.11 or 2.0.

To install the package with pip::
To install the package with pip:

.. code-block:: console
pip install wagtail-personalisation
Expand All @@ -64,6 +66,16 @@ been added in first, this is a prerequisite for this project.
# ...
]
Documentation
-------------

You can find more information about installing, extending and using this module
on `Read the Docs`_.

.. _Read the Docs: http://wagtail-personalisation.readthedocs.io


Sandbox
-------

Expand Down
Binary file added docs/_static/images/dual_streamfield.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/images/edit_segment_rules.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/images/edit_segment_specifics.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/images/editing_variant.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/images/segment_dashboard_header.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/images/segment_dashboard_view.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/images/segment_list_view.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/images/single_streamfield.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/images/variants_button.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 17 additions & 13 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,17 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
import os
import sys

on_rtd = os.environ.get('READTHEDOCS', None) == 'True'

if not on_rtd: # only import and set the theme if we're building docs locally
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

sys.path.insert(0, os.path.abspath('.'))

# -- General configuration ------------------------------------------------

Expand All @@ -47,25 +54,25 @@

# General information about the project.
project = 'wagtail-personalisation'
copyright = '2017, Lab Digital BV'
copyright = '2018, Lab Digital BV'
author = 'Lab Digital BV'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.11.3'
version = '0.12.0'

# The full version, including alpha/beta/rc tags.
release = '0.11.3'
release = '0.12.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
# language = None

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand All @@ -84,22 +91,19 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
# html_theme = 'alabaster'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}
html_theme_options = {
'github_user': 'LabD',
'github_banner': True,
'github_repo': 'wagtail-personalisation',
'travis_button': True,
'codecov_button': True,
'analytics_id': 'UA-100203499-2',
}

html_logo = 'logo.png'

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
Expand Down
12 changes: 11 additions & 1 deletion docs/default_rules.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Included rules
==============

Wagxperience comes with a base set of rules that allow you to start segmenting
your visitors quickly.


Time rule
---------

Expand All @@ -16,11 +20,12 @@ End time The end time of your time frame.

``wagtail_personalisation.rules.TimeRule``


Day rule
--------

The day rule allows you to segment visitors based on the day of their visit.
Select one or multiple days on which you'd like your segment to be applied.
Select one or multiple days on which you would like your segment to be applied.

================== ==========================================================
Option Description
Expand All @@ -36,6 +41,7 @@ Sunday Matches when the visitors visits on a sunday.

``wagtail_personalisation.rules.DayRule``


Referral rule
-------------

Expand All @@ -54,6 +60,7 @@ Regex string The regex string to match the referral header to.

``wagtail_personalisation.rules.ReferralRule``


Visit count rule
----------------

Expand All @@ -72,6 +79,7 @@ Operator Whether to match for more than, less than or equal to the

``wagtail_personalisation.rules.VisitCountRule``


Query rule
----------

Expand All @@ -92,6 +100,7 @@ Value The second part of the query ('ourbestoffer').

``wagtail_personalisation.rules.QueryRule``


Device rule
-----------

Expand All @@ -108,6 +117,7 @@ Desktop Matches when the visitor uses a desktop.

``wagtail_personalisation.rules.DeviceRule``


User is logged in rule
----------------------

Expand Down
91 changes: 91 additions & 0 deletions docs/editor_guide/creating_personalised_content.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
Creating personalised content
=============================

Once you've created a segment you can start serving personalised content to your
visitors. To do this, you can choose one of three methods.

1. Create a page variant for a segment.
2. Use StreamField blocks visible for a segment only.
3. Use a template block visible for a segment only.


Method 1: Create a page variant
-------------------------------

**Why you would want to use this method**

* It has absolutely no restrictions, you can change anything you want.
* That's pretty much it.

**Why you would want to use a different method**

* You are editing a page that changes often. You would probably rather not
change the variation(s) every time the original page changes.

To create a variant of a page for a specific Segment (which you can change to
your liking after creating it), simply go to the Explorer section and find the
page you would like to personalize.

.. figure:: ../_static/images/variants_button.png
:alt: The variants button that appears on personalisable pages.

When you hover over a page, you'll notice a "Variants" dropdown button appears.
Click the button and select the segment you would like to create personalised
content for.

Once you've selected the segment, a copy of the original page will be created
with a title that includes the segment. Don't worry, your visitors won't be able
to see this title. It's only there for your reference.

.. figure:: ../_static/images/editing_variant.png
:alt: The newly created page allowing you to change anything you want.

You can change everything on this page you would like. Visitors that are appointed
to your segment will automatically see the new variant you've created for them
when attempting to visit the original page.


Method 2: Use a StreamField block
---------------------------------

Preparing a page and it's StreamField blocks for this method is described in the
Usage guide for developers. Please refer to
:ref:`implementing_streamfield_blocks` for more information.

**Why you would want to use this method**

* Allows you to create personalised content in the original page (without
creating a variant).
* Create multiple StreamField blocks for different segments inline.

**Why you would want to use a different method**

* You need someone tech savvy to change the back-end implementation.

To create personalised StreamField blocks, first select the page you wan't to
create the content for. Note that the personalisable StreamField blocks must be
activated on the page by your developer.

Scroll down to the block containing the StreamField and add a personalisable
block. The first input field in the block is a dropdown allowing you to select
the segment this StreamField block is ment for.

.. figure:: ../_static/images/single_streamfield.png
:alt: Create a new StreamField block and select the segment.

If you want, you can even add multiple blocks and change the segment to show
different content between segments!

.. figure:: ../_static/images/dual_streamfield.png
:alt: You can even create multiple variations of the same block!

Once saved, the page will selectively show StreamField blocks based on the
visitor's segment.


Method 3: Use a template block
------------------------------

Setting up content in this manner is described in the Usage guide for
developers. Please refer to :ref:`implementing_template_blocks` for more
information.
84 changes: 84 additions & 0 deletions docs/editor_guide/creating_segments.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
Creating a segment
==================

To create a segment, go to the "Segments dashboard" and click "Add segment".
You can find the segments dashboard in the administration menu on the left of
the page.

.. figure:: ../_static/images/segment_dashboard_header.png
:alt: The segment dashboard header containing the "Add segment" button.

On this page you will be presented with two forms. One with specific information
about your segment, the other allowing you to choose and configure your
rules.


Set segment specific options
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. figure:: ../_static/images/edit_segment_specifics.png
:alt: The form that allows you to configure specific segment options.

1. Enter a name for your segment

Choose something meaningful like "Newsletter campaign visitors". This will
ensure you'll have a general idea which visitors are in this segment in
other parts of the administration interface.

2. Select the status of the segment *Optional*

You will generally keep this one **enabled**. If for some reason you want
to disable the segment, you can change this to **disabled**.

3. Set the segment persistence. *Optional*

When persistence is **enabled**, your segment will stick to the visitor once
applied, even if the rules no longer match the next visit.

4. Select whether to match any or all defined rules. *Optional*

**Match any** will result in a segment that is applied as soon as one of
your rules matches the visitor. When **match all** is selected, all rules
must match before the segment is applied.

5. The segment type *Required*

**Dynamic**: Users in this segment will change as more or less meet the
rules specified in the segment.

**Static**: If the segment contains only static compatible rules the segment
will contain the members that pass those rules when the segment is created.
Mixed static segments or those containing entirely non static compatible
rules will be populated using the count variable.

6. The segment count *Optional*

If this number is set for a static segment users will be added to the set
until the number is reached. After this no more users will be added.

7. Randomisation percentage *Optional*

If this number is set each user matching the rules will have this percentage
chance of being placed in the segment.

Defining rules
^^^^^^^^^^^^^^

.. figure:: ../_static/images/edit_segment_rules.png
:alt: The form that allows you to set the rules for a segment.

5. Choose the rules you want to use.

Wagxperience comes with a basic set of :doc:`../default_rules` that allow
you to get started quickly. The rules you define will be evaluated once a
visitor makes a request to your application.

The rules that come with Wagxperience are as follows:

.. toctree::
:maxdepth: 2

../default_rules

Click "save" to store your segment. It will be enabled by default, unless
otherwise defined.
13 changes: 13 additions & 0 deletions docs/editor_guide/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Editor Guide
============

The editor guide is meant for content editors and marketers using Wagxperience
to offer a personalised experience to their visitors.

.. toctree::
:maxdepth: 2

introduction
segments_dashboard
creating_segments
creating_personalised_content
22 changes: 22 additions & 0 deletions docs/editor_guide/introduction.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Introduction
============

Wagxperience_ is an open source module developed by `Lab Digital`_ for the
Wagtail_ content management system. It allows editors and marketeers to create
personalised experiences by harnessing the power of segmentation and rules.

.. _Wagxperience: http://wagxperience.io
.. _Wagtail: https://wagtail.io
.. _Lab Digital: http://labdigital.nl

In this guide, we'll take you step by step through the process of offering your
visitors a tailor made online experience. The subjects covered are:

* Using the segments dashboard
* Defining a new segment
* Setting up rules used to match visitors to a segment
* Personalize a page by creating a variant
* Using the StreamField to personalize content blocks
* And even more helpful stuff...

So without further ado, let's get started!

0 comments on commit 293004f

Please sign in to comment.