Sitecore / xGenerator

Utility to generate "realistically looking" traffic for Sitecore sites with configurable patterns
37 stars 27 forks source link

Empty email errors #56

Open blipson89 opened 5 years ago

blipson89 commented 5 years ago

We're running xGenerator for a client on Sitecore 9.0.2 but having a problem. It's not actually generating anything and the xConnect logs are filled with identifer should not be empty. I did a bunch of debugging and it seems in ContactDataProcessor.cs, the value for emailValue is empty in

Tracker.Current.Session.IdentifyAs("xGenerator", emailValue);

based on what i'm seeing in the code:

requestInfo.SetIfVariablePresent("ContactEmail", email =>
{
    emailValue = email;
});

it would seem that the variable "ContactEmail" is not getting populated before ContactDataProcessor is being run.

jeanfrancoislarente commented 5 years ago

Thanks for reporting @blipson89 - we'll take a look as soon as we get a chance.

blipson89 commented 5 years ago

Could this be the problem? https://github.com/Sitecore/xGenerator/blob/c6364c7f44ea2b835899ba7e0ec4ad12a42313c2/src/ExperienceGenerator/Parsing/Factories/ContactDataVariable.cs#L20-L21

Line 31 seems to be the only place I see ContactEmail getting generated anywhere in the code, and it seems like there's a chance for it to be short circuited by line 20. I suspect that might be how this situation is coming up, but I'm not sure. I'm still digging

scottmulligan commented 5 years ago

Hi @blipson89. I think you nailed it.

After taking a quick look I can see this issue in the version for 9.0.2 & it appears to be fixed in the 9.1.0 version. I see an extra check for empty email in the 9.1.0 version.

Take a quick look at the "ContactDataProcessor.cs" file in the "release/9.1.0" branch and let me know what you think. You could potentially steal the updated code and give it a shot if you are building your own xGenerator package or deploying to your site.

Either way, we will port the updates back to the 9.0.2 code and re-test.

Thanks for posting this issue!