I use Piwik to track form-signups on different websites.
My forms are embedded in an iFrame and i put the same tracking-code
on both the Top and the iFrame. The domains is not the same, but i have
enabled third-party cookies.
The tracking works fine… I can see the same visitor visits both the top and the iframe
when visiting a page with the iframe.
But! When i run Piwik.getAsyncTracker().getVisitorId() on the Top-site it returns
a ID, but that ID is not the same in the iFrame.
I use the Visitor_id to track form signups and the right visitor_id is the id on the top page.
Seeing as the iframes are from different domains, the cookies will be different. You would need to add code so that Piwik is tracking only one siteID. There’s no way to make the cookies the same - that’s the way cookies work.
I guess another way is to make both frames come from the same domain. Use PHP to grab the contents of the other frame and then serve it from the same domain. Just a shot in the dark.
I’ts not possible for me to do.
The strange thing is , on Piwik it sees the same person on both Top and iFrame, but the cookies gets the wrong visitor_id.
Is there some way (in javascript) i can ask Piwik to give me the visitor_id from the server ?