When clicking on a link that links to my Sitecore site, I expect Tracker.Current.Interaction.Referrer to be filled. However, it is not.
I know there are scenario's where you don't get a Referrer: https://stackoverflow.com/a/6880668/1797792
Strange thing is however, that HttpContext.Current.Request.UrlReferrer.Host does contain the referrer in my case. So why isn't the Sitecore Tracker aware of this? And more importantly, how do I make it aware?
Turns out that Tracker.Current.Interaction doesn't reset if you come from a different referrer. It is saved in the session.
It only sets the Tracker.Current.Interaction.Referrer if Tracker.Current.Interaction == null
Closing the browser and then coming clicking on a link referring to the site will fill Tracker.Current.Interaction.Referrer like expected.
Related
Has anyone worked with enabling/disabling tracking consent with sitecore 10.1?
I tried the below but it does not seem to work as consentChoice.IsGiven is always returned as true(even after the revoke code is executed):
: https://doc.sitecore.com/xp/en/developers/101/sitecore-experience-platform/manage-a-contact-s-tracking-consent-choices.html
Also, when I set explicitConsentForTrackingIsRequired to true for my site the tracking code starts giving an error.
Regarding
consentChoice.IsGiven always returning true, my initial suspect is your browser cache, your previous site visit might have already captured or set SC_TRACKING_CONSENT (which is set on call to GiveConsent) , if this cookie exists consentChoice.IsGiven is always read from here.
You may need to test this better with either incognito(if using chrome also ensure no shared incognitos) or ensure to force hard refresh (clear cookies) before testing this.
Tracking error code you are facing when explicitConsentForTrackingIsRequired is set to true, this could be due to multiple issues -> ensure xDB tracker is enabled before enabling the consent setting, or check if you have any code attempt to explicitly Start Tracking or access to Tracker.Current.Contact before User Consent has been given. This may throw random errors and error log would help pin point these if you have better example of errors facing.
In addition to these I had also faced errors using this in conjunction with sitecore forms:
When using forms along with explicitConsentForTrackingIsRequired there is an issue where forms auto starts tracking on interaction with form elements , forms has a missing condition check for User Consent before starting tracking.
Please check the answer here for workaround if it is the case.
My app is rather barebones right now, so it might be a very stupid mistake by my side. I'm testing with cucumber signing out with devise
Scenario: User signs out
Given I am logged in
When I sign out
Then I should see a signed out message
Everything is pretty standard, I've set devise to accept get requests for signing out, and from my logs everything appears to work as expected. Only problem is the last step, the flash/notice message doesn't show up, which is very weird (as always with devise, I don't know who's setting what and where...).
This is my layout view:
%body
- unless notice.blank?
%p.notice= notice
- unless alert.blank?
%p.alert= alert
= yield
What I see is a completely blank page... I've already checked locales, the message is there. The sign_out call is the standard one. Flash messages appear to be completely empty (blank).
What course of action would you suggest I take in order to debug this?
A website I am currently working on is currently responding to requests on http://www.mysite.com/dv with 301, where I would have expected a 404.
My site has no content item named DV, there is nothing in the site that corresponds to "DV", and I can't understand why on earth I am seeing this. I originally found these /DV/ URLs while looking at Google Webmaster Tools.
Then I used Fiddler to analyse the request and found
Response sent 26 bytes of Cookie data:
Set-Cookie: wwwwebsite#lang=DV; path=/
This appears to correspond to the Maldivian language. I did not enable this language, and it does not appear under /system/Languages.
I then noticed I can also navigate to http://www.mysite.com/de-CH which is not an enabled language on my site either, leading me to believe I will get results like this for every non-enabled language.
Is there a way to return 404 for unsupported languages in Sitecore?
Try seeing what your "languageEmbedding" value in the web.config is set to.
It can be set to the following: asNeeded | always | never
I would normally set it to "never" unless you have a site, which is set in multiplate languages, then set it to "always". The default is "asNeeded" which I frankly find kinda silly :)
The issue you are having sounds similar to http://sdn.sitecore.net/Forum/ShowPost.aspx?postid=51681 but I an't find DV in LanguageDefinitions.config. I am also able to replicate your error so I don't think it is environment specific to your implementation. Would suggest you contact Sitecore Support.
I don't believe this is actually related to languages at all. If you were to add any random characters in place of the DV, you'd still get a 302 redirect to a 404. Perhaps without the language cookie though.
You should follow the directions here to turn on server side error page redirects.
http://herskind.co.uk/blog/2012/03/sitecore-404-without-302
Where can I make changes if I want to make permanent changes in cookie-path value for my website. will that be in context.xml or web.xml or will that be using newCookie.setPath() method only? The server is Tomcat 6.0. I did look online but have not found anything, to the point.
Its just that there is some problem with the session tracking and admin thinks that this requires changing path of my session cookies from /site-folder to /. Is he wrong?
It might not be something considered good programming trick, but to change the sessioncookiepath value, web-app>METAINF>context.xml file is the place. For perticulary my problem, putting following code helped: Context sessionCookiePath="" This might be due to my website structure.
On very rate occasions, my error log is showing the following error:
"You specified a Fuseaction of registrationaction#close which is not defined in Circuit public."
The full link is:"http://myUrl/index.cfm?do=public.registrationAction#close"
As you can see, the has merely points to an anchor (close) on the page.
This code is working 99% of the time, but on the odd occasion, Coldfusion / Fusebox throws this error out.
Why is this happening?
Could it be related to the device accessing my page somehow? Like a cell phone or Apple product that for some reason does handle hashes the way I am expecting it to?
Could it be javascript / JQuery being disabled?
Any guidance would be appreciated
Thanks
I used to see stuff like that. Older versions of Internet Explorer were not handling the hashtag properly when there were URL parameters. The best solution I could come up with was kludgey at best, but basically it forced the anchor tag to separate from the URL parameter.
http://myUrl/index.cfm?do=public.registrationAction&#close
I'm not sure there is a simple answer to this. We get odd exceptions all the time on our site for all sorts of reasons. Sometimes it's people not using the site the way you expect and sometimes it stuff like you mention such as user-agent edge cases etc.
Basically you need to start to gather evidence and see what comes up that's unusual with these requests.
So to start: do you catch exceptions in you application? If so dumping all scopes (CGI/CLIENT/FORM/URL/SESSION) in an email along with the full exception and emailing them to a custom emails address (such as errors#yourdomain.com) will give you a reference you can square up to your error times and this might give you a hint as to the real issue.
Hope that helps some!