Expand my Community achievements bar.

SOLVED

Adobe Target experience targeting activities not working when website loaded in iframe

Avatar

Level 3

We have enabled Adobe Target experience targeting activities on our website (say www.abc.com). When loading the site directly from browser the activities are working fine.

When our site is been been loaded in another portal(/website) in an iframe say:

<iframe id="frame" src="www.abc.com">
</iframe>

, the target activity is not working.

 

Could you please help in resolving the issue, what could be the cause of issue.

1 Accepted Solution

Avatar

Correct answer by
Level 3

Issue got resolved by adding secureOnly attribute to targetGlobalSettings.

window.targetGlobalSettings = {
	secureOnly: true, 
        cookieDomain: window.location.hostname
 }; 

View solution in original post

6 Replies

Avatar

Employee Advisor

It's difficult to troubleshoot without more information. You're welcome to send more details in a private message, so I can look at the implementation

Avatar

Level 3

Hi @alexbishop ,

We are seeing following warning in the browser console when loading our website (having target activity) inside a iframe:

 

Error warning Adobe Target content delivery is disabled. Ensure that you can save cookies to your current domain, there is no "mboxDisable" cookie and there is no "mboxDisable" parameter in query string.

Does this mean if we load our website in an iframe. The target activities created for our website would not work?

Avatar

Employee Advisor

With certain domain structures, you need to tell Target which domain to set cookies against, which you can do by setting the cookieDomain value within window.targetGlobalSettings.

How you use it is explained here but for your cookieDomain example it should look something like,
image.png
You need to declare this targetGlobalSettings object before you load the Adobe Target script

 

Avatar

Level 3

Hi @alexbishop ,

I tried setting window.targetGlobalSettings.cookieDomain to that of our site domain and that of the parent site domain in which our application is embedded as iframe. It is not working in both the scenarios.

Avatar

Employee Advisor

Ok, it's difficult to troubleshoot further unless you can provide a link to the page with the iframe. If that's not possible or is a restricted dev environment that can't be accessed outside of company network then I'd suggest raising a ticket with our customer care team

Avatar

Correct answer by
Level 3

Issue got resolved by adding secureOnly attribute to targetGlobalSettings.

window.targetGlobalSettings = {
	secureOnly: true, 
        cookieDomain: window.location.hostname
 };