sap-tutorials / Tutorials

Tutorials on sap.com
https://developers.sap.com/tutorial-navigator.html
Creative Commons Attribution 4.0 International
720 stars 773 forks source link

Add SAP Web Analytics Tracking Snippet #4434

Closed superwangnan closed 4 years ago

superwangnan commented 4 years ago

Tutorial URL: https://developers.sap.com/tutorials/cp-webanalytics-add-tracking-snippet.html

Please specify the step you are referring to

I got following error, how to overcome it? image

Karunaharan commented 4 years ago

Hi @superwangnan We are looking into the issue and will get back to you as soon as we have the right solution for you. Thanks.

Karunaharan

Karunaharan commented 4 years ago

Hi @superwangnan In your application, you need to allow https://events.wa.canaryac.vlab-sapcloudplatformdev.cn to access it. You can do it by adding this snippet to your application header. Access-Control-Allow-Origin: https://events.wa.canaryac.vlab-sapcloudplatformdev.cn

You can also add the below to let any application access yours Access-Control-Allow-Origin: *

It will handy if we can see your application code so that we can help you best. Please let me know if this helps you.

superwangnan commented 4 years ago

This is a SAP UI5 application and I deployed it in SAP Cloud Platform, please refer to my index.html code as following, where should I put this header? Thanks.

<!DOCTYPE HTML>

Access-Control-Allow-Origin: * ESPM-UI
Karunaharan commented 4 years ago

It looks fine now. Please redeploy your application to SAP Cloud Platform and then you should be able to send tracking events to SAP Web Analytics. Feel free to reach out for further questions.

MichaelCzcz commented 4 years ago

@superwangnan Thank you for your feedback. The issue seems to be resolved, so I am closing the issue.

If you still have questions, feel free to reopen the issue.