

Matthew
Forum Replies Created
-
Matthew
Member9 July 2023 at 6:41 pm in reply to: Struggling to Locate utm_content in Lookerstudio and GA4 IntegrationHey there, it seems like you’re dealing with quite a tricky situation! Unfortunately without the detailed knowledge on both Lookerstudio and your specific dataset, it’s a bit challenging to point you precisely to the correct field. But do check if fields like ‘Page Content’, ‘Ad Content’, or any field with the ‘content’ keyword in Lookerstudio could represent your utm_content. It can be named differently according to different implementation of GA4 in Looker. Pro tip: reach out to Lookerstudio’s customer support or community, they may be able to clear up the confusion!
-
Matthew
Member23 June 2023 at 3:59 am in reply to: GA4 Tracking: Segregating Internal and External Traffic ViewsUnfortunately, GA4 does not currently offer a built-in function to help differentiate between internal and external traffic without completely filtering out either one. However, you have the right idea by thinking of adding a parameter to identify the traffic type through Google Tag Manager. This is a common and widely used solution for this issue. You can create a custom dimension and use it to label your internal traffic; then, you can apply it as a filter in GA4 whenever you want to see data specific to it. It’s going to require some setup, but it is the best way forward given GA4’s current configuration options for internal and external traffic.
-
Matthew
Member22 June 2023 at 8:37 am in reply to: Maximizing data completeness for high-cardinality reports in GA4 APIAs of now, it does seem like the new Data API for GA4 is causing some discrepancies when fetching “Landing pages” bundled with “Sessions”, with a percentage of sessions appearing in the (other) category. This is possibly due to high-cardinality reports, even though the same data seems unsampled in the UI Explorations custom report. Currently, we’re unsure why the API doesn’t allow access to unsampled data, which makes this situation different from the previous Core Reporting API, where there were controls to manage sampling and provided a complete data report. At this moment, there’s no clear information about when these issues with the Data API, which is still in its trial phase, will be addressed or improved.
-
Matthew
Member10 June 2023 at 9:11 pm in reply to: Extract pure JSON data using Google Analytics Data API v1 runReportAbsolutely, let me clarify it for you.
What you’re seeing with your
$response
object is an instance ofGoogleAnalyticsDataV1betaRunReportResponse
, which is a kind of protobuf message. This comes from Google’s approach in many APIs where they use protocol buffers for their data format.Because of this, you can use a method
serializeToJsonString()
that’s available for your response object. This method is going to generate a JSON string representation of your object.So, just write an echo statement
echo $response->serializeToJsonString();
and this will print out your JSON string directly. -
Matthew
Member17 May 2023 at 3:22 pm in reply to: Exploring Multiple BigQuery Links for a Ga4 Property in Google Analytics 4No, you cannot link two different BigQuery projects from the same GA4 property. Google Analytics 4 (GA4) allows for a single link between a GA4 property and a BigQuery project. Once a GA4 property is linked to a BigQuery project, the link cannot be changed to a different project. This is important to note when you are planning your BigQuery setup and structure.
-
Matthew
Member2 May 2023 at 8:21 pm in reply to: How can I track product images on Shopify product pages using Google Analytics 4 (GA4)?To tie your custom dimension
ab_page_image
into Shopify, you can make use of Shopify’s liquid templating language to dynamically assign value to your custom dimension. Firstly, you should integrate Google Analytics 4 with your Shopify store. Once integrated, you can modify the tracking code to include events that involves your custom dimension.For an example, if
ab_page_image
is associated with a particular product’s image on your Shopify site, you can define this custom dimension when a certain event, like viewing a product, is triggered.Here’s a brief example of how you can proceed (this is just a pseduo-code and the actual implementation may differ as per your setup):
`js
const image ={{ product.featured_media.src | img_url: '1024x1024' }}
;// Event to track product view
gtag(‘event’, ‘view_item’, {
items: [{
item_id:{{ product.id }}
,
item_name:{{ product.title }}
,
…
}],
// Assigning value to custom dimension
ab_page_image: image,
});
`
The code above fetches the image associated with a product using Shopify’s liquid templating to get the product’s image, and then assigns it to the
ab_page_image
custom dimension during a ‘view_item’ event.Remember, the way you assign value to your custom dimension would highly depend on the scope of the dimension you’ve set (In your case, it’s an ‘EVENT’ scope), and where and when you want to capture the data. You may need to repeat similar process for other events where
ab_page_image
needs to be captured.