## 4 Examples of COSMIC Measurement in Web Analytics Implementation  
This section presents two examples of the application of the mapping rules in Table 4 and the measurement phase to measure the functional size of the web analytics implementation. **Example 1**. : _An e-commerce company implements Google Analytics through Google Tag Manager (GTM) to track essential user interactions related to their online stores. Key interactions include tracking when users add products to a cart, removing products from the cart, viewing product details, and making purchases. By implementing event tags using GTM, the company aims to gain insights into customer behavior and optimize sales funnels. E-commerce business requirements require five GTM tags to be implemented as follows._  
1. JavaScript snippet to capture and collect data on user interaction. 2. Product view tags track when a user views the product. Triggers should be implemented to evaluate whether a tag has to be fired. 3. Add a cart tag that tracks when a user adds a product to the cart. Triggers should be implemented to evaluate whether a tag has to be fired. Table 5 illustrates the application of the mapping phase of COSMIC and how each functional process is mapped to COSMIC data movement types (Entry, Exit, Read, Write). \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Functional** & **Data** & **Classification** & **Description** & **Example** \\
**Process** & **Movement** & & & \\ \hline Tag Firring & Read + Exit & \begin{tabular}{c} Read = \\ (Rule 18) + \\ Exit \\ (Rule 17) \\ \end{tabular} & \begin{tabular}{c} GTM reads evaluated \\ conditions, and if \\ met, fires the tag, \\ sending data \\ (e.g., page URL, \\ button name) to an \\ external analytics \\ platform \\ (Google Analytics). \\ \end{tabular} & \begin{tabular}{c} GTM reads trigger \\ results and then \\ fires the tag to send \\ data to \\ Google Analytics. \\ \end{tabular} \\ \hline Setting a cookie & Read + Write & \
\begin{tabular}{c} Read \\ (Rule 18) + \\ Write \\ (Rule 19) \\ \end{tabular} &
\begin{tabular}{c} GTM writes session \\ information to \\ browser cookies. \\ \end{tabular} \\ \hline \hline \end{tabular}
\end{table} 
Table 4: _Cont._
**Example 2**. : _An insurance company implements Google Analytics using Google Tag Manager (GTM) to track essential user interactions related to its website. Key interactions include tracking when users view policy plan details, downloading documents, and submitting requests in quote form. By implementing event tags using GTM, the company aims to gain insights into customer \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Functional Process** & **Data Movements** & **Number of Movements** & **Functional Size (CFP)** \\ \hline JavaScript snippet to capture & & & \\ users’ interaction & Entry & 1 & 1 \\ \hline Product view tag & Read + Exit & 2 & 2 \\ \hline Add to cart tag & Read + Exit & 2 & 2 \\ \hline Remove from cart tag & Read + Exit & 2 & 2 \\ \hline Purchase tag & Read + Exit & 2 & 2 \\ \hline \multicolumn{3}{c}{**The functional size of the Google**} & & **Total = 9 CFP** \\ \multicolumn{3}{c}{**Analytics implementation**} \\ \end{tabular}
\end{table} 
Table 6: Application of the COSMIC measurement phase—Example 1.