Zen Cart Logo

Coupons & Dormant Customers

Locked

Views: 4,079

Results 1 to 11 of 11
This thread is locked. New replies are disabled.
6 Jul 2006, 7:31 PM
#1
ksoup avatar

ksoup

Zen Follower

Join Date:
Jan 2004
Posts:
413
Plugin Contributions:
1

Coupons & Dormant Customers

We sent out a "we miss you" coupon to the dormant customers > 3 months. It seems that active customers ... who just purchase last week... received the coupon also.

How can we trouble shoot this?

7 Jul 2006, 12:23 AM
#2
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,650
Plugin Contributions:
0

Re: Coupons & Dormant Customers

How did you separate the groups?

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

7 Jul 2006, 2:12 AM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Coupons & Dormant Customers

The physical query on this is in the query_builder table ... if this is of help to you ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

8 Jul 2006, 1:44 PM
#4
ksoup avatar

ksoup

Zen Follower

Join Date:
Jan 2004
Posts:
413
Plugin Contributions:
1

Re: Coupons & Dormant Customers

Thank you :) Interesting thing to note....

***Note: I have not changed the query in the database :) ...The following info is from using the query seperately in mysql ***

With the date clause taken out of this query, we have 4,168 customers that are subscribed to our newsletter and have a matching customer id on the customers table and orders table.

Adding the Date back and only changing the greater than/less than yields the following results....

Using the query with the Dormant Customers
o.date_purchased < subdate... gives a figure of 3,296

Change the date clause to o.date_purchased > subdate gives a figure of 1,868.

If you add those two together you get a total of 5164 not 4168.
That is a difference of 996 customers that seem to be doubled up.

Thoughts? This could account for the reason active customers got the coupon for dormant customers.

Ajeh:

The physical query on this is in the query_builder table ... if this is of help to you ...

8 Jul 2006, 1:52 PM
#5
ksoup avatar

ksoup

Zen Follower

Join Date:
Jan 2004
Posts:
413
Plugin Contributions:
1

Re: Coupons & Dormant Customers

Hi Kim, We used the send coupon mod on the store... you have the drop down option to choose Active ... All subscribers... Dormant > 3months... We chose dormant.

Kim:

How did you separate the groups?

8 Jul 2006, 4:26 PM
#6
ksoup avatar

ksoup

Zen Follower

Join Date:
Jan 2004
Posts:
413
Plugin Contributions:
1

Re: Coupons & Dormant Customers

I have looked at the query until I am now blue in the face.

It just doesn't seem plausible that a customer can be both active and dormant, yet in this query, there are customers considered dormant who are active and just purchased last week.

11 Jul 2006, 1:27 PM
#7
ksoup avatar

ksoup

Zen Follower

Join Date:
Jan 2004
Posts:
413
Plugin Contributions:
1

Re: Coupons & Dormant Customers

This is now to a point of frustration. We have a standard we miss you coupon. Due to the fact that this query doesn't work right, we now have mad customers, because, they got the coupon and cannot use it because it is a one time use per customer coupon.

We have answered many emails giving the customers a new code, but it looks embarassing.

They say...why do you say " we miss you" when we bought last week?!

Coupon was sent via the send email > DORMANT CUSTOMERS in the admin. The last time it was sent (WHICH WAS OVER 3 MONTHS AGO - TO PREVENT THIS VERY PROBLEM), the same thing happened...current customers got the coupon, too...but we honored it.

If you have no suggestions for why this query sends to our current/active customers, also.... we simply cannot trust that portion of the admin.

Please advise.

11 Jul 2006, 4:27 PM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Coupons & Dormant Customers

I too see similar numeric discrepancies when running the query with < and >.
However, when I view the raw data returned by each, the dates are "correct".

I suspect the issue is related to the fact that the orders table is a one-to-many relationship with the customers table, and thus what's happening is that customers who have ordered more than once are showing up in both sides of the query.

Need to work up an outer join... hmm.....

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

11 Jul 2006, 5:23 PM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Coupons & Dormant Customers

Try this via phpMyAdmin:

REPLACE INTO query_builder ( query_id , query_category , query_name , query_description , query_string ) 
VALUES ( '3', 'email,newsletters', 'Dormant Customers (>3months) (Subscribers)', 'Subscribers who HAVE purchased something, but have NOT purchased for at least three months.', 
'select o.date_purchased, c.customers_email_address, c.customers_lastname, c.customers_firstname from TABLE_CUSTOMERS c, TABLE_ORDERS o 
WHERE c.customers_id = o.customers_id 
AND c.customers_newsletter = 1 
GROUP BY c.customers_email_address 
HAVING max(o.date_purchased) <= subdate(now(),INTERVAL 3 MONTH) 
ORDER BY c.customers_lastname, c.customers_firstname ASC');

This now also excludes customers who have purchased within the last 3 months...removing the overlap.

Once you've updated your database with the updated query, you should be able to re-run your report/mailing etc and get the right data.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

13 Jul 2006, 5:02 PM
#10
ksoup avatar

ksoup

Zen Follower

Join Date:
Jan 2004
Posts:
413
Plugin Contributions:
1

Re: Coupons & Dormant Customers

Dr. Byte, You simply Rock!! I had tried to use the max option in the select area of the query and it wasn't working.

Thank you so much for your time and expertise!!! You are GREATLY appreciated. :)

The numbers add up!! If I take out the date statement, I get the total of what is returned with the date statement in and just changing the data from dormant to active customers (switching the greater than less than sign). :)

11 Feb 2008, 9:25 PM
#11
ksoup avatar

ksoup

Zen Follower

Join Date:
Jan 2004
Posts:
413
Plugin Contributions:
1

Re: Coupons & Dormant Customers

Thank you again, Dr. Byte. I am revisiting this... and our numbers don't add up again. I can give you specific numbers via PM, but we are a few thousand different when you do the dormant > 3 months and active < 3 months. What would make the difference?