Expand my Community achievements bar.

SOLVED

Iframe and main page unique visitor

Avatar

Level 1

Hi Adobe experts,

 

I have a question regarding unique page visitors.

 

Scenario:

I have a website and it has an iframe. On page load, the unique visitor has a value of "new". However, when I interacted with the form, the unique visitor became "new" as well where it should be "repeat". 

 

Here is my setup for the Marketing Cloud:

kimpeeey_0-1709824367253.png

Note that the MCID for both iframe and main page are already the same.

 

The code below was also added on Adobe Analytics extension to capture the New Repeat Visits

s.eVar12 = s.getNewRepeat(90);

 

Question:

Is there any setup or suggestion that you can give me so the iframe will have "repeat" value without hardcoding them? I already used Common Analytics plugin before but it did not work as well

 

Thanks in advanced!

 

1 Accepted Solution

Avatar

Correct answer by
Employee

Hi @kimpeeey, thanks for the details.

 

As mentioned in the documentation: 

This function returns the value of "New" if the cookie set by the plug-in doesn’t exist or has expired. It returns the value of "Repeat" if the cookie set by the plug-in exists and the amount of time since the current hit and the time set in the cookie is greater than 30 minutes. This function returns the same value for an entire visit.

 

If:

  • it's the first visit of the visitor
  • the time between the landing page and the form page is less than 30 mins, the plugin will always return "New"

aa_from_savoy_0-1709887308085.png

Bear in mind also that you have an iframe, so the domain of the landing page and the form (included via iframe) probably are different. Therefore, the cookie set by getNewRepeat() in the home page is written on mydomain.com, and is not accessible by the domain of the form (anotherdomain.com). This means that, when the iframe is rendered, the cookie in anotherdomain.com is not presented, and therefore is labeled as "New", as per documentation.

 

aa_from_savoy_1-1709887528232.png

 

If you want a different behaviour you need to implement something custom, or use other variables available out of the box.

 

Hope this helps.

 

Best

 

View solution in original post

8 Replies

Avatar

Employee

Hi @kimpeeey ,

where do you see the value "new" and "repeat"? It's a custom variable or something out-of-the-box?

Avatar

Level 1

Hi @aa_from_savoy 

 

Good day!

 

We assigned 1 variable to capture this value(evar12).

 

Thank you.

Avatar

Level 1

Hi @aa_from_savoy 

Good day!

 

The unique visitor has a value of "new" on the first visit then when there's a form interaction it should be "repeat"

 

I have already tried following what's on this tutorial(https://experienceleague.adobe.com/docs/analytics/implementation/vars/plugins/getnewrepeat.html?lang...) however, this does not work as well.

 

The code below was also added on Adobe Analytics extension to capture the New Repeat Visits

s.eVar12 = s.getNewRepeat(90);

 

Thank you!

Avatar

Correct answer by
Employee

Hi @kimpeeey, thanks for the details.

 

As mentioned in the documentation: 

This function returns the value of "New" if the cookie set by the plug-in doesn’t exist or has expired. It returns the value of "Repeat" if the cookie set by the plug-in exists and the amount of time since the current hit and the time set in the cookie is greater than 30 minutes. This function returns the same value for an entire visit.

 

If:

  • it's the first visit of the visitor
  • the time between the landing page and the form page is less than 30 mins, the plugin will always return "New"

aa_from_savoy_0-1709887308085.png

Bear in mind also that you have an iframe, so the domain of the landing page and the form (included via iframe) probably are different. Therefore, the cookie set by getNewRepeat() in the home page is written on mydomain.com, and is not accessible by the domain of the form (anotherdomain.com). This means that, when the iframe is rendered, the cookie in anotherdomain.com is not presented, and therefore is labeled as "New", as per documentation.

 

aa_from_savoy_1-1709887528232.png

 

If you want a different behaviour you need to implement something custom, or use other variables available out of the box.

 

Hope this helps.

 

Best

 

Avatar

Level 1

Hi @aa_from_savoy 

 

Good day!

Thank you for the clarification. I just have one last question, So even if the MCID is the same on both the main page and the iframe, there's still a chance that the value will be "new"?

 

All the best!

Avatar

Employee

Yes, because the logic to define "new" or "repeat" is based on the cookie s_nr that is written by the getNewRepeat() plugin. It's a logic that works in the context of the client and the domain, it does not have any clue on what happened before on another domain, even with the same MCID.

 

Best.