Scaffold for using Web SDK to send events for Analytics to consume, with Adobe Client Data Layer (ACDL) as the data layer.
Required extensions:
- Adobe Client Data Layer
- Adobe Experience Platform Web SDK
- Core
- Data Element Assistant
- Mapping Table
| /** | |
| * eventsAtPurchaseStart: events to start timer | |
| * eventsToTimeAfterPurchaseStart: events to measure duration since timer start | |
| * eventsAtPurchaseComplete: events to stop timer | |
| */ | |
| var eventsAtPurchaseStart = [ | |
| 'scOpen', | |
| 'event1', | |
| 'event2', | |
| 'event3', |
| /** | |
| * Dependencies: | |
| * | |
| * Data elements: | |
| * Experience Cloud ID Service visitor instance | |
| * - extension: Core | |
| * - data element type: Custom Code | |
| * | |
| * URL hostname: | |
| * - extension: Core |
Scaffold for using Web SDK to send events for Analytics to consume, with Adobe Client Data Layer (ACDL) as the data layer.
Required extensions:
| // update Activity Map to determine how to get its region and link | |
| s.ActivityMap.originalRegion = s.ActivityMap.region; | |
| s.ActivityMap.region = function(element) { | |
| if (element) { | |
| // set the region based on the element's (or ancestor's) "data-section-id" attribute | |
| var currentElement = element; | |
| var sectionId = currentElement.getAttribute('data-section-id'); | |
| while (!sectionId && (currentElement = currentElement.parentElement)) { | |
| sectionId = currentElement.getAttribute('data-section-id'); | |
| } |
| #!/bin/bash | |
| # Load RVM into a shell session *as a function* | |
| if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then | |
| # First try to load from a user install | |
| source "$HOME/.rvm/scripts/rvm" | |
| elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then |
Sample code for Web SDK to improve collection of data from clicked links (download, exit, other).
Required data elements:
| /** | |
| * Add a "data-content-section-name" attribute to all page content sections. | |
| * | |
| * Page content sections are determined in this order: | |
| * 1. Wherever there is a DIV with an "id" attribute in the container DIV. | |
| * 2. DIVs that are immediate children of the container DIV. | |
| * ... more methods can be added as required. | |
| * | |
| * In all cases, when the identified content section's DIV has a "data-content-section-name" attribute already, | |
| * then that attribute is left alone. |
| /** | |
| * Add "data-link-title" to all signup modal DIVs using the DIV's inner text (or first class name if there is no innertext) | |
| */ | |
| const signupModals = document.querySelectorAll('a[data-toggle="modal"][data-target="#signup"]:not([data-link-title]), div[data-toggle="modal"][data-target="#signup"]:not([data-link-title])'); | |
| signupModals.forEach((signupModal) => { | |
| const signupModalText = (signupModal.innerText || signupModal.textContent).trim(); | |
| if (!signupModalText) { | |
| // inner text not found | |
| // if there's an image, use its "alt" attribute | |
| const imageElement = signupModal.querySelector('img'); |
| Add this script to a Google Apps Script project. | |
| See the JSdoc at `autoDeclineMeetings()` for trigger setup instructions. |