managed-components / impact-radius

Other
0 stars 0 forks source link

405 Response on `identify` event #2

Open ashishk20 opened 9 months ago

ashishk20 commented 9 months ago

@kuba-orlik Impact Radius routing through browser with following URL on identify event Request URL: https://airalo.pxf.io/0ZDve3/cur/4440?custid=&oid=&_ir=U25%257C236e8c0e-4f25-4608-b706-eb152d49f5b9%257C1707911171436

Request Method: POST

with response as Status Code: 405 Method Not Allowed

This URL doesn't look like POST URL, Also note that custid=&oid= are blank

kuba-orlik commented 9 months ago

Thanks for the report. Could you please specify:

  1. What manager are you using to run this MC? WebCM, Zaraz, or something else?
  2. The exact steps one needs to reproduce the issue
ashishk20 commented 9 months ago

@kuba-orlik Here is how I reproduced this issue using WebCM:

Steps to reproduce :

1: Setup webcm.config.ts where target is http://localhost:3002 (this is local page depicting my website which has a single button to send track event on click )

  1. Add name of component (name should match with repo name of component impact-radius . This will automatically download and build impact-radius component which you can see at directory webcm/components/impact-radius
export default {
  components: [
    {
      name: 'demo',
      permissions: [
        'access_client_kv',
        'provide_server_functionality',
        'provide_widget',
        'serve_static_files',
        'client_network_requests',
      ],
    },
    {
      name: 'impact-radius',
      settings: {  accountId: "xxxxxxxxxx", 
      td: 'https://airalo.pxf.io/XYZ',
      id: '1234',
      iw: '10',
      },
      permissions: [
        'access_client_kv',
        'provide_server_functionality',
        'provide_widget',
        'serve_static_files',
        'client_network_requests',
      ],
    },
  ],
  target: 'http://localhost:3002',
  hostname: 'localhost',
  trackPath: '/webcm/track',
  ecommerceEventsPath: '/webcm/ecommerce',
  clientEventsPath: '/webcm/system',
  port: 8080
}
  1. run webCM with command npm run dev
  2. You will see following logs [impact radius is initialised]
    
    FOUND LOCAL MC: /Users/ashish/webcm/components/impact-radius/dist/index.js
    :: Initialising component impact-radius

WebCM, version 0.10.6

🚀 WebCM is now proxying http://localhost:3002 at http://localhost:8080

5. Use `test page` and customise the button `Click me` to send track event  button as follows
    <button onclick="webcm.track('identify')" id="sendEvent">Click me</button><br>
6. Start `test page` on 3002 port
7. Open http://localhost:8080/ on browser , webCM is a proxy which will inject its script on http://localhost:3002 page
8. You will see following request getting executed when pressed button Click me to send event! (I converted it in CURL)

curl 'https://airalo.pxf.io/XYZ/cur/1234?custid=&oid=&_ir=U25%257C304f71fd-f417-49d8-87d2-596b90ec42fb%257C1708089296926' \ -X 'POST' \ -H 'authority: airalo.pxf.io' \ -H 'accept: /' \ -H 'accept-language: en-GB,en;q=0.9' \ -H 'content-length: 0' \ -H 'origin: http://localhost:8080' \ -H 'referer: http://localhost:8080/' \ -H 'sec-ch-ua: "Not A(Brand";v="99", "Google Chrome";v="121", "Chromium";v="121"' \ -H 'sec-ch-ua-mobile: ?0' \ -H 'sec-ch-ua-platform: "macOS"' \ -H 'sec-fetch-dest: empty' \ -H 'sec-fetch-mode: cors' \ -H 'sec-fetch-site: cross-site' \ -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36' \ --compressed

9. The response is
405 POST not supported

405 POST not supported


10. Event when you try to change this method to GET (I assumed), and re-send the event , the request will have following reponse
Dead End

The link you clicked on is malformed. Contact the editor of the originating page.