Do I need customized tracking code?
Before customizing Yahoo! Web Analytics tracking code, please read what standard tracking includes. The majority of all tracking requirements are included in standard tracking.
At this time, custom tracking is only supported for store pages, and not checkout pages. If you wish to assign pages specific DocumentName, DocumentGroup, Action, CookieDomain, Domains, or FlashURL variables, then custom tracking code should be inserted into the appropriate pages. To learn more about these variables, what they're used for, and how to configure them, please see our tracking code variables help.
Once you're familiar with these variables, you can use the information on this page as a guide to inserting custom variables into your tracking code.
Customizing tracking code variables
Step 1. Get tracking code
First, generate and copy the tracking code you wish to customize, and paste it into a text editor such as Notepad, TextPad, or TextMate. Tracking code for item pages and for other store pages can be found on the Advanced Options page, which may be accessed using the Yahoo! Web Analytics "Advanced Options" link in Store Manager.
To learn how to generate tracking code, please see "Where can I find the tracking code?" Merchants are reminded that item pages must use "item pages" tracking code and all other store pages must use "other store pages" tracking code.
Step 2. Customize tracking code
Modifications to tracking code should only be made in the section of code between YWATracker = YWA.getTracker("1000xxxxxxxxx"); AND YWATracker.submit();, as highlighted in red in the example below:
<script type="text/javascript" src=" http://d.yimg.com/mi/ywa.js" ></script>
<script type="text/javascript">
YWATracker = YWA.getTracker("1000111111111");
YWATracker.setDocumentName("ITEMID");
YWATracker.setDocumentGroup("ProductView");
YWATracker.setDomains("*.store.yahoo.net");
YWATracker.setSKU("ITEMID");
YWATracker.setAction("PRODUCT_VIEW");
YWATracker.submit();
</script>
* Note: The tracking code you copy from the Advanced Options page will contain a unique project tracking ID, included in the Tracker variable. In the example above, the tracking ID is "1000111111111". The project tracking ID should not be modified in any way. Making changes to this tracking ID will cause project tracking to fail.
In this example, the DocumentName and DocumentGroup variables for an item page will be customized. For a list of other tracking code variables and customization examples, please see our tracking code variables help.
In the standard tracking code for item pages, the DocumentName variable is set to use the item ID as its default value, and the DocumentGroup variable uses "ProductView" as its default value:
<script type="text/javascript" src=" http://d.yimg.com/mi/ywa.js" ></script>
<script type="text/javascript">
YWATracker = YWA.getTracker("1000111111111");
YWATracker.setDocumentName("ITEMID");
YWATracker.setDocumentGroup("ProductView");
YWATracker.setDomains("*.store.yahoo.net");
YWATracker.setSKU("ITEMID");
YWATracker.setAction("PRODUCT_VIEW");
YWATracker.submit();
</script>
You can assign these variables custom values that will be reflected in your reports. Variables may be up to 75 characters in length, not including the opening and closing quotation marks (" "). For this example, "RedTenSpeedBlender" is used as the custom DocumentName variable, and "Blenders" as the custom DocumentGroup variable:
<script type="text/javascript" src=" http://d.yimg.com/mi/ywa.js" ></script>
<script type="text/javascript">
YWATracker = YWA.getTracker("1000111111111");
YWATracker.setDocumentName("RedTenSpeedBlender");
YWATracker.setDocumentGroup("Blenders");
YWATracker.setDomains("*.store.yahoo.net");
YWATracker.setSKU("ITEMID");
YWATracker.setAction("PRODUCT_VIEW");
YWATracker.submit();
</script>
Step 3. Inserting custom tracking code into store pages
Pages built in Store Editor
To insert customized tracking code directly above the closing </body> tag of your Store Editor pages, you will need to either:
Help for RTML is available in the "Controls" section of the Advanced Editor. Here, you will find links to RTML documentation and RTML reference material.
You may also wish to consult the following third-party help:
Customized tracking code can also be inserted into your pages using the Final-text variable in Store Editor. Inserting tracking code using the final-text variable is not recommended, as your tracking code will not be placed as the last item before the closing </body> tag. Placing the tracking code as low as possible on your page will ensure that other page content and visitors may view and navigate the page in the event the tracking script is slow to load or fails.
If the global Final-text variable is used to insert tracking code into your store pages, you must override this variable on pages that require a different tracking code than the one entered as a global variable.
For example, if the item page tracking code is inserted into the Final-text variable on the Variables page, it would also be applied to all store pages that are not item pages. To insert the correct tracking code into these other pages, you must create a variable override for each applicable page.
If you still wish to use the Final-text field to insert tracking code into your store pages, please follow the directions below.
Inserting custom tracking code into all store pages:
Overriding the custom tracking code on individual store pages:
Inserting tracking code into individual store pages
If you wish to add tracking code on individual store pages only, please follow the steps for overriding custom tracking code on individual store pages. Do not insert tracking code into the global Final-text variable on the Variables page.
Pages built in SiteBuilder
To learn how to insert tracking code into store pages created with SiteBuilder, please see "Inserting tracking code using SiteBuilder."
Pages built using Dreamweaver or other third-party HTML editors
To learn how to insert tracking code into store pages created with Dreamweaver or another HTML editor, please see "Inserting tracking code using Dreamweaver or other third-party HTML editors."