# Integrating Javascript SDK With Adobe Launch You can integrate Treasure Data JavaScript SDK with Adobe Launch by embedding custom code inside Adobe Launch that triggers specific events based on the criteria you select. With Adobe Launch you can manage your Treasure Data tags and keep track of where tags are implemented including which triggers are selected, and the data elements you want to capture. * [Prerequisites](/products/customer-data-platform/integration-hub/streaming/td-javascript-sdk/integrating-javascript-sdk-with-adobe-launch#h2_1644201065) * [Integrate Treasure Data JavaScript SDK Code into Adobe Launch](/products/customer-data-platform/integration-hub/streaming/td-javascript-sdk/integrating-javascript-sdk-with-adobe-launch#h2_1592925414) * [Test Your Changes](/products/customer-data-platform/integration-hub/streaming/td-javascript-sdk/integrating-javascript-sdk-with-adobe-launch#h2_558647184) ## Prerequisites * Adobe Launch * Knowledge of Treasure Data * Treasure Data JavaScript SDK (JS SDK) Treasure Data recommends you verify the implementation of any new features or functionality at your site using the Treasure Data JavaScript SDK version 3 before you start using it in production. It manages cookies differently. Be aware when referring to most of these articles that you need to define the suggested event collectors and Treasure Data JavaScript SDK version 3 calls in your solutions.For example, change //cdn.treasuredata.com/sdk/2.5/td.min.js to //cdn.treasuredata.com/sdk/3.0.0/td.min.js. ## Integrate Treasure Data JavaScript SDK Code into Adobe Launch 1. Log in to Adobe Launch. 2. Select **Properties.** 3. Select the name of the property in which you want JS SDK to run. If no properties have ever been created in the account, this screen might be empty and you need to create a **New Property**. ![](/assets/image-20200617-153956.5e37bca2d487f76921644f6988b9db33b34d0ea8a922600aa036c38fe5c6a105.ef656343.png) 1. After selecting the property, navigate to the **Rules** tab, and select **Add Rule.** ![](/assets/image-20200616-180320.0ea280320bd812fba758031c5ee450df0b6eefe0689f4402b5299c2a2c05730f.ef656343.png) The JS SDK is loaded on your site by creating a rule in Adobe Launch that triggers upon page load. 5. Create a rule that loads the JS SDK library at the top of the page, so that the page loads and executes the custom code. ![](/assets/image-20200616-180427.bf528a7c41819927571665f386fcff480368082f1c66e7caf210b7e893af9ba3.ef656343.png) 1. Type in the custom code. ```javascript // track pageview information to 'pageviews' table td.set('pageviews', {foo: 'foo', bar: 'bar'}); td.trackPageview('pageviews'); ``` 1. Create additional rules that include various functions such as track pageviews, track form_submits, or click_events. ![](/assets/image-20200616-180527.9f25096bec30b6766f634e7f068272a22260eaf3541913300390f04b268165ac.ef656343.png) You can choose to create multiple rules or one rule that includes all the functions to track. For example, you can create a rule to tracks events, anonymized page user settings, or for form fills only on specific pages. 1. The rules are loaded and execute the custom code you write. ![](/assets/image-20200616-180559.3be7337e8249122e00ba351c37649f5d1a80ed00c50d5cd88362724aec882af8.ef656343.png) 1. After you have created all the rules you want, select **Publishing**. ![](/assets/image2021-4-26_21-12-17.3ef0b7d673ba8675d18f72afc8d9232c4198720b55bc57390121c915e9ea9b04.ef656343.png) 1. Add the rules that you created, build, and publish. ![](/assets/image-20200616-181108.7b1409d0d5293ac3a4d794952a88d0e52694f6e73dfef90b2d2e0a7229788061.ef656343.png) 1. Select **Save & Build for Development**. ![](/assets/image-20200617-151246.028fae99b85164e2dc42b074ec16fd69a38f437ad5ae7d1e1644e29e24553017.ef656343.png) After the build completes successfully, you can: 12. Deploy the code to various environments using the **Environments** tab. ## Test Your Changes 1. You can test your changes using [Adobe Experience Cloud Debugger](https://docs.adobe.com/content/help/en/debugger/using/experience-cloud-debugger.md) to troubleshoot without deploying the code to your production environments. 2. After you download the extension, navigate to the site where you want to test your code. 3. Return to Adobe Launch. 4. Select **Environments**. 5. Select the cube icon and copy the code displayed. ![](/assets/image-20200616-181242.522f771cda913c202f53eef13b966e99dab020e7e970ebb5bd4d201ba7ad29bb.ef656343.png) 1. Launch the Adobe Experience Cloud Debugger. 2. Select **Tools**. ![](/assets/image-20200305-051408.e760ae585ab3f357ef39cb062b7707d65ec91c8f1d9386d6911a285e83a53bfa.ef656343.png) 1. Scroll down to Adobe Launch, paste the copied code, and select **Save**. ![](/assets/image-20200305-051345.07194d8e27a6af876052a295d6af643b87aa1d0f89a1aa585c0b41d3d744238c.ef656343.png) 1. Navigate to the site where you replaced the launch embedded code in the previous step. 2. If you have the JS SDK to track page views, review a few pages on the site and check the pageviews table in the CDP to see if data shows up in the table.