Answers.Body: <p>Hi I can confirm the same behaviour. We are on Drupal 7, CiviCRM 5.19.4 and the problem is that the Billing address profile seems to be ignored for the dedupe rules. You must create a new profile with all fields needed for dedupe rule and include it in page. The billing address name and first name is not used.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-09T05:48:14.423Z
Answers.LastActivityDate: 2020-01-09T05:48:14.423Z
Answers.UserDisplayName: Mazos
Answers.Body: <p>This sounds like the reverse to what you are experiencing but one issue with email field when matching is that if a record has more than one email, then each of those matching emails is counted - and it is easy for a record to end up with the same email 3 times. So I recommend a rule such as</p>
  
  <ul>
  <li>First = 10</li>
  <li>Last = 10</li>
  <li>Email = 2</li>
  <li>Threshold = 22</li>
  </ul>
  
  <p>That way a record would have to have 11 of the same emails to count as a match.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-19T10:32:39.613Z
Answers.Text: The test contact had 3 email addresses so I removed 2, and tried your recommendation.  But, still got a duplicate contact.  Tried other combinations & still fails every time.  I notice that in the created duplicate contact the email address is set to 'Billing' - I'm using Stripe, by the way. So still wondering if some kind of a bug...
Answers.UserDisplayName: Andy Clark
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-19T14:48:43.223Z
Answers.Text: @AndyClark - that might be your problem: the dedupe rules only let you specify 'email' without a location.  Are your existing addresses of type Billing?  If you use the same rule in a manual dedupe does it show any differences for the email fields?  Since your threshold of 20 works, it might be that firstname/lastname are matching but email is not.
Answers.UserDisplayName: Aidan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-19T18:18:24.720Z
Answers.Text: Aidan - existing email addresses are usually home. Firstname & lastname just won't match at all, I'm sure it's matching on email alone.  I have set the unsupervised rule to email only, less than ideal but I found there are only 30ish contacts with a shared email address.  Still wondering if this is a bug but not easy to test unless you have a payment processor set up.
Answers.UserDisplayName: Andy Clark
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-19T19:19:10.890Z
Answers.Text: Try testing using just the profile page that includes the first/last/email. Also - do your duplicates show up as potential duplicates when merging? And finally - just to be sure - are you using the CiviContribute page or are you using webform civicrm.
Answers.UserDisplayName: Alan Dixon
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-20T08:04:08.670Z
Answers.Text: Will do, Alan.  This is using a CiviContribute page, not a webform
Answers.UserDisplayName: Andy Clark
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-14T17:06:25.450Z
Answers.Text: " Also - do your duplicates show up as potential duplicates when merging?" - Yes, in my case they do (I am having the same problem)
Answers.UserDisplayName: naomi
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-19T08:54:59.347Z
Answers.LastActivityDate: 2017-10-19T08:54:59.347Z
Answers.UserDisplayName: petednz - fuzion
Answers.Body: <p>I had the same problem and can confirm that names are ignored. I worked around it by created a new rule matching on email address and postcode, and changing the settings to make it use that as the unsupervised rule.</p>
  
  <p>[Edit: adding some info to help diagnose the problem]</p>
  
  <p>This was the original rule:</p>
  
  <p><a href="https://i.sstatic.net/St3z7.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/St3z7.png" alt="enter image description here"></a></p>
  
  <p>When I make two online donations under the same email and both names the same, it creates two contacts. </p>
  
  <p>Then I switched the rule to this:</p>
  
  <p><a href="https://i.sstatic.net/QTQYB.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/QTQYB.png" alt="enter image description here"></a></p>
  
  <p>and made another online donation with the same details (including the same postcode), and it logged the donation on the existing contact as expected. (But only when I included a profile with main address fields in the contribution page. Without that, it failed to match, presumably because it matches on main and not billing address).</p>
  
  <p>NB: When the original (email and name) rule is set to <em>supervised</em>, it works - i.e, when I use the "Check for matching contacts" button it finds the one with the same name and email.</p>
  
  <p>[Edit: adding another screenshot]</p>
  
  <p>I also tried with this rule:</p>
  
  <p><a href="https://i.sstatic.net/lhVVo.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/lhVVo.png" alt="enter image description here"></a></p>
  
  <p>and it created a duplicate contact despite having the same first name, last name and email.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-17T12:02:23.307Z
Answers.Text: i am worried that you are reporting that a Dedupe match does not work as expected. Can you pls include a screenshot of the old Rule settings so we can understand what is not functioning correctly
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-18T14:03:59.020Z
Answers.Text: @petednz-fuzion added. Thanks!
Answers.UserDisplayName: naomi
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-18T14:42:05.070Z
Answers.Text: ok but from your screenshot i don't see what the Weight and Threshold were for the first one.
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-18T14:44:08.343Z
Answers.Text: also note afaik if you have Email 1 and Postcode 1, and there is a contact that has two addresses,  both with the matching postcode, then this will score 2 regardless of the email being different and hence risks overwriting the email address
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-18T15:06:12.397Z
Answers.Text: @petednz-fuzion The original rule was some kind of  built-in system default. It doesn't say what the weights are. Also: Are you sure it checks multiple addresses? It certainly does not check the Billing address. Without the Gift Aid profile (which contains home address fields) added to the Contribution Page, two contacts were created with the same name and postcode whilst using that rule.
Answers.UserDisplayName: naomi
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-19T14:40:05.047Z
Answers.Text: @petednz-fuzion I have edited the answer to show a manually created name-and-email rule which nonetheless allowed duplicates to be created
Answers.UserDisplayName: naomi
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-25T15:40:23.343Z
Answers.Text: if you meant that last one ie first (1) last (1) email (2) threshold (4) allows duplicates - can you pls confirm does it do what is expected if the existing contact only has one existing email and fails to work if the contact has two identical emails
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-14T17:05:53.370Z
Answers.LastActivityDate: 2018-09-19T14:38:58.343Z
Answers.LastEditDate: 2018-09-19T14:38:58.343Z
Answers.UserDisplayName: naomi
Body: <p>I am getting dupes created when contributing.  Contribution pages use the 'Unsupervised' dedupe rule, which I have set to First name, Last name &amp; email, assigning 10 to each with a threshold of 30.  But then I am getting duplicate contacts created every time, with exact matches on all three fields.  When I change the value of email to 20 and set the threshold to 20 a match is made &amp; no dupe. It seems that first name and last name are being ignored and only email is working. Am I misunderstanding something here?  Could this be a bug? Using Stripe 4.7.2, Civi 4.7.24 with Drupal 7.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-10-19T08:55:28.760Z
Comments.Text: hi andy - can you post of a screenshot of your matching rule config just to rule out any obvious blunders
Comments.UserDisplayName: petednz - fuzion
Tags: <civicontribute><4.7><stripe>
Title: Why am I getting duplicate contacts for contributions?
ThreadText: # Why am I getting duplicate contacts for contributions?
  
  (Asked by: username_0 on 2017-10-19)
  
  I am getting dupes created when contributing. Contribution pages use the 'Unsupervised' dedupe rule, which I have set to First name, Last name & email, assigning 10 to each with a threshold of 30. But then I am getting duplicate contacts created every time, with exact matches on all three fields. When I change the value of email to 20 and set the threshold to 20 a match is made & no dupe. It seems that first name and last name are being ignored and only email is working. Am I misunderstanding something here? Could this be a bug? Using Stripe 4.7.2, Civi 4.7.24 with Drupal 7.
  
  **Tags:** civicontribute, 4.7, stripe
  
  > **Comments:**
  > **username_1**: hi andy - can you post of a screenshot of your matching rule config just to rule out any obvious blunders  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_2 on 2020-01-09. Score: 2
  
  Hi I can confirm the same behaviour. We are on Drupal 7, CiviCRM 5.19.4 and the problem is that the Billing address profile seems to be ignored for the dedupe rules. You must create a new profile with all fields needed for dedupe rule and include it in page. The billing address name and first name is not used.
  
  
  ---
  
  ### Answer by username_1 on 2017-10-19. Score: 1
  
  This sounds like the reverse to what you are experiencing but one issue with email field when matching is that if a record has more than one email, then each of those matching emails is counted - and it is easy for a record to end up with the same email 3 times. So I recommend a rule such as
  
  * First = 10
  * Last = 10
  * Email = 2
  * Threshold = 22
  
  That way a record would have to have 11 of the same emails to count as a match.
  
  > **Comments:**
  > **username_0**: The test contact had 3 email addresses so I removed 2, and tried your recommendation.  But, still got a duplicate contact.  Tried other combinations & still fails every time.  I notice that in the created duplicate contact the email address is set to 'Billing' - I'm using Stripe, by the way. So still wondering if some kind of a bug...  
  > **username_3**: @AndyClark - that might be your problem: the dedupe rules only let you specify 'email' without a location.  Are your existing addresses of type Billing?  If you use the same rule in a manual dedupe does it show any differences for the email fields?  Since your threshold of 20 works, it might be that firstname/lastname are matching but email is not.  
  > **username_0**: username_3 - existing email addresses are usually home. Firstname & lastname just won't match at all, I'm sure it's matching on email alone.  I have set the unsupervised rule to email only, less than ideal but I found there are only 30ish contacts with a shared email address.  Still wondering if this is a bug but not easy to test unless you have a payment processor set up.  
  > **username_4**: Try testing using just the profile page that includes the first/last/email. Also - do your duplicates show up as potential duplicates when merging? And finally - just to be sure - are you using the CiviContribute page or are you using webform civicrm.  
  > **username_0**: Will do, Alan.  This is using a CiviContribute page, not a webform  
  > **username_5**: " Also - do your duplicates show up as potential duplicates when merging?" - Yes, in my case they do (I am having the same problem)  
  
  ---
  
  ### Answer by username_5 on 2018-09-14. Score: 0
  
  I had the same problem and can confirm that names are ignored. I worked around it by created a new rule matching on email address and postcode, and changing the settings to make it use that as the unsupervised rule.
  
  [Edit: adding some info to help diagnose the problem]
  
  This was the original rule:
  
  [![enter image description here](https://i.sstatic.net/St3z7.png)](https://i.sstatic.net/St3z7.png)
  
  When I make two online donations under the same email and both names the same, it creates two contacts.
  
  Then I switched the rule to this:
  
  [![enter image description here](https://i.sstatic.net/QTQYB.png)](https://i.sstatic.net/QTQYB.png)
  
  and made another online donation with the same details (including the same postcode), and it logged the donation on the existing contact as expected. (But only when I included a profile with main address fields in the contribution page. Without that, it failed to match, presumably because it matches on main and not billing address).
  
  NB: When the original (email and name) rule is set to *supervised*, it works - i.e, when I use the "Check for matching contacts" button it finds the one with the same name and email.
  
  [Edit: adding another screenshot]
  
  I also tried with this rule:
  
  [![enter image description here](https://i.sstatic.net/lhVVo.png)](https://i.sstatic.net/lhVVo.png)
  
  and it created a duplicate contact despite having the same first name, last name and email.
  
  > **Comments:**
  > **username_1**: i am worried that you are reporting that a Dedupe match does not work as expected. Can you pls include a screenshot of the old Rule settings so we can understand what is not functioning correctly  
  > **username_5**: @petednz-fuzion added. Thanks!  
  > **username_1**: ok but from your screenshot i don't see what the Weight and Threshold were for the first one.  
  > **username_1**: also note afaik if you have Email 1 and Postcode 1, and there is a contact that has two addresses,  both with the matching postcode, then this will score 2 regardless of the email being different and hence risks overwriting the email address  
  > **username_5**: @petednz-fuzion The original rule was some kind of  built-in system default. It doesn't say what the weights are. Also: Are you sure it checks multiple addresses? It certainly does not check the Billing address. Without the Gift Aid profile (which contains home address fields) added to the Contribution Page, two contacts were created with the same name and postcode whilst using that rule.  
  > **username_5**: @petednz-fuzion I have edited the answer to show a manually created name-and-email rule which nonetheless allowed duplicates to be created  
  > **username_1**: if you meant that last one ie first (1) last (1) email (2) threshold (4) allows duplicates - can you pls confirm does it do what is expected if the existing contact only has one existing email and fails to work if the contact has two identical emails  
  
  ---
  
  