5

I have a subscription model and want to track the monthly payments with a server-side call through the Measurement Protocol.

The problem now is that I don't know how to build the call because as the documentation states I need a productIndex which I don't have (at least I think so). Here is the documentation: https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#pr_nm

From where does the ProductIndex come from? Or is it unimportant anyway?

Please help!

Dennis Ruske
  • 228
  • 2
  • 12

3 Answers3

1

As Eike Pierstorff said, it is counted from 1 to XX. When you have more products, the most important is pr#id or pr#nm for Product pairing in UA backend in all Enhanced Ecommerce flow.

Example of Measurement Protocol

  /*** Generic example - Universal Analytics ***
    *       
    *    ****** Transaction - Enhanced Ecommerce ******
    *
    *     ******* MEASUREMENT PROTOCOL  *******       
    *
    *****************************************************/

    https://www.google-analytics.com/collect

    ?v=1                                    // Protokol version
    &tid=UA-XXXX-Y                          // Property ID
    &cid=55568765456                        // Client ID from web cookie
    &uid=65486541231                        // User ID - internal ID

    &dh=configurator.domain.eu              // document.hostname
    &dp=/transactionnConfirm                // document.page
    &dt=Thank you!!                         // window.title

    &cd1=35009a79                           // Client ID from web cookie or system backend
    &cd2=M                                  // Gender (M/F)
    &cd3=1                                  // Returning customer 0 1 2

    &cg1=Busines                            // Segment

    &cg3=Middle Europe                      // Continent
    &cg4=Czech Republic                     // Country
    &cg5=Praha                              // City/Island/Region

    &cu=CZK                                 // Currency EUR, CZK, HUF

    &pr1id=832224                           // Product 1 ID - productu
    &pr1nm=Service aplha                    // Product 1 Product Name 
    &pr1ca=Cars/Servis                      // Product 1 Category - Slash delimited
    &pr1br=Car Homeland                     // Product 1 Branch name
    &pr1va=Deluxe                           // Product 1 Variant 
    &pr1pr=1257000                          // Product 1 Proce
    &pr1qt=1                                // Product 1 Quantity
    &pr1cd6=Express                         // Product 1 Custom Dimension - Time Frame
    &pr1cd7=Personal                        // Product 1 Custom Dimension - Pick Up


    &pa=purchase                            // Enhanced Ecommerce event 

    &ti=2424131                             // Order ID (2424131)
    &ta=External partner                    // Affiliate or Sales man
    &tr=1398000                             // Total Price TAX incl.
    &tt=275000                              // TAX
    &tcc=Premium Delivery                   // Coupon

    &t=event                                // Event or pagevies

    &ec=Eshop                               // Event Category
    &ea=Payment                             // Event Action
    &el=832224                              // Event Label - transaction ID
Jakub Kriz
  • 1,501
  • 2
  • 21
  • 29
0

Transactions may have multiple products, impression lists have multiple entries etc, and so you can set multiple items without overwriting previous values you use a product index. I frankly cannot find documentation on this, but I think the examples demonstrate how it's used.

So simply count up from one for each product you add to your transaction (if you have multiple, else the index is simply 1).

Eike Pierstorff
  • 31,996
  • 4
  • 43
  • 62
0

In Universal Analytics Enhanced Ecommerce guide you may see, that for each product in transaction either product name field or product id are required.

As you planning to track subscriptions via Enhanced Ecommerce, than each transaction will contain one product. Make sense use subscription type as "product name": like "1 Month", "3 Months", "6 Months", etc. In this case(if product name is set up) you may just skip product id, or set it as '(not set)'.

As you will have only 1 product in transaction(I think you do for subscriptions), than you need only productIndex=1. In Measurement Protocol product name paramater for first(and single) product will look like: &pr1nm="1 Month".

Ruslan Konygin
  • 1,019
  • 6
  • 7