April 27, 2020
Estimated Post Reading Time ~ 2 mins

How to include dynamic custom script to websites through Adobe Launch

Launch, by Adobe is a next-generation tag management system that unifies the client-side marketing ecosystem by empowering developers to build integrations on a robust, extensible platform that partners, clients, and the broader industry can build on and contribute to.

Adobe Launch is the upgraded version of Adobe’s Dynamic Tag Manager (DTM), Adobe’s Dynamic Tag Manager (DTM) will be replaced by Adobe Launch(It doesn’t mean the platform will be shut down anytime soon).

This post explains the approach to use Adobe Launch to include the dynamic scripts as part of Adobe Experience Manager(AEM) websites.

Log in to Adobe Launch and create new property- LAUNCH_CUSTOM_SCRIPT, specify the domain as localhost.local for localhost testing and Save the Property.

Adobe_Launch_aem_integration1

Define New Rule:
Adobe_Launch_aem_integration2

Configure the Event

Adobe_Launch_aem_integration3

Configure the Action
Adobe_Launch_aem_integration4


Define the script in Editor
Adobe_Launch_aem_integration5

var s = document.createElement("script");
s.innerHTML = "alert('Custom Script from GTM');"; // add the custom script content
//s.src="test.js";// specify the script file instead of script content
document.head.appendChild(s);

Adding multi-line script - example

s.innerHTML = "document.onreadystatechange = function(){ "+
"if(document.readyState=='loaded' || document.readyState=='complete') "+
"alert('test');"+
"}";

Adobe_Launch_aem_integration6

Adobe_Launch_aem_integration6-1

Adobe_Launch_aem_integration8

Publish the change to the Development environment:

Add New Library to apply the changes to Development Environment
Adobe_Launch_aem_integration9

Select the Environment value as Development
Adobe_Launch_aem_integration14

Add Specific Resource or All changed Resources to Library for Deployment to Development environment(to deploy the latest change to the Development environment, remove the current version from Library and add the latest version)
Adobe_Launch_aem_integration12

Select the Resource(CUSTOM_SCRIPT rule) Version(Latest) and Create New Revision and finally Save the Library.
Adobe_Launch_aem_integration13

Click on Apply Updates and Continue (this is required only for the first time)
Adobe_Launch_aem_integration15

Build the library for Development
Adobe_Launch_aem_integration16

Now the changes are deployed to Development Environment
Adobe_Launch_aem_integration17

To apply the new changes(latest pending changes) to the Development environment
Remove the current version from the Library(My case Revision 2)
Adobe_Launch_aem_integration18

Add the latest resource version and Click on Select&Create New Revision
Adobe_Launch_aem_integration19

Adobe_Launch_aem_integration20

Click on Save & Build for Development
Adobe_Launch_aem_integration21

Now the latest rule change is deployed to Development Environment

For testing the Property in the Development environment, install the Development script to the AEM(Adobe Experience Manager) website header.
Adobe_Launch_aem_integration11_a

(Multiple Development Environment can be added for testing)

Copy the script to clipboard
Adobe_Launch_aem_integration11

Add the script to the header page
Adobe_Launch_aem_integration11_b

Now the script is inserted into the website pages
Adobe_Launch_aem_integration22
Adobe_Launch_aem_integration23

Publish the changes to Stage and Prod environments:
Click on Submit for Approval on Library
Adobe_Launch_aem_integration24

Click on Submit
Adobe_Launch_aem_integration25

Click on Build for Stage
Adobe_Launch_aem_integration26

Now the changes are deployed to Stage

Click on Approve for Publishing to publish the changes to Production Environment
Adobe_Launch_aem_integration27

Click on Approve
Adobe_Launch_aem_integration28

Build & Publish to Production
Adobe_Launch_aem_integration29

Click on Publish
Adobe_Launch_aem_integration30

Now the changes are published to the Production environment.
Adobe_Launch_aem_integration31

Configure the Stage and Production environment scripts to corresponding AEM environments
Adobe_Launch_aem_integration32

Add New Library and follow the process explained above to send the additional changes to Development to Production Environments
aem4beginner.blogspot


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.

image

Ad Blocker Detected :(

Please consider supporting us by disabling your ad blocker.

Please Disable your adblocker and Refresh the page to view the site content.