[plugin] Segment plugin

3rd party code for phpList

[plugin] Segment plugin

Postby duncanc » 11:04am, Thu 25 Sep, 2014

This plugin provides flexible segmentation of subscribers when sending a campaign.

It allows you to filter the subscribers based on attribute values and subscriber data - email address, entered date, and campaign activity (opened/did not open a prior campaign).

When the campaign is sent then only those subscribers who meet either any or all of the conditions will be selected.

In this screenshot the campaign will be sent to those subscribers who opened a specific earlier campaign and whose email address ends with "gmail.com".

segment.png
segment.png (25.69 KiB) Viewed 9643 times


The plugin is available on GitHub. See https://github.com/bramley/phplist-plugin-segment for how to install the plugin. Note that the plugin requires php version 5.3 or later.

Guidance on how to use the plugin is on the plugin page within the phplist documentation https://resources.phplist.com/plugin/segment.

Please post any questions or comments here.
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: [plugin] Segment plugin

Postby johntrot » 2:29am, Sat 27 Sep, 2014

using
phplist v3.0.8
php 5.3.28
mysql 5.5.37

The plugin does provide a "Segmentation" group on the Settings page, but there is one already listed on the [config][Settings] listing the Categories for lists. This duplication could become confusing.

Also, after this plugin is installed and activated the following error appears (in a red bordered box) after selecting [start a campaign] and opening a message. When this plugin is deactivated the error disappears.

---------------error---------------------
Sorry a software error occurred:
Please report a bug when reporting the bug, please include URL and the entire content of this page.

Notice: Undefined variable: languageswitcher in /home/xxxxx/www/www/lists/admin/ui/dressprow/footer.inc on line 13
phpList version 3.0.8
----------------------------------------
John B
johntrot
PL Geek
 
Posts: 71
Joined: 8:28pm, Fri 01 Apr, 2005

Re: [plugin] Segment plugin

Postby duncanc » 8:46am, Sat 27 Sep, 2014

The error message is caused by the plugin enabling error reporting but then not disabling it. That causes an existing error to be shown, which previously was hidden.

I have just changed the plugin, so you can now update it from GitHub.

I'll need to think about whether the plugin should have its own group on the Settings page. Its settings don't really have anything to do with list categories.
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: [plugin] Segment plugin

Postby fmedinamm » 9:08pm, Tue 25 Nov, 2014

I was testing the segment by using the open/did not open campaign, but I get an empty dropdown for the campaigns, basically the campaigns don't show up. I have not sent any campaigns after the plugin was installed. Just wondering if they should show up if they are sent after plugin has been installed or if they should all show up?

Thanks,
fmedinamm
phpList newbie
 
Posts: 1
Joined: 9:04pm, Tue 25 Nov, 2014

Re: [plugin] Segment plugin

Postby duncanc » 10:04pm, Tue 25 Nov, 2014

You need first to select one or more lists to send to on the Lists tab. The Segment tab will then show the prior campaigns to those lists.
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: [plugin] Segment plugin

Postby PAT » 8:41am, Sun 04 Jan, 2015

Hello,
Thank you for this plugin, I created 19 attrubutes and when did the selection in the "send a campaign," they are all displayed in the selection list, there are only 15 visible?
Thank you for your help
PAT
phpList newbie
 
Posts: 1
Joined: 7:42am, Sun 04 Jan, 2015

Re: [plugin] Segment plugin

Postby duncanc » 10:55am, Sun 04 Jan, 2015

That is an oversight on my part.

Until I can change it, you can work-around the problem by using the 'order of listing' field on the Configure Attributes page to ensure that the attributes you want to use for segmentation come in the first 15. I think this will also affect the order of the attributes on the subscription page though.
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: [plugin] Segment plugin

Postby duncanc » 12:28pm, Tue 06 Jan, 2015

There is a new release of the plugin that removes the limit of 15 attributes. The CommonPlugin must also be updated.

You can update each plugin on the phplist Manage Plugins page.
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: [plugin] Segment plugin

Postby mtasmithjk » 3:43pm, Wed 07 Jan, 2015

I just updated to the newest version of the plugin. I am using phpList 3.0.8. All of the attributes have now disappeared from the segment tab. I still see the "Subscriber Data" options in the drop down and a heading for "Attributes" but none of my attributes are displayed. Closed my phpList browser session and signed back in and tried to reinstall the update. No luck. Any suggestions?

******

Sorry! Didn't see the info about updating the Common Plugin as well. Once I did that, it fixed the problem.
mtasmithjk
phpLister
 
Posts: 6
Joined: 6:27pm, Fri 14 Nov, 2014

Re: [plugin] Segment plugin

Postby duncanc » 9:15pm, Wed 04 Mar, 2015

There is a new release of the plugin that allows the subscriber id and subscriber uniqid to be used in conditions. This allows a random % of subscribers to be selected using a suitable regular expression.

An earlier release, which was not announced here, provides an "is between" operator for date attributes and the subscriber entered date.

Update the plugin on the phplist Manage Plugins page. See https://resources.phplist.com/plugin/segment for guidance on using the plugin.
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: [plugin] Segment plugin

Postby setht » 8:07pm, Mon 09 Mar, 2015

After installing phplist-plugin-segment and phplist-plugin-common and activating both in PHPList, I am getting a PHP Fatal Error: "Class 'CHtml' not found in .....SegmentPlugin.php on line 158".

Being unfamiliar with the plugin architecture, I'm hoping for a shortcut answer on how to fix this, before I jump into the code. Anyone?
setht
phpList newbie
 
Posts: 2
Joined: 8:03pm, Mon 09 Mar, 2015

Re: [plugin] Segment plugin

Postby duncanc » 6:42am, Tue 10 Mar, 2015

I guess thtat CommonPlugin is not completely installed. See the installation instructions for how to check that the plugin has been installed correctly. Also, you need to be using php 5.3 or later.

How did you install the plugins, manually or through the Manage Plugins page?
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: [plugin] Segment plugin

Postby setht » 2:21pm, Tue 10 Mar, 2015

I am able to "View Config.php" and "View Session" with no issues. "View phpinfo" gives me a message about requiring the xsl extension, which doesn't seem relevant to finding the CHtml class. I installed the plugins through the Manage Plugins page. I will double-check the installation. We're using PHP version 5.3.10-1ubuntu3.14.
setht
phpList newbie
 
Posts: 2
Joined: 8:03pm, Mon 09 Mar, 2015

Processing the queue using the Segment Plugin

Postby mtasmithjk » 4:07pm, Wed 01 Apr, 2015

I have been using the Segment plugin for a while and it works very well (I am running phpList version 3.0.12 and Segment plugin version 2015-01-06).

However, I also use a cron job that processes queued campaigns in small batches throughout the day in order to avoid hitting the max allowed emails per hour / day from my ISP. As a result, phpList processes the campaign in small batches. Our logs indicate that the entire list is being processed for each campaign. If phpList finds no matches for the segment that I am targeting in that campaign, then it sends no emails for that campaign during the batch. Our log files show the following:

phpList - Processing message 61 [0.2702280000] (122)
phpList - Looking for subscribers [0.0637780000] (127)
phpList - Found them: 11584 to process [0.1681630000] (133)
phpList - Processing batch of: 55 [0.1435130000] (137)
phpList - sent 0 ETA unknown sending 0 msg/hr
phpList - sent 0 ETA unknown sending 0 msg/hr
etc - through a batch of 55

It appears that the Segment Plugin filters the distribution of the campaign during the processing of the queue, not during the creation of the campaign. As a result, each campaign processes through the entire subscriber list, not through the subset of the subscriber list. This can become a problem when the list contains tens of thousands of names and the segment target is only 10% of that total. In this case phpList processes 20,000 subscribers rather than the smaller subset of 2,000 subscribers. Multiple processing batches then show "phpList - sent 0 ETA unknown sending 0 msg/hr." As a result the act of processing the queue and sending the email takes far longer than I would like.

Some of the campaigns are now set up to target very small subsets of the list, say 30 - 60 subscribers. phpList then processes 20,000 subscribers rather than 30 - 60. Multiply this by 5 or 6 campaigns and the problem grows larger.

Does anyone have any thoughts on how to manage this better?

For example, is there a setting in the config file that will let me separate the processing of the subscriber list from the actual sending of the campaign to those targets? If the entire list could be processed and then the filtered results handed off to processqueue to send, then the email distribution would not take as long. However, it appears that processqueue will only execute both actions.

Or is there something I am doing wrong in the configuration of the Segment Plugin?

Or am I misunderstanding how the Segment Plugin works?

Thanks.
mtasmithjk
phpLister
 
Posts: 6
Joined: 6:27pm, Fri 14 Nov, 2014

Re: [plugin] Segment plugin

Postby duncanc » 6:07pm, Wed 01 Apr, 2015

The process you describe is how phplist lets plugins control which subscribers are sent the campaign.
phplist selects the subscribers and processes as normal, then as it processes each subscriber it asks each plugin whether the message should be sent to him. The Segment plugin then accepts or rejects the subscriber based on the conditions that were entered.

What you seem to want is possibly a "dynamic list" that is created when the message is composed or when phplist starts to process the campaign.
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Next

Return to Contributions: Plug-ins, Add-ons, Mods

Who is online

Users browsing this forum: No registered users and 3 guests