0

I am adding jQuery to my website with Google Optimize. And I get this error in the console:

Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('') does not match the recipient window's origin ('')

Is there a way to get around this?

This is my jQuery:

$('#ab_target').click(function(){
  window.localStorage.setItem('frequency','5')
})
kgrg
  • 1,605
  • 1
  • 12
  • 14
  • Could you please add more details, how and when your code is invoked with Google Optimize? – kgrg Aug 27 '19 at 16:57
  • Yes of course. On the front end with google optimize, I added a button with html with an id="ab_target". This button needs to have the frequency set to 5 because in my back end, frequency determines the amount of an item you are purchasing which is what I am testing. So the JQuery sets frequency in the local storage to 5 so that the backend code will be able to identify the button frequency – Andreas Larsen Aug 27 '19 at 18:04
  • Do you get the error when the experiment is being applied, or when the button is clicked, and this added function is running? – kgrg Sep 06 '19 at 05:10

0 Answers0