adding iframe for cross domain tracking help
So I am trying to track a page view goal.
My experiment is running on SITE1.com but my page view goal is on SITE2.com
I read the help article on adding a hidden iframe as a wordaround, but I'm still confused on how to implement it exactly.
My sites are both running on Wordpress if that makes a difference.
So do I put put an iframe for SITE1.com on SITE2.com? And how does the code look? Does it look exactly like it's written out on the image on this page - https://help.optimizely.com/hc/en-us/articles/2013
What you do is create a new page on SITE1.com that is completely blank except for the code shown in the example (just substitute your own project code). For this example, let's say you call that page /confirmation.
Then you set your pageview goal to SITE1.com/confirmation.
Now on the real destination page (SITE2.com), you have to load SITE1.com/confirmation so that the pageview goal is triggered, but you want do it in a way that doesn't affect what is actually shown on SITE2.com. So on the real destination page of SITE2.com, you add this code:
<iframe style="display:none" src="SITE1.com/confirmation"></iframe>
Just update the bold part. The display:none style makes this iframe invisible, so that it doesn't affect how the page on SITE2.com looks.
Does that help?
What happens is that once a user is bucketed into an experiment, Optimizely keeps a log of all the URLs that the user lands on that contain the same Optimizely snippet moving forward. So if a user gets bucketed into an experiment on SITE1.com and navigates to SITE2.com -- if SITE2.com has the iframe SITE1.com/confirmation, then Optimizely will be able to log the SITE1.com/confirmation page as it contains the snippet and the user presumably is bucketed into the experiment at that point.
Let me know if any of that is unclear!
Manager, Technical Support
You'll want to add the snippet on Site 1 **AND** in on the blank Site 1 page that is iframed on Site 2. That will allow the Optimizely actions to be tracked across both sites. Does that help?
We actually have a great article that provides quite a lot of detail on this as well as some helpful images: https://help.optimizely.com/hc/en-us/articles/2013