Migration from the WebView Tracking Tag

Migration from the WebView Tracking Tag (Old)

Section titled Migration from the WebView Tracking Tag (Old)

To migrate from the WebView Tracking Tag to the Web Tracking Tag, follow these steps:

  1. Update the Tag

    Replace the WebView Tracking Tag:

    // t.contentsquare.net/wvt/web-view.js

    With the Web Tracking tag of your project (either a new tag or the one from a Web project):

    // t.contentsquare.net/uxa/YOUR_TAG_ID.javascript
  2. Update pageview tracking

    Replace the current trackPageview command:

    window.cs_wvt.push(["trackPageview", "My Custom Page Title"]);

    With:

    window._uxa.push(["trackPageview", "My Custom Page Title"]);

    📚 See more about the trackPageview command.

  3. Update the transaction tracking

    Replace the legacy WebView Tracking Tag transaction command:

    window.cs_wvt.push([
    "trackTransaction",
    { value: 1000, currency: "EUR", id: "my-transaction-id" },
    ]);

    With the transaction commands from the Web Tracking Tag:

    reate the transaction
    window._uxa.push([
    "ec:transaction:create",
    {
    id: "123" /* Transaction ID (string, up to 40 chararacters) */,
    revenue:
    "9.99" /* Transaction's total cost (integer or string, up to 12 digits and 2 decimals - extra decimals are truncated) */,
    currency:
    "usd" /* Currency value (string less than 10 characters or numeric/alphanumeric ISO 4217 value) */,
    },
    ]);
    // Send the complete transaction
    window._uxa.push(["ec:transaction:send"]);
  4. Update the dynamic variable tracking

    Replace the legacy WebView Tracking Tag dynamic variables command:

    window.cs_wvt.push([
    "trackDynamicVariable",
    { key: "my_key", value: "my_value" },
    ]);

    With the dvar command from the Web Tracking Tag:

    window._uxa.push(["trackDynamicVariable",
    { key: my_key, value: my_value }
    ]);