Embedding values in dynamic templates

Adding a variable method as a customized tag makes it possible to substitute embedded values in dynamic templates (Items that do not apply to event information are called “dynamic variables.”) from the client site.

variable method

This method is used for substituting the dynamic variable in js.

Cases where it is necessary to place the variable method

In the following case, it is necessary to place the variable method

  • Using a dynamic creative template that substitutes dynamic variables from the client site for customer service

How to place the variable method

The placement location and content of the customized tag which calls the variable method relies heavily on site side implementation. Refer to the following explanations on variable sample code and each dynamic creative template variable method call and replace them with a description suited to the site.

Where to place the variable

Substitution of the dynamic variable in the dynamic creative template is implemented in the js initialization process. The customized tag which calls the variable method must be placed before the initialization method (load method).

  • Example for substituting remaining product stock count
<script async src="@TAG_URL"></script>
<script>
  window._cq = window._cq || [];
  function _cc(){_cq.push(arguments);}
  _cc('variable', 'inventory', '99');  // Added before the ‘load’ method
  _cc('load', '@ACCOUNT_ID', '@SITE_ID');
</script>

variable method sample code

Example: Substituting remaining product stock count on the page

// When substituting remaining product stock count on the page
_cc('variable', 'inventory', '99');

Example: Substituting the telephone number (when it differs for each store on the store portal site)

_cc('variable', 'phoneNumber', '03-1234-5678');

variable method argument

Argument location Required Overview Example Type
First argument Method name “variable” (fixed) Character string
Second argument Dynamic variable name “phoneNumber” Character string
Third argument Dynamic variable value “99” Character string