AMPscript Overview Fundamental Concepts for Using AMPscript in HTML Email with ExactTarget.

Slides:



Advertisements
Similar presentations
JavaScript I. JavaScript is an object oriented programming language used to add interactivity to web pages. Different from Java, even though bears some.
Advertisements

Introducing JavaScript
1 COMM 1213 H1 COMP 4923 X1 JavaScript 1 (Readings: Ch. 10, 11 Knuckles)
Introduction to PHP MIS 3501, Fall 2014 Jeremy Shafer
The Web Warrior Guide to Web Design Technologies
14/11/11.  These words have special meanings in themselves  These should NOT be used as Identifiers.  For example:  Break, do, function, case, else,
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
XP 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial 10.
CIS101 Introduction to Computing Week 11. Agenda Your questions Copy and Paste Assignment Practice Test JavaScript: Functions and Selection Lesson 06,
XP Tutorial 1 New Perspectives on JavaScript, Comprehensive1 Introducing JavaScript Hiding Addresses from Spammers.
2012 •••••••••••••••••••••••••••••••••• Summer WorkShop Mostafa Badr
Introduction to scripting
Python quick start guide
JavaScript, Fifth Edition Chapter 1 Introduction to JavaScript.
Introduction to Python
Created by, Author Name, School Name—State FLUENCY WITH INFORMATION TECNOLOGY Skills, Concepts, and Capabilities.
Bridges To Computing General Information: This document was created for use in the "Bridges to Computing" project of Brooklyn College. You are invited.
NMED 3850 A Advanced Online Design January 26, 2010 V. Mahadevan.
Javascript. Outline Introduction Fundamental of JavaScript Javascript events management DOM and Dynamic HTML (DHTML)
CMPS 211 JavaScript Topic 1 JavaScript Syntax. 2Outline Goals and Objectives Goals and Objectives Chapter Headlines Chapter Headlines Introduction Introduction.
1 JavaScript in Context. Server-Side Programming.
TUTORIAL 10: PROGRAMMING WITH JAVASCRIPT Session 2: What is JavaScript?
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
WDMD 170 – UW Stevens Point 1 WDMD 170 Internet Languages eLesson: Variables, Functions and Events (there is an audio component to this eLesson) © Dr.
JavaScript Syntax and Semantics. Slide 2 Lecture Overview Core JavaScript Syntax (I will not review every nuance of the language)
CONTENTS Processing structures and commands Control structures – Sequence Sequence – Selection Selection – Iteration Iteration Naming conventions – File.
Chapter 3 Functions, Events, and Control Structures JavaScript, Third Edition.
Conditional Expression One of the most useful tools for processing information in an event procedure is a conditional expression. A conditional expression.
Overview of Form and Javascript fundamentals. Brief matching exercise 1. This is the software that allows a user to access and view HTML documents 2.
JavaScript Scripting language What is Scripting ? A scripting language, script language, or extension language is a programming language.
ECA 225 Applied Interactive Programming1 ECA 225 Applied Online Programming basics.
Chapter 2: Variables, Functions, Objects, and Events JavaScript - Introductory.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
Introduction to Python Dr. José M. Reyes Álamo. 2 Three Rules of Programming Rule 1: Think before you program Rule 2: A program is a human-readable set.
1 JavaScript in Context. Server-Side Programming.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
JavaScript Defined DOM (Document Object Model) General Syntax Body vs. Head Variables Math & Logic Selection Functions & Events Loops Animation Getting.
How to execute Program structure Variables name, keywords, binding, scope, lifetime Data types – type system – primitives, strings, arrays, hashes – pointers/references.
JavaScript. JavaScript Introduction JavaScript is the world's most popular programming language. It is the language for HTML and the web, for servers,
MTA EXAM HTML5 Application Development Fundamentals.
Controlling Program Flow with Decision Structures.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
JavaScript Introduction and Background. 2 Web languages Three formal languages HTML JavaScript CSS Three different tasks Document description Client-side.
Dr. Abdullah Almutairi Spring PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used,
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
Introduction to Javascript. What is javascript?  The most popular web scripting language in the world  Used to produce rich thin client web applications.
Learning Javascript From Mr Saem
Lesson 17 Mail Merge. Overview Create a main document. Create a data source. Insert merge fields into a main document. Perform a mail merge. Use data.
© 2010 Robert K. Moniot1 Chapter 6 Introduction to JavaScript.
Unit 2 Technology Systems
CHAPTER 4 DECISIONS & LOOPS
Chapter 6 JavaScript: Introduction to Scripting
IF statements.
Exploring JavaScript Ch 14
Introduction to Scripting
JavaScript Syntax and Semantics
Statement atoms The 'atomic' components of a statement are: delimiters (indents, semicolons, etc.); keywords (built into the language); identifiers (names.
4. Javascript Pemrograman Web I Program Studi Teknik Informatika
JavaScript.
WEB PROGRAMMING JavaScript.
PHP.
Tutorial 10: Programming with javascript
C Programming Language
JavaScript: Introduction to Scripting
Web Programming– UFCFB Lecture 13
Web Programming and Design
Presentation transcript:

AMPscript Overview Fundamental Concepts for Using AMPscript in HTML Email with ExactTarget

First Principles In the context of HTML Email(Email) AMPscript can be used to pull information from a Subscriber List(List) or Data Extension(DE) into an Email. AMPscript can also be used to create dynamic content driven by List or DE records. AMPscript variables and functions can be used inline or in script blocks in the head, but you cannot create AMPscript objects that exist outside of the Email. AMPscript is executed in an HTML Email at the time of send. No processing or dynamic functionality occurs after a send with one exception: View Online links pass through ExactTarget causing AMPscript to be processed again.

Scripting – Inline vs Script Blocks In general the AMPscript is usually located within the <head> section of the email and resides within a special AMPscript delimiter: %% is used within ExactTarget to open and close any AMPscript within an Email. Variable declaration and assignment is usually kept in the head as well. Script Blocks are set up using this format: %%[ opens a script block ]%% closes a script block Script blocks are used when there are; variable declarations or assignments, statements, functions or anything more complex than a variable call. Inline AMPscript is set up using this format: %% opens a inline variable call %% closes an inline variable call Inline AMPscript should be used to call variables into the HTML. Inline variable calls can be combined with AMPscript Functions.

Script Block and Inline Code Examples %%[ set @hello = “Hello” set @world = “World” ]%% Inline: <tr> <td>A typical first program is known as the %%=v(@hello)=%% %%=v(@world)=%% program.</td> </tr>

Variable Scope It’s best to think of the scope for AMPscript variables as either Local or List. There aren’t true global variables in AMPscript. Local variables can be declared and assigned with any value, but are frequently used to pass a list value to the email. Local variables are declared using the keyword ‘var’ Local variables are assigned with the keyword ‘set’ and must have an ‘@’ followed by at least one letter, number or underscore. List variables have only one value and that value is assigned by the record they belong to. List variables do not need to be declared and are instantiated at when tied to a data extension. Please note that you can call as many Local variables as you would like, but you cannot call more List variables than there are in the Data Extension.

Common Conditional Statements If statements In AMPscript if statements work like most other scripting or programming languages. If statements require an ‘If’ a ‘Then’ and an ‘endif’. If statements can include ‘elseif’ and ‘else’ statements as part of the expression. Example: %%[ if @sline = “S1” then set @subjectline = “This is sline 1” else set @subjectline = “This is not sline 1” endif ]%%

Common Conditional Statements - Continued While the ‘If’ statement is incredibly useful and versatile, There are other conditional operators used in AMPscript. Comparison operators: == Strict equal, != not equal, > Greater than, < Less than, >= Greater than or equal to, <= Less than or equal to Join operators AND both conditions must be true OR either condition must be true NOT reverses the Boolean expression

Common Conditional Statements - Examples Joined If statement: %%[ if @sline == “S1” and @creativeVersion == “V1” then]%% <tr> <td>This text will show up if these conditions are both true</td> </tr> %%[endif]%% %%[ if @sline != “S1” then]%% <td>This text will show up if sline does not have a value of ‘S1’</td>

Common AMPscripting Functions AMPscript has many built in functions some of the most common and useful are v() and PROPERCASE() V() is used to call local variables inline. <tr> <td>A typical first program is known as the %%=v(@hello)=%% %%=v(@world)=%% program.</td> </tr> PROPERCASE() is used to propercase local or list variables. %%[ var @firstname set @firstname = ProperCase(firstname)]%% UPPERCASE() is used to propercase local or list variables. set @firstname = UpperCase(firstname)]%% LOWERCASE() is used to propercase local or list variables. set @firstname = LowerCase(firstname)]%%

Using AMPscript in ExactTarget ExactTarget has two features that can be used to QC and Test AMPscript in an HTML Email. Validation of an email does two things: Verifies that all of the list variables called or included in the email are included in the DE you’ve chosen to validate against. Checks for gross AMPscripting syntax issues. Primarily missing endif’s or unclosed script blocks. Send Preview of an email can be used to verify the following: There are no gross AMPscript syntax issues The AMPscript functions properly within your HTML. For example if you have a line of text that is supposed to populate, but doesn’t you can infer that your AMPscript is incorrect.

Using AMPscript in ExactTarget - Validation To validate you must have an HTML file loaded into ExactTarget. After checking the box next to the email click ‘Validate’ and select a ‘Sendable Data Extension’ to validate against. If the AMPscript and list work together you will receive a ‘No problems found.’ message. If there is a problem you will receive an error notification that can be used to troubleshoot the AMPscript.

Using AMPscript in ExactTarget – Send Preview To Send Preview you must have an HTML file loaded into ExactTarget. After checking the box next to the email click ‘Send Preview’ and select a ‘Sendable Data Extension’ to generate a preview against. If the AMPscript and list work together you will receive see the Email display correctly with each piece of content that should be included. If there is a problem you will receive an error notification that can be used to troubleshoot the AMPscript.

Putting It Together Most frequently Merkle uses AMPscript to drive dynamic versioning and dynamic content within the same HTML. The if statement, especially when paired with comparison operators or join statements, is an incredibly versatile tool for building HTML Email with a high degree of customization. If statements can be used to drive messages and content based on very specific audience data within the same HTML. Validation and Send Preview can be used to test and troubleshoot email functionality.

Additional Information ExactTarget AMPscript Syntax Guide