You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I did the set up yesterday and it works fine. I'm now sharing user data between websites, which is absolutely amazing :) Kudos to @ecaroth!
There is still something I didn't succeed to achieve. My first use case is about sharing data between an online store and its knowledge base. This way, we can see which customers are actually using the knowledge base. It works well but sometimes, customer data would be updated on the online store. Here is the data I'm writing in the cookie:
<script type="text/javascript" src="//app.helpman.io/xdomain_cookie.js"></script>
<script type="text/javascript">
var helpman_cookie = xDomainCookie('//app.helpman.io');
var customer_data = {
"distinct_id": "{{ customer.id }}",
"name": "{{ customer.name }}",
"email": "{{ customer.email }}",
"custom_fields": {
"lifetime_spent": "{{ customer.lifetime_spent }}",
"last_order": "{{ customer.last_order.created_at }}",
"tags": "{% for tag in customer.tags %}{{ tag }} {% endfor %}"
}
};
helpman_cookie.set('helpman_petitkiwi', JSON.stringify(customer_data));
</script>
I'm interested to share key data about each customer, that's what I put in custom_fields. This data will be updated regularly.
But actually the cookie data is not shown as updated on the knowledge base side. I suspect local storage to be the culprit, but I don't see the cookie stored locally using the Chrome development tools.
Any idea?
The text was updated successfully, but these errors were encountered:
@mhulet - From what I am understanding, your app is setting the customer_data object, which is periodically updated, and then the knowledge base is just reading the object. What I think is happening is that the knowledge base is using the cached local cookie, which will possibly contain a stale value of the data (but return faster).
To fix the issue, you should use xdomain_only=true for the xDomainCookie setup in the knowledge base, so it doesn't use a local cached version of the cookie and will always read the most recent from the shared cookie. I just updated the readme to contain more info on this (see the section Cross Domain ONLY Cookies, which goes into more detail.
Also, as a note - just bumped the version to 1.0.4, which contains some security updates and a few small bugfixes. The last version (1.0.3) should still work for you, but I encourage you to update to 1.0.4 if you can. Thanks!
I did the set up yesterday and it works fine. I'm now sharing user data between websites, which is absolutely amazing :) Kudos to @ecaroth!
There is still something I didn't succeed to achieve. My first use case is about sharing data between an online store and its knowledge base. This way, we can see which customers are actually using the knowledge base. It works well but sometimes, customer data would be updated on the online store. Here is the data I'm writing in the cookie:
I'm interested to share key data about each customer, that's what I put in
custom_fields
. This data will be updated regularly.But actually the cookie data is not shown as updated on the knowledge base side. I suspect local storage to be the culprit, but I don't see the cookie stored locally using the Chrome development tools.
Any idea?
The text was updated successfully, but these errors were encountered: