PayPal Hacks. 100 Industrial-Strength Tips and Tools Free Open Book

PayPal Hacks. 100 Industrial-Strength Tips and Tools

Previous Section  < Day Day Up >  Next Section

Hack 84 Track Google Referrals

figs/expert.gif figs/hack84.gif

Use Google's AdWord Conversion Tracking system and PayPal's IPN system to track sales made from Google advertising.

Google has emerged from the search engine wars as the clear winner to date. Its fast, accurate search results are presented in a way that enables users to get search results quickly without the tool getting in the way, unlike many other search engine portals. It is the most widely used search engine on the Internet, and its builders continue to innovate.

Among those innovations is a self-service advertising system that enables small merchants to get wide exposure in a cost-effective, pay-per-click arrangement. When a web surfer looking for an item—a widget, say—goes to Google and types the name of the product into the search box, not only are the search results from the Google Page Ranking system displayed, but so are small, text-based ads related to widgets. As a widget vendor, you can target your AdWords ads to be displayed when a surfer enters certain widget-centric combinations of keywords. However, Google charges you only when a person actually clicks on your ad.

In the field of marketing, the effectiveness of an advertising effort is measured by its conversion rate. The conversion rate can be measured in a variety of ways, but generally it is the sales generated by advertising, divided by the number of impressions (times a consumer sees the ad). For AdWords, Google defines a conversion as "when a click on your ad leads directly to user behavior you deem valuable, such as a purchase, signup, page view, or lead." This corresponds to the marketing industry's response to purchase conversion rate: the number of purchases divided by the number of clicks-through. Understanding the conversion rate of a given ad can help you refine your AdWords ad copy and decide if the campaign is bringing the return on investment you expect.

Google provides a mechanism to help you tally purchases that come from customers clicking AdWords ads. This mechanism is triggered by a small piece of code you place in your transaction processing system. This hack shows how to enable a Google AdWords ad in your PayPal eCommerce system and track sales from that ad's referrals. The system consists of three parts:

  • A tracking-enabled Google AdWords placement

  • A PayPal-enabled selling page

  • An IPN page with the Conversion Tracking Code

7.24.1 Modifying Your Google AdWord Placement

You need to have one or more Google AdWord placements that refer people to your PayPal selling page. You can have as many ad placements as you like.

Log into the Google AdWord system (http://adwords.google.com), go to your campaign summary, and click the Conversion Tracking tab to display the screen in Figure 7-2.

Figure 7-2. Obtaining the AdWord code from Google's Conversion Tracking page
figs/pph_0702.gif


You will see an option to select Basic Tracking or Customized Tracking; select the Customized Tracking option. Select the Purchase/Sale option from the tracking options, which brings you to a page that has a generated a snippet of tracking code. Copy and paste the code into a text editor. It should look something like this:

<!-- Google Conversion Code -->

<script language="JavaScript">

<!--

google_conversion_id = 1234567890;

google_conversion_language = "en_US";

if (1) {

 google_conversion_value = 1;

}

google_conversion_label = "Purchase";

-->

</script>

<script language="JavaScript" src=

                "https://www.googleadservices.com/pagead/conversion.js">

</script>

<noscript>

<a href="https://services.google.com/sitestats/en_US.html" target=_blank>

<img height=27 width=135 src=

                "https://www.googleadservices.com/pagead/conversion/1234567890/?value=1&

label=Purchase&hl=en">

</a>

</noscript>

You'll place this code in your IPN processing page. But first, copy the Google conversion ID from this code (on the fourth line, in this example) for use in your AdWord placement. Use the Edit function from the Ad Group detail page to change the Destination URL. This URL is not displayed to the visitor, but when the ad is clicked, this is the URL to which visitors are sent. Visitors are directed to the PayPal-enabled sales page named widget.asp, and the URL includes a parameter, convid, set to the value of your Google conversion ID:

http://www.yoursite.com/widget.asp?convid=1234567890

7.24.2 Setting up Your Selling Page

To enable the selling page widget.asp to track ad referrals, it needs to include a PayPal button that passes the conversion ID provided by Google to the PayPal system. Do this by putting a standard Buy Now button on the widget.asp page, then adding the PayPal-defined custom variable to the button code. This tag should be added between the opening and closing <form> tags. The custom variable will be hidden from the site visitor and will be populated with the convid variable that was passed as a querystring. Populating the custom variable with this value can be done in a variety of ways, including with JavaScript, but since this example uses ASP for the IPN processing anyway, put it to use here as well:

<input type="hidden" name="custom" value="<%=Request.QueryString("convid")%>">

Now, the PayPal button is able to pass on the Google conversion ID to PayPal. When the transaction is processed, PayPal sends the conversion ID on to your IPN processing page.

7.24.3 Creating Your IPN Processing Page

The IPN page finishes the job of tracking conversions. Take the code you copied from Google in the preceding section and paste it into your IPN page after the standard IPN processing chores (the section that begins with process payment in PayPal's example scripts). Since the code is meant for client-side interpretation, you need to temporarily interrupt the server-side code processing by escaping the processor and adding your script. In ASP, stop the server-side processing with a %> tag and start it again with a <% tag:

'process payment

'stop server-side processing scripts and add conv code

%>

<!-- Google Conversion Code -->

<script language="JavaScript">

<!--

google_conversion_id = <%=Request.Form("custom")%>;

google_conversion_language = "en_US";

if (1) {

 google_conversion_value = 1;

}

google_conversion_label = "Purchase";

-->

</script>

<script language="JavaScript" src=

                "https://www.googleadservices.com/pagead/conversion.js">

</script>

<noscript>

<a href="https://services.google.com/sitestats/en_US.html" target=_blank>

<img height=27 width=135 src=

                "https://www.googleadservices.com/pagead/conversion/<%=

                Request.Form("custom")%>/?value=1&label=Purchase&hl=en">

</a>

</noscript>

<%

'continue processing server-side processing scripts

When an order is placed at your web site from a Google AdWord referral, the Google Conversion tracking system is activated. You can log into your Google AdWords account and evaluate your campaign's effectiveness in Google's conversion tracking system, as shown in Figure 7-3.

Figure 7-3. Measuring your campaign's effectiveness with Google's conversion tracking system
figs/pph_0703.gif


7.24.4 See Also

  • For practical ways to calculate and use conversion rates in your marketing campaigns, see Strategic Database Marketing : The Master Plan for Starting and Managing a Profitable, Customer-Based Marketing Program by Arthur M. Hughes (McGraw-Hill).

  • For the nitty-gritty details on AdWords and conversion tracking, see Chapter 9, "Making Money with Google," of Google: The Missing Manual by Sarah Milstein and Rael Dornfest (O'Reilly).

    Previous Section  < Day Day Up >  Next Section
    Index: [SYMBOL][A][B][C][D][E][F][G][H][I][J][L][M][N][O][P][Q][R][S][T][U][V][W][X][Y]


         Main Menu
    PayPal Hacks
    Table of Contents
    Copyright
    Credits
    Preface
    Chapter 1. Account Management
    Chapter 2. Making Payments
    Chapter 3. Selling with PayPal
    Chapter 4. Payment Buttons
    Chapter 5. Storefronts and Shopping Carts
    Chapter 6. Managing Subscriptions
    Chapter 7. IPN and PDT
    Introduction: Hacks #65-86
    What IPN and PDT Are
    How IPN Works
    Advantages of PDT
    Hack 65 Receive Instant Payment Notifications
    Hack 66 Troubleshoot Instant Payment Notifications
    Hack 67 Send a Purchase Confirmation Email with IPN
    Day Day Up
    Hack 69 Use IPN with eBay Listings
    Hack 70 Track Your eBay Products with IPN
    Hack 71 Deliver Digital Goods with IPN
    Hack 72 Deliver Digital Goods with a Return Page
    Hack 73 Implement Price Checking with IPN
    Hack 74 Provide an Order Summary with IPN
    Hack 75 Upsell Your Customers
    Hack 76 Enable Multiple IPN Pages
    Hack 77 Use Mass Pay to Create an Affiliate System
    Hack 78 Manage Your Inventory with IPN
    Hack 79 Display Donation Goals on Your Web Site
    Hack 80 Display a Recent Donor List
    Hack 81 Capture Customer Information with IPN
    Hack 82 Insert Payment Details into a Database with IPN
    Hack 83 Insert Cart Details into a Database
    Hack 84 Track Google Referrals
    Hack 85 Process Payments like a Credit Card with PDT
    Hack 86 Synchronizing PDT and IPN
    Chapter 8. The PayPal Web Services API
    Colophon
    Index


    More Books
    PHP Hacks
    Processing Xml With Java - A Guide To Sax, Dom, Jdom, Jaxp, And Trax
    The Koran (Holy Qur'an)
    Macromedia Flash 8 Bible
    Search Engine Optimization for Dummies
    YouTube Traffic
    PHP 5 for Dummies
    Harry Potter and The Chamber of Secrets
    Harry Potter and the Sorcerer's Stone
    The Pilgrim's Progress
    Wireless Hacks
    Flash Hacks. 100 Industrial-Strength Tips & Tools
    PayPal Hacks. 100 Industrial-Strength Tips and Tools
    Amazon Hacks
    Pdf Hacks
    The Da Vinci Code
    Google Hacks
    The Holy Bible
    Windows XP For Dummies
    Harry Potter and the Half-Blood Prince
    Seo Book
    Upgrading and Repairing Networks
    Macromedia Dreamweaver 8 UNLEASHED
    Windows XP Annoyances
    Windows XP Hacks
    Microsoft Windows XP Power Toolkit
    Teach Yourself MS Office In 24Hours
    iPod & iTunes Missing Manual
    PC Hacks 100 Industrial-Strength Tips and Tools
    PC Overclocking, Optimization, and Tuning - 2th Edition
    PC Hardware In A Nutshell 3rd Edition
    PC Hardware in a Nutshell, 2nd Edition
    Upgrading and Repairing PCs
    Google for Dummies
    MySQL Cookbook
    Teach Yourself Macromedia Flash 8 In 24 Hours
    PHP CookBook
    Sams Teach Yourself JavaScript in 24 Hours
    PHP5 Manual
    Free Games Paper Airplanes
    500 Juegos Gratis 500 Giochi Gratis 500 Jeux Gratuits 500 Jogos Gratis 500 Kostenlose Spiele