1

So I have amp almost completely implemented on my site, but I am currently stuck on finishing up the EU-Cookie consent stuff. Right now I am using an amp-user-notification to show the user a notification in the bottom corner of the screen that cookies are being tracked. I have a data-show-href configured and working to check a cookie that I am trying to set in the data-dismiss-href handler.

Inside the data-dismiss-href I am simply calling a .net httphandler that sets a cookie, sets the headers for the response and writes a blank response ( since Google states in their docs that it doesn't expect anything back).

The issue is actually when I click the dismiss button first it makes a POST request to the url i gave, it sets the cookie, and the response is written as a 200 OK. BUT THEN another POST request is made to the actual page that the user is on for some reason, which is causing the following error:

Failed to parse response JSON: SyntaxError: Unexpected token < in JSON at position 0​​​

of course this is because the POST request to the page is returning HTML, not JSON data. So i am not sure why it is making this second POST request. Any ideas?

Sanchit Gupta
  • 3,148
  • 2
  • 28
  • 36
  • Hi there, have you found a solution for this? Are you trying to handle only an "allow/don't allow" policy or are you trying to let the user opt in and out of several tracking categories? – SeikoTheWiz Feb 20 '18 at 16:20

0 Answers0