The doPlugins function provides an easy way to give default values to variables, manipulate data, or to take values from query string parameters on any page of the site. Using doPlugins is often easier than populating the values in the HTML page because only one file needs to be updated. Keep in mind, however that changes to the JavaScript file are not always immediate. Return visitors to your site are often using cached versions of JavaScript file, meaning that updates to the file may not be applied to all visitors for up to one month after the changes is made.

This section briefly covers three plug-ins:

  • getQueryParam.
  • getValOnce.
  • Form Analysis.
These are three of the most commonly used plig-ins. Again, please contact your Account Manager to discuss other plug-ins that can provide needed functionality.

The getQueryParam Plug-in
This plug-in should be familiar from the section about the campaign variable (s.campaign). The getQueryParam plug-in is important for campaigns because its primary purpose is to return the value of the query string parameter (tracking code) found in the current URL. When a tracking code is assigned to a campaign, the getQueryParam plug-in reads the tracking code value from the query string parameter in the URL. The getQueryParam code is display below:


In this case, the getQueryParam Plug-in will populate the campaign variable with the value contained in the “cid” name-value pair in the query string of the URL.

If no query string parameter is found with that value, an empty string is returned. if you only want to populate the s.campaign variable if it is empty (if you haven’t hard-coded a value into it), you can check to see if there is a value populate in only if indeed it is empty, as shown in the following example:


Additionally, the getQueryParam plug-in may specify more than one parameter; all values are returned in a delimited list, as shown below.

      s.eVar1=s.getQueryParam(‘cid,pid’, ‘:’);

In this case getQueryParam wil look for values from “cid” and from “pid” and use the colon as a separator as it pushes the value into eVar1.

If one query string parameter should take precedence over another when both are found, use an “id” statement as show below:


In this case, “cid” takes precedence over “iid” if both exist in the query string.

As you can see, there is much you can do to manipulate or make needed changes to your data as it comes off of the query string and is set into s.campaign. This plug-in, as stated, is most commonly used to place tracking codes into the campaign variable, but you can used freely to pull a value from the URL query string and populate ANY variable.