

Jacob
Forum Replies Created
-
Jacob
Member17 June 2023 at 3:15 am in reply to: Implementing Separate Tracking in GA4 for Multiple SubdomainsIn Google Analytics 4, views have been replaced with data streams, but these can’t be set up for individual page paths in the same way views were used in Universal Analytics. As a workaround, you might try creating audiences based on ‘page_view’ events where the ‘page_location’ contains the relevant path for each page you want to track separately. However, I’m not completely sure if this will work perfectly. It’s definitely a more complex setup compared to how it was done in Universal Analytics, sorry about that.
-
Jacob
Member1 December 2022 at 3:12 am in reply to: Troubleshooting email sending issues in Google Apps ScriptHey, I peeped your code and noticed in your conditional statement you write ‘if (overdueValue === “TRUE”)’. The thing is, ‘overdueValue’ is a boolean (true or false), not a string (‘TRUE’ or ‘FALSE’). So, your condition will always deliver ‘false’.
Here’s an updated version of your code using boolean instead:
`
function sendEmail() {
const ss = SpreadsheetApp.getActive();
const sh = ss.getSheetByName(“Sheet1”);
const data = sh.getRange(“B2:L80” + sh.getLastRow()).getValues();
data.forEach(r => {
let overdueValue = r[9];
if (overdueValue === true){
let name = r[10];
let message = “Reach out to ” + name;
let subject = “Reach out to this person.”;
GmailApp.sendEmail(“xxxx@gmail.com”, subject, message);
}
});
}
`
Alternatively, you can keep using string but remember to write ‘true’ in lowercase, like this:
if (overdueValue.toString() === "true")
. Remember to turn ‘overdueValue’ into a string first! Happy coding! -
Jacob
Member14 November 2022 at 4:54 pm in reply to: How can I retrieve adCost and adClicks information for a property using the GA4 Data API?The error might be because you’re not adding a dimension to your request. For the new GA4 data API, certain metrics require a corresponding dimension to provide context for your data. In your case, you might need to include ‘sessionCampaignName’ as a dimension. You can test your request using Google’s GA4 Data API’s query explorer, and if the dimension is missing, it will recommend adding it. Including the mentioned dimension should return the result you’re looking for, given that there’s available data related to your metrics.
-
In simpler terms, Google Analytics 4 (GA4) handles sessions differently from previous versions. In GA4, if a user visits your website, leaves, and then comes back through a different channel within the same session, GA4 classifies it as one session but counts both traffic sources. Therefore, when you add up the sessions from all the individual channels, the number might be higher compared to the total sessions count.