Just getting started?

Before you create your first Dreamweaver page, define your web site folder
(Lesson for Dreamweaver MX 2004, 8, CS3, and CS4
)

Should I create a web site or a WordPress blog (or both)?

Test your Web site

Browser Test your Web site in Internet Explorer, Firefox, Safari, and other web browers

Dreamweaver Videos

Janine Warner, training videos in Dreamweaver

Free Video Sample: A lesson in when to use Dreamweaver to create Tables or CSS -- and how play the chocolate game...

"Your videos are so engaging. Thank you."

Order a training video for Adobe Dreamweaver by best-selling author Janine Warner.

Featured Tutorials

Adding an Ecommerce shopping cart to a Dreamweaver web site is easier with Google Checkout

Google Checkout

How do you register a domain name? (Tips for finding the domain you want.)

Choosing the best web hosting service to publish your site

Designing with CSS

Why use Cascading Style Sheets (CSS)?

Customize a CSS Layout
(Dreamweaver CS3 or CS4)

ecommerce web site example

Align Images with CSS floats
(Dreamweaver CS3 or CS4)

Choose the right CSS selector : Class, ID, Tag, or Compound
( Dreamweaver CS4)

Choose the right CSS Selector: Class, Tag, or Advanced
(Dreamweaver CS3)

Templates & Themes

How to use templates in blogs and web sites

Designing templates for Adobe Dreamweaver

Designing WordPress templates in Dreamweaver

Testing, Traffic, Google AdSense, Ecommerce & more

Test your Web site in Internet Explorer, Firefox, Safari, and other web browers

Traffic counters, email spam protection, newsletter services, favicons, and more

How to add Google AdSense, Flickr, YouTube, and widgets

Creating drop-down menus with Spry

Add a Drop-Down Menu in Dreamweaver CS3 or CS4

Edit a Spry Drop-Down Menu created with Dreamweaver

Create Collapsible Panels with Spry in Adobe Dreamweaver CS3 or CS4

Find Answers in the Dreamweaver FAQ

Search for answers to your questions Janine's Dreamweaver FAQ.

Quick Quiz: Test your Dreamweaver Savvy
(play and learn)

What's new in Adobe Dreamweaver CS4

Do I have to learn HTML to create a web site?

Adding Flash (.flv & .swf) to Web Pages

Insert a Flash File (.swf) (Dreamweaver CS3, Cs4)

Insert a Flash Video (.flv)
(Dreamweaver CS3, CS4)

Convert video into Flash with the Flash Video Encoder

Dreamweaver CSS Tips

Create a Navigation Bar with an Unordered List and CSS
(Dreamweaver CS3)

Troubleshooting CSS (Dreamweaver CS3)

Compare Layout Options: Tables/Layers/AP Divs/CSS(Dreamweaver 8, CS3, MX)

Review: More places to learn advanced CSS tricks & techniques

Editing HTML Code

Editing HTML Code in Dreamweaver

Connect an HTML Form to a Script in Dreamweaver (Dreamweaver CS3, CS4)

Dreamweaver Behaviors and Extensions

Use Swap Image Behavior to Create Multiple Rollovers
(Dreamweaver CS3, CS4)

Swap Image Behavior

Use a Behavior to Launch a New Browser Window (Dreamweaver CS3, CS4)

Add new features to Dreamweaver with Extensions (Dreamweaver 8 and CS3)

Dreamweaver FAQ

FAQ: Get answers to your questions, and maybe even a few you hadn't thought of yet... Search the Dreamweaver FAQ

Compare creating a web site or blog in WordPress, Dreamweaver, or Joomla

Review: What's the best option? WordPress, Joomla, Dupal, and other content management systems (CMS) comparison

Review: What's the best Web design program? Adobe Dreamweaver or GoLive, Microsoft Expression Web or FrontPage?

 

partners and sponsors

Total Training Online Software Training - Try it Now Get Free Access

_______

Dreamweaver FAQ

Search for answers to your questions, and maybe even a few you hadn't thought of yet, in the Dreamweaver FAQ.

_______

Dreamweaver CS3 advertisement CS3-DW-125x125

Trusted by over 7 million customers!

.

Inserting code from Google AdSense, Flickr, YouTube, and other sites in Dreamweaver

Dreamweaver makes it easy to design web pages without ever having to look at the HTML code behind the scenes. But even though you don’t have to learn HTML, every once in a while knowing how to work with in Dreamweaver's Code View can come in handy.

In this tutorial, you’ll find instructions for using Dreamweaver’s Code or Split View features to insert code from other sites into your pages. These instructions can be used to insert Google ads, images from Flickr, videos from YouTube, and more, into your own web pages.

Partners and sponsors

Dreamweaver CS4 Video Training

1. Inserting Google Ad Code

We’ll use Google AdSense as the main example in this tutorial but the process is similar for nearly all sites that offer features you can include on your pages. You generally begin by creating an account. In the case of Google AdSense, once you’re approved (most websites are), you simply log in to create the code needed to display Google ads for your pages. Once you’ve added the code, Google delivers ads to your site based on the content on your pages. If your visitors click on those ads, Google pays you a small fee.

Inserting Google Ad Code

2. Choosing Ad Sizes and Colors during Setup Process

As you go through the Google AdSense setup process, you can select from a variety of advertising options, including the size and colors you want for your ads. You can also create Channels to better organize and track ads on different parts of your site.

Choose Ad Sizes and Colors during Setup Proces

3. Generating Google Adsense Code

Once you’ve completed the ad setup process and specified all of the options for your ads, Google generates a unit of code in JavaScript that you can add to your webpages. You’ll need to copy all of this code, from the opening tag to the closing tag, so that you can paste the code in its entirety into the pages on your site.

Generate Google Adsense Code

4. Choosing Split View in Dreamweaver to Display Code

Now, open the page where you want to insert your ad code. Click either the Split view or Code view buttons (located in the upper-left corner of the workspace) to display the code behind the page. The advantage of using Split view (shown here) is that you can see Design and Code views at the same time. Tip: Highlight any element in Design view, such as the headline, “Saving and Editing Family Photos,” on this page, and Dreamweaver automatically highlights the corresponding code so that you can find your place more easily.

hoose Split View in Dreamweaver to Display Code

5. Inserting Google Adsense Code into Your Page

Find the exact place on your webpage where you want to insert the Google ads and click to place the cursor in that spot in the code. Note: If you paste the JavaScript into Design view, it won’t work. Choose Edit>Paste to insert the code from the website into your code. Again, make sure that you have all of the code including the opening and closing tags. If you ever want to move or remove this code, you’ll need to select all of this code.

Insert Google Adsense Code into Your Page

6. Understanding Why You Can't See Google Ads In Dreamweaver

One of the most confusing aspects of working with Google AdSense in Dreamweaver is that although you can see the code in Code view after you paste it into your page, you won’t see the ads in Design view. The only indicator that you’ve successfully added your Google ads will be a little blank space added to your design.

You Can't See Google Ads In Dreamweaver

7. Previewing Page in a Browser to View Ads

To view your ads in your pages, you’ll need to preview the page in a Web browser: Click the Preview button at the top of the workspace or choose File>Preview in Browser. As long as you’re connected to the Internet, the Google ads should automatically appear wherever you added the code to your page. Note: Google ads can take up to 10 minutes to become activated before they’ll display.

You Can't See Google Ads In Dreamweaver

8. Inserting Ads on More Pages

You can add the same AdSense code to as many pages in your site as you want. You can create a variety of ads to include in different places in your site by repeating the Google AdSense setup process and choosing different options before generating a new snippet of code. Tip: When you open Dreamweaver to add your code, leave your Web browser open so that you can easily return to Google to make changes or copy the code again, if necessary. You can switch between two programs on your computer by pressing Command-Tab (PC: Alt-Tab).

Inserting Ads on More Pages

9. Adding Google Ad Code to a Template

If you use Dreamweaver’s Dynamic Web Templates (a great way to save time and create more consistent designs), you can add Google AdSense code to a template and automatically insert ads into all of the pages created from the template at once. To do so, open the template file, choose Split or Code view, and paste the code into the template file just as you would into any other HTML page. When you save the template, choose the Update option to automatically insert the ads into all corresponding pages.

Adding Google Ad Code to a Template

10. Working with Code From Flickr and Other Sites

Although the first nine steps in this tutorial are specific to Google AdSense, the process of inserting code into a page in Dreamweaver works the same whether you’re using AdSense or any of the myriad other online advertising options, such as www.CommissionJunction.com and www.Linkshare.com. You can also use this process to add widgets or images from sites such as www.Flickr.com.

Working with Code From Flickr and Other Sites

11. Adding Code that Won't Display, such as Google Analytics

Some of the code you may want to add from sites like Google won’t appear in your webpages in a browser, making it a little trickier to add. For instance, you can use Google Analytics to track your Web traffic (with better detail than you’ll get from most Web hosts). Just insert code in a way that’s similar to the way you do it with AdSense but because the code won’t be visible on the page, save it somewhere that makes it easy to find, such as just above the body tag at the bottom of your pages.

Adding Code that Won't Display, such as Google Analytics

12. Setting Preferences for How Code Appears in Dreamweaver

If you spend a lot of time working in Code or Split view, you may want to take a minute to adjust the code preferences in Dreamweaver. Choose Dreamweaver>Preferences (PC: Edit>Preferences) and then specify your preferred options in these Categories: Code Coloring, Code Format, and Code Hints. Also note that the Code Rewriting category provides options for how (or if) Dreamweaver will alter any code to your pages.

Setting Preferences for How Code Appears in Dreamweaver

13. Publishing Pages to a Web Server

Although you should be able to test most third-party code, such as Google AdSense, by previewing your pages on your local computer, remember that your new features won’t become visible on your website until you’ve uploaded the pages to your Web server.

Publishing Pages to a Web Server

This column was originally published in Layers Magazine

Return to Dreamweaver Training Center

Partners and sponsors

Dreamweaver CS4 Video Training