This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * This method can get core components from the ACDL via eventInfo.path or by first occurance | |
| * Example 1. With an event that contains event.message.eventInfo.path value (core cmp event) | |
| * var cmpProperty = getCmpProperty(event); | |
| * Example 2. It can be used to get the page component properties even if the event was not triggered by the event | |
| * var pageCmpProperty = getCmpProperty(event, "page"); | |
| * Example 3. It can be used to get the first cmp instance of a specified component on the page | |
| * var productCmpProperty = getCmpProperty(event, "component", "product"); | |
| * returns an JSON object that contains the | |
| * this.path - the unique component path in the ACDL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var property= 'xdm:currencyCode'; | |
| var getCoreCmpJSON = _satellite.getVar("getCoreCmpJSON"); | |
| var coreCmpJSON = getCoreCmpJSON(event); | |
| return coreCmpJSON.component[property]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "event.message.eventInfo.component": { | |
| "product-7fc286dec9": { | |
| "xdm:currencyCode": "USD", | |
| "xdm:categories": [ | |
| { | |
| "repo:id": "category-086c143818", | |
| "xdm:name": "Tops", | |
| "xdm:asset": { | |
| "@type": "image", | |
| "repo:path": "https://jnz3dtiuj77ca.dummycachetest.com/media/catalog/category/outside.jpg", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Access using adobeDataLayer.getState("event.eventInfo.path") | |
| { | |
| "event": <event-name>, | |
| "eventInfo": { | |
| path: '<component-path>' | |
| } | |
| } |
OlderNewer