Advanced e-commerce with measurement protocol
I have a subscription model and want to track monthly payments with a server call via a metering protocol.
Now the problem is that I don't know how to construct the call because, as the documentation says, 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
Where did ProductIndex come from? Or doesn't it matter at all?
Please, help!
source to share
Transactions can have multiple products, impression lists have multiple entries, and so on, so you can install multiple items without overwriting previous values ββusing the product index. I frankly can't find any documentation on this, but I think the examples demonstrate how it was used.
So just count from one for each product you add to your transaction (if you have multiple, otherwise the index is just 1).
source to share
As Eike Pierstorf said, it is counted from 1 to XX. When you have more products, the most important is pr # id or pr # nm to pair products in the UA firewall throughout the extended e-commerce flow.
Example of a 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
source to share
In the Universal Analytics Enhanced Ecommerce tutorial, you can see that each product in a transaction requires a Product Name field or Product ID.
As you plan to track subscriptions through Enhanced Ecommerce, each transaction will contain one product. Use the usage subscription type as "product name": for example, "1 month", "3 months", "6 months", etc. In this case (if the product name is configured) you can simply omit the product ID or set it as '(not installed)'.
Since you will only have 1 product per transaction (I think you do for a subscription), you only need productIndex = 1. In the Measurement Protocol, the paramater product name for the first (and only) product will look like this: & pr1nm = "1 Month ".
source to share