Hi All, I've just started using Rudderstack and wa...
# support
l
Hi All, I've just started using Rudderstack and wanted to find out if I can implement the RudderStack Javascript SDK using GTM or must this be hard-coded in the Website?
m
Hey There! 👋 Your message has been received by the RudderStack team. Our standard customer support hours are 9-6 PM EST, but we will forward this request to your Technical Account Manager, and they will get back to you shortly. Please use the thread for any additional comments.
l
Hi @hundreds-lifeguard-65770 - Thanks for the link to the the GTM destination article however that's not the question I asked. My question is if I can install the Rudderstack SDK using GTM on my website or must I hard-code this on my website. I want to sent events from my website to GA4 using Rudderstack's SDK but want to know if GTM can fire this code. Hope that makes sense.
m
Hi Magesh, you can load RudderStack as a custom HTML tag using google tag manager (though we don't recommend it), and the details are provided in the link shared by Redsquare.
💯 1
l
Thanks All.
Hi @shy-kite-21035 - Can you assist me with a question - I have implemented the Rudderstack SDK on my website. How to I start seeing what events I need to send to GA4. Is there another piece of code besides the SDK that I need to implement. This is what I implemented on the site: <script type="text/javascript"> !function(){"use strict";var sdkBaseUrl="https://cdn.rudderlabs.com/beta/3.0.0-beta";var sdkName="rsa.min.js" ;var asyncScript=true;window.rudderAnalyticsBuildType="legacy",window.rudderanalytics=[] ;var e=["setDefaultInstanceKey","load","ready","page","track","identify","alias","group","reset","setAnonymousId","startSession","endSession"] ;for(var n=0;n<e.length;n++){var d=e[n];window.rudderanalytics[d]=function(e){return function(){ window.rudderanalytics.push([e].concat(Array.prototype.slice.call(arguments)))}}(d)}try{ new Function('return import("")'),window.rudderAnalyticsBuildType="modern"}catch(a){} if(window.rudderAnalyticsMount=function(){var e=document.createElement("script") ;e.src="".concat(sdkBaseUrl,"/").concat(window.rudderAnalyticsBuildType,"/").concat(sdkName),e.async=asyncScript, document.head?document.head.appendChild(e):document.body.appendChild(e)},"undefined"==typeof Promise){ var t=document.createElement("script") ;t.src="https://polyfill.io/v3/polyfill.min.js?features=globalThis%2CPromise&callback=rudderAnalyticsMount", t.async=asyncScript,document.head?document.head.appendChild(t):document.body.appendChild(t)}else{ window.rudderAnalyticsMount()}window.rudderanalytics.load("2Ui7kXR8Zd9YSX3CeTdJ9vn9i3h","https://somebodydihftp.dataplane.rudderstack.com",{})}(); </script>
Why am I not seeing any events in Rudderstack?
m
Hi Magesh, you are seeing only page events since they are captured by default. The remaining events have to be instrumented by you. so have you instrumented the other events on your GTM? Say when the Add to Cart event happens, you write some code (either directly on the website or using the Tag Manager) to send event using rudderanalytics.track('Product Added', ).
l
Hi @shy-kite-21035 - The Beta SDK that you have doesn't work at the page level. I had to change to the Legacy SDK and implement it directly to the head section. Now I am seeing page level data. I'm trying not to use GTM so I want to capture events using your processes. So based on the videos and documents, its looks like there is a lot of trackers that need to be implemented on the website. Without using GTM, can you share a tutorial or video that shows how to create multiple tracking events to send to GA4. Events needs to replicate how GTM created events so that there is continuity of data and we can still capture the same data. Let me know if this is easy to do or is this alot of developer coding on the site?
Lastly, how to I hash or anonymize my user data to remain HIPAA and GDPR Compliant when it comes to marketing consent?
In addition, why is the channel data in GA4 showing as Unassigned? Do I have to update the code to include "Source" "Medium" etc...How does your standard pageview snippet collect and assign GA4 Channel Groupings?
m
Hi Magesh 1. Firstly the docs of the v3 SDK seem to be incorrect. I was trying to set it up with NPM and could not send events either. Later the team informed me that the docs are showing the wrong url end-point. I guess the issue with the CDN is the same. That is on Rudderstack's side and we will correct it.
can you share a tutorial or video that shows how to create multiple tracking events to send to GA4
2. This is not straight forward will involve both your developer team and the Product team (since the Product team defines what events need to be captured). This also depends on your business use case. 3. Since you have setup GA4 in cloud mode, you can use a user transformation to hash the data that is being sent to GA4. See link below https://www.rudderstack.com/docs/features/transformations/templates/#hash-pii Also a link to different connection modes in rudderStack https://www.rudderstack.com/docs/destinations/rudderstack-connection-modes/ 4. The channel data is showing up as Unassigned because the campaign parameters (utm_source, utm_medium) are captured by Rudderstack from the page url. So the first page the user visits on your website contains these details. However, subsequent pages do not contain these details and hence most of the pages show up as unassigned. There are a couple of ways around this a) Send a campaign event. According to the GA4 docs sending this event should help in attribution of any subsequent events.
Copy code
https://developers.google.com/analytics/devguides/collection/protocol/ga4/reference/events#campaign_details
Drawbacks:- Last time the team tried this, they reported that it did not work as expected. b) Move to GA4 device mode Drawbacks:- In Hybrid mode, user transformations like the one suggested in point 3 are only supported for Enterprise customers c) Ask your dev team to capture the campaign parameters and pass them across varies pages Drawbacks:- Developer effort