New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for company fields in tracking code pageview event #5611
Support for company fields in tracking code pageview event #5611
Conversation
…rt-for-company-fields-from-request
…rt-for-company-fields-from-request
/label feature request |
/label ready to test |
…rt-for-company-fields-from-request
if ($leadAdded) { | ||
$lead->addCompanyChangeLogEntry('form', 'Identify Company', 'Lead added to the company, '.$company['companyname'], $company['id']); | ||
} else { | ||
$this->companyModel->setFieldValues($companyEntity, $query); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm getting Type error: Argument 1 passed to Mautic\LeadBundle\Model\CompanyModel::setFieldValues() must be an instance of Mautic\LeadBundle\Entity\Company, null given
on this line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works for me now. 👍
Well, the tracking code must contain a companyname
value to create a company and assign it to the contact. So this requirement must be documented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me. Could be merged after documentation is added.
@escopecz Mautic try find company name from This is right workflow? |
@escopecz maybe we can remove email from findCompany https://github.com/kuzmany/mautic/blob/1c1b1822aef2bec3f9ddebe0df8b7e0d7204569e/app/bundles/LeadBundle/Helper/IdentifyCompanyHelper.php#L74 A lot of people use personal email like gmail, outlook, yahoo, seznam.cz and nobody from them work in that companies :) |
@Maxell92 documentation added mautic/documentation#266 |
Removing email domain from that code would be a business decision. Lets have it as is for now. What I was noting is that if you use the sample code you provided: It actually doesn't do anything. It won't create new company. The information will be lost. So some users could be searching for an answer why. The answer is that they must provide |
@escopecz your code create company with companyname mycompany |
Nope, it did not create mycompany company because it check DNS MX record. But that's not the point. If you send in the page hit request companyaddress alone Mautic will ignore it. It must contain company or companyname to store the rest of the company* values. That I think should be documented. |
@escopecz docs update mautic/documentation#266 |
Description:
Added support for company fields in mt('send', 'pageview');
Inspirated by SubmissionModel
mautic/app/bundles/FormBundle/Model/SubmissionModel.php
Line 1017 in fed5d81
This PR also added more priority to companyname fields like take companyname from companyemail.
https://github.com/kuzmany/mautic/blob/1c1b1822aef2bec3f9ddebe0df8b7e0d7204569e/app/bundles/LeadBundle/Helper/IdentifyCompanyHelper.php#L76
Steps to reproduce the bug:
mt('send', 'pageview', {companyemail: 'mycompany@mycompany.com', companywebsite: 'https://mautic.com/'});
More in docs https://mautic.org/docs/en/contacts/contact_monitoring.html (part Tracking of custom parameters)
Steps to test this PR: