AndyButland / UmbracoPersonalisationGroups

Package for personalisation of content with Umbraco.
MIT License
38 stars 18 forks source link

Some criteria doesn't seems to be working #9

Closed StefanoChiodino closed 7 years ago

StefanoChiodino commented 7 years ago

I'm investigating Umbraco personalisations and this seems to be the package to have!

However I tried a number of criteria and the query string and cookie ones seems to be working, but the number of visits and locations ones doesn't seems to work at all.

Number of visits seems to be using 2 cookies which are stuck at 1. Tried refreshing, hard refreshing, incognito, etc. I can make the criteria match only if I set the number of visits to 0!

Location criteria seems to be working because I had to download the databases in my app_data, however doesn't seems to be triggering, not even if I try to set it as "not in Afghanistan".

Been through the readme a couple of times and had a colleague idiot-check, can you help please?

StefanoChiodino commented 7 years ago

https://github.com/AndyButland/UmbracoPersonalisationGroups/blob/master/Zone.UmbracoPersonalisationGroups/Criteria/NumberOfVisits/RegisterApplicationEvents.cs#L37 seems to not be increasing the number of visits if the session cookie is present!

AndyButland commented 7 years ago

Hmm... just been having a check starting with the number of visits tracking. It seems to be working OK for me. Just to check this is what I've done:

Can you let me know what's different for you?

On your comment above, don't think that's the issue - that cookie is tracking if your session has been tracked, if it has, we don't want to increment the number of visits cookie as it should only count one per visit.


For location criteria, could be an issue if you are testing locally - as your IP will be 127.0.0.1 which then can't be mapped to a country using the database. There's a config value personalisationGroups.testFixedIp you can use to set an IP you know is in a given country, and it'll use that if present instead of the one detected from your request.

Hope that helps but let me know if not!

StefanoChiodino commented 7 years ago

Thanks for your reply!

I assumed the number of visits was basically number of pages loaded, and the number of sessions the number of times the website was visited!

For the location: that makes sense! Will try that now.

AndyButland commented 7 years ago

I'll close this then now assuming the explanations above have resolved the issue you were having.