Follow

An advertiser’s webmaster should follow certain guidelines regarding the placement of tags in website pages. The sections below explain several common scenarios for implementing conversion tags.

Important: There are size limits to the elements in a conversion tag:
  • The maximum length of the predefined sales parameter, ProductID, is 100 characters.
  • The maximum length of the predefined sales parameter, ProductInfo, is 100 characters.
  • The maximum length for a conversion tag name is 100 characters.
  • There are no other specific parameter limits, but the platform adds data to the URL and the length of a URL is limited by the browser. (Maximum length of a URL is 2048 characters.)

HTML Conversion Tags

Note: Before making changes to this code, please consult your Sizmek client services manager for assistance on what components of the code can be changed.


<script type='text/javascript'>
// Conversion Name: HTML_Conversion_Tag_Example
// INSTRUCTIONS 
// The Conversion Tags should be placed at the top of the <BODY> section of the HTML page. 
// In case you want to ensure that the full page loads as a prerequisite for a conversion
// being recorded, place the tag at the bottom of the page. Note, however, that this may
// skew the data in the case of slow-loading pages and in general not recommended. 
//
// NOTE: It is possible to test if the tags are working correctly before campaign launch
// as follows: Browse to http://bs.serving-sys.com/Serving/adServer.bs?cn=at, which is
// a page that lets you set your local machine to 'testing' mode. In this mode, when
// visiting a page that includes an conversion tag, a new window will open, showing you 
// the data sent by the conversion tag to the Sizmek servers.
//
// END of instructions (These instruction lines can be deleted from the actual HTML)
var ebRand = Math.random()+'';
ebRand = ebRand * 1000000;
//<![CDATA[
document.write('<scr'+'ipt src="HTTP://bs.serving-sys.com/Serving/ActivityServer.bs?cn=as&amp;ActivityID=106120&amp;rnd=' + ebRand + '"></scr' + 'ipt>');
//]]>
</script>
<noscript>
<img width="1" height="1" style="border:0" src="HTTP://bs.serving-sys.com/Serving/ActivityServer.bs?cn=as&amp;ActivityID=106120&amp;ns=1"/>
</noscript>

Script vs. iFrame

The tags you received for your HTML pages are either Script or iFrames tags

  • The script tag uses a script to call the Sizmek server (to report the conversion) as soon as the page loads. This allows for better accuracy in counting conversions.
  • An iFrame is not part of the page and so is loaded in parallel to the page, not affecting download time (unlike Script tags which load as part of the page). As a result, iFrame conversion tags are subject to a higher number of discrepancies. It is typically used:
    • When you have several tags in the same page, which can result in slow loading times for the page. Use iFrames to avoid longer page loading times.
    • If you cannot use script tags in your page for security reasons.

You can tell what type of code you have by identifying script or iFrame aspects in your code. For example, in script code, you will see document.write(‘<scr’ .... In code for iFrames, you will see document.write('<iFrame src .... The platform implements both methods in the same way.

Recommended Usage

In this scenario, when the user reaches the page, the platform counts this conversion as the page starts to download. To implement this method, place the tags as close as possible to the <body> tag on the page. This will guarantee that the platform counts the conversion as the page starts to download.

You can put the tag further down in the <body> tag, but be aware that in cases of a heavy site, users might move to another page without the conversion being reported.

Flash Conversion Tags

Conversion tags can be placed in Flash-based pages in your site.

screen_flash_conversion_tags

What Does this Code Do

The code can be placed anywhere in the Flash file.

For ActionScript 1 or 2, it creates a movie clip that loads an SWF with the conversion parameters. The call to the conversion will be done automatically.

For ActionScript 3, it creates a loader object that loads an SWF with the conversion parameters.

Recommended Usage

Copy and paste the code into the appropriate place in your Flash page depending on when you want to report the conversion; for example, if you want the conversion reported when the user clicks on a specific button:

  • For ActionScript 1 or 2, place the code inside the button using the appropriate event, such as onRelease ().
  • For ActionScript 3, place the code in the function that handles the click event.

If you want the conversion reported only after the user sees a movie clip, then use the timeline event.

There is no need to create a movie clip or loader to call the conversion. The code already does that.

Conversion Tags on Buttons and Links

To count the conversion when performing an action, you may want to add the conversion to a button rather than to a place on a page. This is preferred when the landing page cannot be accessed, or when there is no HTML landing page (such as when opening a PDF file). You can generate the code or use custom code provided by Sizmek.

Generate the Code

Procedure
  1. Identify the URL from the <img> portion of the URL.
    
    <noscript>
    <img width="1" height="1" style="border:0" src="HTTP://bs.serving-sys.com/Serving/ActivityServer.bs?cn=as&amp;ActivityID=106120&amp;ns=1"/>
    </noscript>
    
  2. Change all instances of &amp; to &.
    HTTP://bs.serving-sys.com/Serving/ActivityServer.bs?cn=as&ActivityID=106120&ns=1
  3. Create a JavaScript function to create a new image and set the source of that image to the amended URL from the <img> tag.
    
    <script> 
    function ebConversionTracker(conv) 
    { 
    var ebConversionImg = new Image(); 
    var ebConversionURL = "HTTP://bs.serving-sys.com/Serving/ActivityServer.bs?";
    ebConversionURL += "cn=as&ActivityID="+conv+"&ns=1"; 
    ebConversionImg.src = ebConversionURL; 
    }
    </script>

Use Sizmek Custom Code

Whether you want to fire a Sizmek conversion tag on a button, on a link, or as the page loads, the following custom script will ensure that the conversion tag itself and its third-party tag will fire before redirecting to the landing page.

  1. From the code generated in the Sizmek MDX platform, copy the ID, and discard the rest of the code. The following script should be placed as the first element of the <head>:
    • For a standard page:

      <script src="http://ds.serving-sys.com/BurstingRes/CustomScripts/mmConversionTagV6.js"></script>

    • For a secure page:

      <script src="https://secure-ds.serving-sys.com/BurstingRes/CustomScripts/mmConversionTagV6.js"></script>

      Example
      <html> <head> <script src="http://ds.serving-sys.com/BurstingRes/CustomScripts/mmConversionTagV6.js"></script> </head> <body> ... </body> </html>
  2. When you want to fire the conversion tag, call the General Function. It can consist of up to five parameters, as described in the table below.
General Function

mmConversionTag(id, obj, targetWindow , redirectURL, extraParams);

Explanation of Parameters

Parameter: id
Description: The id of your conversion tag, as found in the platform.
Type: Number
Required: Mandatory
Example: 120394
Parameter: obj
Description: The button or link object.
Type: Object
Required: Mandatory
Possible Value: this
Parameter: targetWindow
Description: New or same window.
Type: String
Required: Optional
If left blank: If a redirectURL was passed, it will open in a new window.
Possible Values: self, _blank, null
Parameter: redirectURL
Description: Landing page URL. The redirect URL after the conversion tag and its 3rd party tages get called.
Type: String
Required: Optional
If left blank: The platform will not perform any redirect.
Example: http://www.sizmek.com
Parameter: extraParams
Description: All of the extra, non-standard parameters that could possibly get passed to a conversion tag such as sales tag parameters, session ID, or custom parameters.
Type: String
Required: Optional
If left blank: The tag acts as a regular counter conversion tag.
Example: &Session= - Use this code to count the conversion tag once for each browser session.
Example: &Session= OrderID= &Value= - Use this code to count the conversion tag once for each browser session, plus pass the order ID and the value or revenue for a sales conversion.
 

Specific Examples

  • Fire conversion tag, no redirect

    <a onclick="mmConversionTag(123456, this); return false;" href="">Click Here</a>

  • Fire conversion tag, no redirect, and pass extraParams

    <a onclick="mmConversionTag(123456, this, undefined, undefined, '&productId=123456'); return false;" href="">Click Here</a>

  • Fire conversion tag, redirect to landing page in new window

    <a onclick="mmConversionTag(123456, this, '_blank', 'http://www.sizmek.com'); return false;" href="">Click Here</a>

  • Fire conversion tag, redirect to landing page in same window

    <a onclick="mmConversionTag(123456, this, '_self', 'http://www.sixmek.com'); return false;" href="">Click Here</a>

  • Fire conversion tag, redirect to landing page in new window, and pass extraParams

    <a onclick="mmConversionTag(123456, this, '_blank', 'http://www.sizmek.com', '&productId=123456'); return false;" href="">Click Here</a>

  • Fire conversion tag, redirect to landing page in same window, and pass extraParams

    <a onclick="mmConversionTag(123456, this, '_self', 'http://www.sizmek.com', '&productId=123456'); return false;" href="">Click Here</a>

  • Fire conversion tag, redirect to landing page in new window, pass extraParams, and use site function

    <script>

    function sitesFunction1() {…}

    </script>

    <a onclick=" mmConversionTag(123456, this, '_blank', 'http://www.sizmek.com', '&productId=123456'); return false; siteFunction1();” href="">Click Here</a>

  • Fire conversion tag, redirect to landing page in same window, pass extraParams, and use site function

    This is not possible. Redirecting within the same window will prevent the site function from firing.

How to Implement Conversion Tags on Buttons When Ad Blockers are in Place

If a conversion tag is being blocked by a user’s ad blocking software, the button cannot redirect to the destination URL. Use the following code to resolve the redirection issue.

Code 
 <a onclick="if(window.mmConversionTag){mmConversionTag(495464, this, '_self', '/Personal/ApplyOnline/MemberForm/');}else {window.document.location.href='/Personal/ApplyOnline/MemberForm/';} return false;" href="" class="btn btn_gradient btn_large notcurrent" title="Membership Application">Apply Online</a>

Implementing Sales Tags

Sales tags are typically placed in confirmation or checkout pages. To implement sales tags, you must replace tokens in the conversion tag code with your own values, which report back the sales information recorded by the conversion tag.

The tokens that can appear in the code are described below. The commonly used tokens are Revenue and Order ID:

  • var ebRev = '[Revenue]'; Reports the amount entered by the user (the purchase price).

    For example: var ebRev = '<%=charge%>';

Note: The value should be a decimal number.

  • var ebOrderID = '[OrderID]'; Reports the unique transaction (purchase/sales ID), and is also usually located in the confirmation page in your site.
  • var ebQuantity = '[Quantity]'; Reports the number of items in the shopping cart.
  • var ebProductID = '[ProductID]'; Reports the product ID, if relevant.
  • var ebProductInfo = '[ProductInfo]'; This variable can reports additional product information, if relevant.

Similar to the [SessionID], the [Revenue], [OrderID], [ProductID] and [ProductInfo] parts of the tag must be replaced using the site’s server side scripting language.

Counting Methodology Implementation

Conversions in Sizmek are counted at the following frequencies:

  • For Type=Counter:
    • Always: Count a conversion every time the action occurs.
    • Once per day: Count only one action per 24 hour period, per user (cookie).
    • Per browser session: Count a conversion once per action, per browser session. If an action occurs again while the user’s browser is still open, the action will not be counted again.

      To implement the Per browser session option, the advertiser's webmaster should add a parameter for session duration on the server. For example, the default time for the IIS web server (Microsoft’s Web Server) is 20 minutes, but this can be adjusted in the server setup to a more accurate, up-to-a-second value.

      Note: The webmaster should replace the [SessionID] tokens in the conversion tag with the actual session ID. If the session ID is not passed to the conversion tag, conversion are counted always and not according to browser session.

  • For Type=Sales:
    • Per order ID: Count the unique transaction (purchase/sales ID). In a sales tag, the platform also validates that we do not count more than a single conversion on the same order ID. If the Order ID is not included in the sales tag, the conversion will be counted for each browser session.

Applying the Session Variable

The conversion tag must include the session variable, as shown below:


<script type='text/javascript'>
// Conversion Name: Sales_Conversion_Example
// INSTRUCTIONS to site webmaster regarding parameters 
// to be dynamically entered by the site web/content server: 
//
// In the code below, you'll find a [Revenue] parameter and/or a [Quantity] parameter and/or an 
// [OrderID],[ProductID][ProductInfo] parameter. 
// The [Revenue] parameter is to be dynamically set to reflect the value currently stored within the user's shopping cart. 
// The parameter should be a decimal number, for example: var ebRev = '229.88';
// The [Quantity] parameter is to be dynamically set to reflect the number of items currently stored within the user's shopping cart.
// The parameter should be an integer, for example: var ebQuantity = '3';
// The [OrderID],[ProductID][ProductInfo] parameters are to be dynamically set to reflect
// the order ID for this transaction. You should verify with your Sizmek
// Account Manager that your account has the extended data collected in order for this parameter to be recorded.
// This parameter should be a string with the max length of 36 characters 
// The parameter may be a string, for example: var ebOrderID = '1234-5678-90';
// The Product ID parameter should be a string with the max length of 36 characters.
// For example: var ebProductID = ‘ax-34579-989';
// The Product Info parameter should be a string with the max length of 100 characters.
// For example: var ebProductInfo = ‘Colour blue, size XL..';
//
// The Conversion Tags should be placed at the top of the <BODY> section of the HTML page. 
//
// NOTE: It is possible to test if the tags are working correctly before campaign launch
// as follows: Browse to http://bs.serving-sys.com/Serving/adServer.bs?cn=at, which is
// a page that lets you set your local machine to 'testing' mode. In this mode, when
// visiting a page that includes an conversion tag, a new window will open, showing you 
// the data sent by the conversion tag to the Sizmek servers.
//
// END of instructions (These instruction lines can be deleted from the actual HTML)
var ebRev = '[Revenue]';
var ebOrderID = '[OrderID]';
var ebProductID = '[ProductID]';
var ebProductInfo = '[ProductInfo]';
var ebQuantity = '[Quantity]';
var ebRand = Math.random()+'';
ebRand = ebRand * 1000000;
//<![CDATA[ 
document.write('<scr'+'ipt src="HTTP://bs.serving-sys-int.com/Serving/ActivityServer.bs?cn=as&amp;ActivityID=105290&amp;rnd=' + ebRand + '&amp;Value='+ebRev+'&amp;OrderID='+ebOrderID+'&amp;ProductID='+ebProductID+'&amp;ProductInfo='+ebProductInfo+'&amp;Quantity='+ebQuantity+'"></scr' + 'ipt>');
//]]>
</script>
<noscript>
<img width="1" height="1" style="border:0" src="HTTP://bs.serving-sys-int.com/Serving/ActivityServer.bs?cn=as&amp;ActivityID=105290&amp;Value=[Revenue]&amp;OrderID=[OrderID]&amp;ProductID=[ProductID]&amp;ProductInfo=[ProductInfo]&amp;Quantity=[Quantity]&amp;ns=1"/>
</noscript>

 

The [SessionID] part of the script must be replaced with a session variable. Not replacing the variable will cause discrepancies, and the counter option will be treated as once per user.

Replacing the [sessionID] token can be done in a variety of scripting languages:

  • ASP.NET
  • PHP
  • JSP

Examples:

ASP: Var ebSession = <%=Session.SessionID%>;

PHP: Var ebSession = <?php echo $PHPSESSID; ?>

Mobile conversion tracking is limited, due to limited or no cookie support. The table below discusses various device types and how they handle cookies.

Device/Operating System Cookie Support
iOS Cookies are not supported by default (i.e., 'opt out'), unless the user explicitly changes their settings. On Apple devices, iOS does not accept cookies, as our conversion tags are cookie-based. So tracking is not possible on these devices. This limitation exists with any cookie-based tracking system.
Blackberry Dependent on the user settings and specific model. Users should enable/disable cookies per browser.
Symbian [Nokia/Older SE/Older Motorola/Samsung Feature Phones] Varies, but generally yes. Please note that old Symbian devices are more limited with cookies.
Windows Mobile (Old) Limited cookies, but supported.
Android Yes, but third-party cookies will be blocked in future releases.
Feature Phones Please refer to the specific manufacturer/mobile operating system.

Note: The table above refers only to the default device browsers; every manufacturer/operator can change the above rules for a specific device model or firmware. The user or operator could also install a third-party browser that behaves differently.

Additional mobile cookie and tracking conversion limitations:

  • On mobile operating systems that are not Android/iOS, mobile conversion tags cannot have any third-party tags piggybacked on them.
  • Mobile information like device name, operator, or carrier name is heavily dependent on the mobile site’s ad server; Sizmek will retrieve the info if the mobile site supports it, but not otherwise.

Additionally, Sizmek can track information while the user is on the page that contains our tag. But as soon as they click off of that page, we will lose tracking abilities. For instance, in the case of tracking application downloads, we can track the number of users that intend to download the application, but click the link that sends them to the App store. However, we cannot track the number of users that follow through with the actual downloading of the application.

Was this article helpful?
1 out of 2 found this helpful
Have more questions? Submit a request

Comments