Is it possible to reference an e-commerce order in WooCommerce with info about if cookie consent was given from the customer who made the order?
My idea is the following:
Let's say a user comes from an Ad, so the URL already contains UTM parameters.
The user then sees the cookie banner and clicks on "accept".
The "accept" button appends another custom UTM parameter (e.g &consent=1) and opts-in
There are a few plugins that make it possible to see the UTM data for a specific order (e.g "handl utm grabber"). I was wondering if this way I could get insights for a specific order if the customer gave cookie consent or not.
Also, would appending the custom UTM parameter cause any problems (e.g double counting) in Google Analytics in this scenario?
Parameter "consent=1" is not UTM parameter, so it won't start new session.
Related
I have traffic coming from Salesloft emails sent by sales reps that gets bounced off a subdomain and then has a sbrc parameter appended to the URL. I'd like to ensure that this traffic gets counted by Google Analytics as coming from Email, whereas it's currently falling under the "Direct" bucket. Ideally, users would also be appending utm parameters to their links, but this isn't happening consistently.
I tried creating a filter to search and replace the following regex (?:^|\?|&)(sbrc=[^&]*&?) with ?utm_medium=email&utm_source=salesloft in the Request URI. This changed the displayed URL when looking at my realtime traffic, but did not change how GA categorized the channel of the traffic (still direct).
I then tried editing the default channel groupings for Email to be the system categorized OR Landing Page URL contains "sbrc" and dragged Email to the first channel grouping at the top. This doesn't seem to have done anything at all.
How can I make GA recognize this custom parameter as being attributable to the Email channel?
You could use advanced filters to solve this task. The Advanced filter lets you construct Fields for reporting from one or two existing Fields.
In your case, advanced filters let you assign values to campaign source and campaign medium, based on the content of the request URL. This is a sample setup for the source field, and you need a second similar filter for medium as well:
Ideally, users would also be appending utm parameters to their links,
but this isn't happening consistently.
If they add their own and use a utm_medium other then utm_medium=Email, then it will not be defined as being in the default Email channel.
Filters are not retroactive.
Filters also run after data has already been processed by Google, to only change how it displays in the reports as it gets sent back into the GA reports.
A Search and Replace Filter applied to the RequestURI for
?utm_medium=email&utm_source=salesloft is not going to have the result you want.
It will change the appearance of the RequestURI in reports, not actually change how that traffic is attributed.
Changes to the default Channel grouping are not retroactive, it should have affect going forward though.
To see the changes in historical data for the Channels, you would do best to create a custom Channel grouping at the View level, this can then be applied retroactively to the historic data.
Per this law.stackexchange question it's possible to use google analytics without getting consent and still comply with the GDPR.
I was thinking about creating two GA properties for a single domain name. One that switches off all the features that the GDPR requires for non consent and another that tracks users that have consented and have an account setup where they can make opt out changes, manage cookies etc.
Is it possible to track the same GA property / browser client using two different GA ids that correspond to the different configuration settings?
In other words when the user is logged in, the user gets tracked by the consented GA id, but when the user is not logged in and anonymous the user gets tracked by the GDRP compliant non consent GA id?
Yes. You just need to determine the technical identifier of a logged-in user (probably a cookie or js variable), then use that identifier to pivot tracking logic. If you have analytics.js or gtag.js hardcoded on your site, then you'll want to change your main embed code to have conditional values for the tracking id and anonymizeIp.
If you're using GTM you can use lookup tables with the logged-in identifier as the input. Use these lookup tables as the value for GA Tracking IDs or other tracker fields. If you're not using the GA Settings variable (which you should!), just make sure you set these config value in every GA tag.
Alternatively, if your primary GA Property can be otherwise compliant, it might be an option to track both consenting and non-consenting users in a single property, and pivot only the anonymize ip setting (analytics.js/gtag/gtm), not the GA tracking ID. It's possible to pivot advertising features tracking-side too.
I recently ran an e-mail campaign with a partner, who sent me over a URL with their own UTM parameters so they could track performance on their side.
When I handed the information over to our e-mail team and checked as the campaign went live, it appeared that they, out of habit, had added their own UTM parameters on top of the ones sent over by the partner, resulting in a click-through URL that looked like the following -
http://spirit.cruises.com/?cm_mmc=partner_email-_-sprt-multi_product--20161028--clia_plan_a_cruise_month&utm_medium=partner_email**&utm_source**=sprt-multi_product**&utm_campaign**=20161028&utm_content=clia_plan_a_cruise_month**&utm_source**=responsys**&utm_medium**=email**&utm_campaign**=20161028_50pct__Dual_Cruise_Email
As you can see, there are duplicate source, medium, and campaign parameters.
Does anyone know what happens in this situation? Does Google Analytics count both, or just the first, or just the last, or none? What is best practice when there are two parties that want to track performance of a URL in a campaign, and they may have different naming conventions?
(This is my first question, so please be nice :) Thanks!)
GA counts the last set. The proper way to deal with this is to avoid the situation. Email Software is often set to automatically add utm parameters to links (do you do not have to do it manually), but then all email marketing software I know would allow to override the configured default parameters.
I am not sure how your partner could track performance "on their site" via utm parameters unless they have their own GA code integrated in your website (or do you mean that they have access to your GA ?).
If there are two sets of analytics code that require different campaign attribution you would have use differently named parameters - let's say utm_medium2, utm_source2 and utm_campaign2 - and manually override campaign attribution for the second tracker:
// add this to after your usual tracker
ga('create', 'UA-XXXXX-Y', 'auto', 'partnerTracker');
ga('partnerTracker.set','campaignName',<value of utm_campaign2>)
ga('partnerTracker.set','campaignMedium',<value of utm_medium2>)
ga('partnerTracker.set','campaignSource',<value of utm_source2>)
ga('partnerTracker.send','pageview')
That would send data to a second account and override campaign attribution fields. It seems quite unlikely that you have or want that, but if you want to allow your partner to independently track utm values on your website (and everything else with it) that would the way to go.
Frankly I think you should just remove your partners utm parameters. Utm parameters make only sense for the owner of the respective GA account, and that is probably you, not the partner.
I agree with the first answer except for that last point where has says to remove the partner's UTM parameters.
In your case, the destination for the link provided to you by your partner is NOT your own website. The link goes to your partner's website. Therefore, your GA account has zero relationship with the link he sent you.
The way we're getting around this (without doing anything in analytics) for our many partners that we send links to is by using different email subjects per partner. Most email platforms use the subject line (or the internally defined Campaign "Name") as the value for UTM_Campaign.
So different subjects that include the partner organization in them:
"Special discount for ABC Organization members!"
"Special discount for XYZ Company members"
We can then analyze each unique campaign name in GA.
If the user comes with the utm values to the landing page
http://example.com/landing.php?utm_source=Facebook&utm_medium=Marketing&utm_term=FbAd&utm_content=Fad1&utm_campaign=FBFunnel
In the Landing.php file I can Get the UTM values. and Google analytics will show campaign results and clicks. What if the user navigate to other page
-> http://example.com/contact.php. In the contact.php there is no UTM values in the URL how would Google analytics track that visit from which UTM Campaign? . If I am using PHP api to send utm values to third party tools means How would I fetch UTMs in the contact.php file? I don't have clear idea about this Please help.
Thank you
Google Analytics stores campaign data, including utm parameters, in a session scope. The values are retrieved at the first page of the session (which also means that a new session starts when the campaign attribution changes) and are applied to all subsequent hits.
With the current version of GA - Universal Analytics - attribution happens on the Google servers (used to be different with previous, but now deprecated versions of GA). There is no realistic way to retrieve the Attribution data from Google in realtime. You'd have to create your own solution to store the utm paramaters in a cookie and retrieve them from there.
If you do not need to send the data in realtime I wrote a lengthy tutorial on how to extract attribution data from GA and send it to another application via the respective APIs. The tutorial uses Python as programming language and Salesforce as partner application, but there should be enough background in there to apply the principle to other languages and applications.
Your best option is to write a small piece of javascript to store the UTM values in a cookie and then populate your forms with the stored values.
If you don't want to write one yourself, this blog post helps you do exactly what you need and also provides a javascript that you can add to your website.
Disclosure: I'm the author of the blog post.
Another simpler way is to use Javascript to append the UTM/query parameters to every link. Here's an example in JQuery:
$('a').each(function() {
var querystring = window.location.search.substring(1);
var href = $(this).attr('href');
if (href) {
href += (href.match(/\?/) ? '&' : '?') + querystring;
$(this).attr('href', href);
}
});
Of course you could specify/select a class of links if you only want to keep the parameters on
This makes for uglier URLs throughout your site but may be a quicker/simpler solution than storing and accessing the UTM params in cookies.
I've build links with correct UTM parameters for advertising campaigns. On the landing page, there is a download button. When the download button is clicked, the next page that loads does not retain the UTM parameters (e.g. http://example.com?utm-params-here -> http://example.com/download).
When the UTM parameters are lost as described above, does GA stop associating the user with the UTM campaign / source? Or is GA smart enough to continue associating the user with the UTM campaign / source even after the parameters are lost, as long as their initial page view on the website contains the parameters?
UTM parameters for source, medium, etc. are all session-level dimensions, meaning they apply to all hits in that same session.
The only way a click on your download button wouldn't be associated with the UTM campaign / source is if a new sessions had started (for whatever reason).
You can read more about how sessions are defined here:
https://support.google.com/analytics/answer/2731565?hl=en