简体   繁体   中英

How to pass value to the Custom variable Google Analytics?

Here my doubt is wheather we need to pass the name and value to this script or otherwise we can give any name and value that which will store in Google Analytics Server?

_gaq.push(['_setCustomVar',
          1,                   // This custom var is set to slot #1.  Required parameter.
          'Items Removed',     // The name acts as a kind of category for the user activity.  Required parameter.
          'Yes',               // This value of the custom variable.  Required parameter.
          2                    // Sets the scope to session-level.  Optional parameter.
       ]);
     _gaq.push(['_trackEvent',
          'Shopping', // category of activity
          'Item Removal', // Action
       ]);

Names and values for custom variables are pretty free-form, though I recommend sticking with alphanumeric. I've never tried metacharacters.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM