Integration and Activation

Prev Next

This section shows how to integrate and activate the Cookie Control plugin. Choose your integration method. The parameters depend on the migration you plan. See Changing from First-Party to Third-Party Cookies and Moving Third-Party Cookies to a New Domain.

Important

Mapp activates the redirection internally. Contact your designated point of contact before you integrate the plugin. All notes on costs, integration period and installation are in Cookie Control.

Integrate and Activate the Plugin

Use this method if you integrated the Smart Pixel and use the wtSmart API.

Plugin Activation

Activate the plugin with this method:

wtSmart.extension.cookie_control.activate();

Optional methods:

wtSmart.extension.cookie_control.deactivate();
wtSmart.extension.cookie_control.isActivated();

Plugin Configuration

Define the migration with config(). The parameters depend on the migration. Examples are in Changing from First-Party to Third-Party Cookies and Moving Third-Party Cookies to a New Domain.

Parameter

Required

Description

action

Yes

Type of migration. 1->3 converts client-side cookies into server-side cookies. 3->3 moves server-side cookies to a new track domain or track ID.

lifeTime

Yes

Date until which the plugin is active, in the format DD Mon YYYY 00:00:00. After this date, the plugin does nothing. Use a date in the future and agree on the period with Mapp.

duration

No

Lifetime of the migrated server-side cookie in days. If you omit it, the default of the plugin applies.

currentTrackId

No

Track ID of your new setup. If you omit it, the track ID of your Smart Pixel is used.

currentTrackDomain

No

Track domain of your new setup. If you omit it, the track domain of your Smart Pixel is used.

oldTrackId

Only for 3->3

Track ID of your previous setup.

oldTrackDomain

Only for 3->3

Track domain of your previous setup.

Methods and Properties

Method / Property

Description

name

Returns the name of the extension.

version

Returns the version of the extension.

config(config)

Sets the configuration. Without an argument, it returns the current configuration.

isActivated()

Returns whether the extension is activated.

activate()

Activates the extension.

deactivate()

Deactivates the extension.

Integrate the plugin into the container of the website that you want to measure. First, create a custom plugin.

Step 1: Create the Custom Plugin

In the Tag Integration, go to Custom Plugins and click New plugin. The configuration dialog opens.

Custom Plugins overview with the New plugin button

Enter the following information, then click Create.

Configuration dialog for a new custom plugin

Parameter

Description

Name

A name for the plugin, for example Cookie Control Plugin.

Content

The code of the JavaScript file that Mapp provides on request. Add your configuration to the plugin content.

Position

Select head.

Step 2: Add the Plugin to Your Container

  1. In the container overview, select the container of your website.

  2. Click Add Plugin. The overview of all available plugins opens.

  3. Under Custom Plugins, select the plugin you created. The plugin configuration dialog opens.

  4. In the Assign rules area, define the page areas where the plugin runs. Include all potential entry pages.

  5. Click Add plugin.

Overview of available plugins with the Add Plugin button

Plugin configuration dialog with Assign rules

Step 3: Publish the Container

Click Publish to publish the container with the new plugin.

Configuration

The Cookie Control plugin is available only as a custom plugin. You enter your configuration in the content of this plugin, together with the plugin code. The parameters depend on the migration you plan. See Changing from First-Party to Third-Party Cookies and Moving Third-Party Cookies to a New Domain.

Note

Pixel Version 4 is outdated. Use the Smart Pixel for new integrations. This tab is for existing Pixel Version 4 setups.

Integrate the Script

Download the plugin file as described in Technical Requirements and Download. Integrate it before the script webtrekk_v4.min.js.

<script type="text/javascript" src="path/to/file/pixel-cookieControl.min.js"></script>
<script type="text/javascript" src="path/to/file/webtrekk_v4.min.js"></script>

Activate the Plugin

Set the parameter executePluginFunction to wt_cookieControl. You can set it in the configuration variable webtrekkConfig or as a parameter of a page-specific pixel object.

Example: Global Configuration

var webtrekkConfig = {
	trackId: "111111111111111",
	trackDomain: "data.exampleshop.com",
	domain: "www.exampleshop.com",
	executePluginFunction: "wt_cookieControl"
};

Example: Page-Specific Configuration

var wt = new webtrekkV3();
wt.contentId = "de.startseite";
wt.executePluginFunction = "wt_cookieControl";
wt.sendinfo();

Configure the Plugin

Define the global variable wtcc_config before the first tracking request is sent. The parameters depend on the migration. Examples are in Changing from First-Party to Third-Party Cookies and Moving Third-Party Cookies to a New Domain.

Parameter

Required

Description

trackId

Yes

1->3: Your track ID. The server-side cookie is set here. 3->3: The previous track ID, where the cookie currently is.

trackDomain

Yes

1->3: Your track domain. The server-side cookie is set here. 3->3: The previous track domain, where the cookie currently is.

lifeTime

Yes

Date until which the plugin is active, in the format DD Mon YYYY 00:00:00. After this date, the plugin does nothing. Use a date in the future and agree on the period with Mapp.

duration

No

Lifetime of the migrated server-side cookie in days. If you omit it, the default of the plugin applies.

action.action

Yes

Type of migration: 1->3 or 3->3.

action.trackId

Only for 3->3

The new track ID.

action.trackDomain

Only for 3->3

The new track domain.

Important

In Pixel Version 4, the roles of trackId and trackDomain on the top level depend on the migration. For 1->3, they describe the target. For 3->3, they describe the previous setup, and the new setup is inside action. In the Smart Pixel, the parameters are named differently: currentTrackId and currentTrackDomain are always the new setup, oldTrackId and oldTrackDomain are the previous one.

Verify the Integration

Open your website and the developer tools of your browser, then go to the Network tab. Reload the page. You should see one additional request to your track domain before the regular tracking requests. In Pixel Version 4, the path of this request ends with /cc.

The plugin sends this request only once per browser. To test it again, delete the marker cookie wt_cookiecontrol (wtstp_cookiecontrol in the Smart Pixel) and reload the page.