Custom dimensions are attached to a GA session or GA userId (if present).

They can be set to persist for:

  1. page hit or product hit only
  2. 30mins session
  3. 6 months

 

Here is an example:

<!– dataLayer for CustomDimensions used to turn ServerSide variables into JS –>

<script>

window.dataLayer = window.dataLayer || [];

dataLayer.push({

 

//…

 

// CustomDimensions persistence can be userScope=6months, sessionScope=30mins or hitScope=pageScope

“user.id”          : “12345”, // customDimension001 userScope – auth.user.getId

“firstPurchaseDate”: new Date(“January 01 2014 23:59:59”),//customDimension013 userScope for customer lifetime

 

// CustomMetrics type can be integerType, currencyType (decimals), timeType

“visitorLifetimeValue”: “250.00”, //CustomMetric001 currencyType – Includes Tax: ($100*2+$10)+tax = $250.00

 

// These dimensions can be set on ALL pages

 

// Adwords Dynamic Remarketing dimensions

“google_tag_params”: {
“ecomm_pagetype”: “”, // cd015: home|category|product|cart|purchase|other {{page.category.pageType}}

“ecomm_paymentstep”: “”, // cd016: checkout|login|delivery|billing|payments|complete {{pagePaymentStep}}

“ecomm_prodid”                    : [“”], // cd017: e.g. [“sku_111″,”sku_222”] {{cartProducts[n].sku}}

“ecomm_totalvalue”         : [“”], // cm002: e.g 100.00 pounds {{cart.total}}

“ecomm_pname”                     : [“”], // cd018: optional {{cartProducts[n].name}}

“ecomm_pcat”                      : [“”], // cd019: optional {{cartProducts[n].category}}

“ecomm_rec_prodid”         : [“”], // cd020: e.g. shoe shine {{recommendationProducts[n].sku}}

 

// These dimensions can be set after the user login page.

 

// Auth logged-in with userScope 6months

//”user.id”                : “”,     // cd001:WARNING never sent userId or cartId into remarketing.

“user_isRegistered”        : “true”, // cd002: y|n users has an account?

“user_isLoggedIn”          : “true”, // cd003: y|n users is signed-in?

“user_isReturnCustomer”           : “true”, // cd004: y|n users has transacted already?

“user_memberType”          : “free member”, // cd006: Free Member, Premium Member or Enterprise Member

“user_memberTypeClass”            : “international member”, // cd007: sub-types of memberClass

“user_ageRange”                   : “20-25”,// cd008: Age range

“user_gender”                     : “male”, // cd009: Gender

“user_customerQualityScore”       : “high”, // cd010: Customer Quality Score – High, Med, Low

“user_highSpenderScore”           : “high”, // cd011: High Spender Score – High, Med, Low

“user_loyaltyScore”        : “high” // cd012: Loyalty Score – High, Med, Low

“session_testVariant”             : “version a – offer x” // cd013: combine A/B testing offer with remarketing

// “session_type”          : “returning”,//cd000: new|returning 30min session native GA field UserType

},

 

//…

 

// Now trigger actions

“event”                           : “header_datalayer_loaded” // Used to trigger dataLayer dependencies

 

});

</script>

<!– End Google Tag Manager Data Layer –>

0117 3361103