Same Event ID Received for Many Event Instances Facebook + WooCommerce - wordpress

I use Facebook Pixel for WooCommerce site and in Event Manager of Facebook Business profile I see message about this issue:
You're sending the same event ID for many instances of your AddToCart
events. Event IDs are unique identifiers that are used to deduplicate
identical events received from your pixel and the Conversions API so
they're not counted twice. To ensure Facebook is accurately counting
your events, each unique event instance needs its own unique event ID.
This may cause issues with the measurement of your events and the
attribution of your ad campaigns.
As far as I understand, eventID must be updated by JavaScript every time someone presses "Add to cart" button?
If it is right, where/when I should update this eventID?
If it is no, could you please tell what should I do to fix this issue?
(I am beginner in Facebook integrations and WooCommerce, so I am sorry if this question is too obvious)

I'm sending ADDTOCART event via FB pixel JS as below. I'm adding a unique number in eventID so that each time this is called it should have different ID with it.
var random_num = 1 + Math.floor(Math.random() * 100);
fbq('track', 'AddToCart', {
content_ids: ['1122', '3234'],
content_type: 'product'
}, {eventID: "AddToCart_" + social_media_eventId + "_" + random_num});

Related

What happens when pushing variable to dataLayer multiple times

Lets say for instance I have a web game on a page and the code is set so that every time the player completes a level it pushes the current level to the dataLayer:
dataLayer.push({'level': currentLevelNumber});
Does this then mean I will be able to create segment in GA to see how many people made it to each level? i.e. segment1(level = 1), segment2(level = 2) etc..
Also, what are limits of this? GA has a 500 event limit per session. Is pushing a variable part of this limit or does it have its own limit?
I tried to find this information in documentation but couldn't see it.
Essentially, you're trying to report on the levels that your users are on for a particular game.
To do this, you will need to create a user-scoped custom dimension within GA.
Then you would want to push to the datalayer whenever the user moves to another level something like:
dataLayer.push({
'level': currentLevelNumber,
'event': 'user-lvl-update',
});
Then in GTM, create datalayer variable to capture "level" and create a custom event trigger for the "user-lvl-update" event.
Then in GTM, create a GA tag for the event "Level Update" and configure it normally, but this time, check the "Enable overriding settings" checkbox, under "More settings > Custom Dimensions" click on "Add custom dimension", enter in the index number of the custom dimension you created earlier and for dimension value, put in the variable where you captured level. Trigger this tag using the "user-lvl-update" trigger.
There is a limit of 500 hits per session. A hit is a pageview, event, etc. whenever you're sending data to GA. Pushing to the datalayer doesn't count towards that

Separate form submissions by campaign in analytics

I have to campaigns running in google analytics at the same time, and, in my website, i have a contact form.
Is there any way that i can see from which of the campaigns came the message that was send to me?
For example, John has clicked in the campaign-one and send me a message, and Mario has clicked in the campaign-two and send me a message. I want to know that John came from the campaign-one and Mario from the campaign-two.
I have already been mapping events in my site, but i can't figure it out how to separate if the form came from campaign-one or campaign-two.
Thanks a lot! :-)
If you've set your campaign-one and campaign-two values to the utm_campaign parameter in your campaign tagging, it will show up in the Campaign dimension in Google Analytics.
I'm assuming by "I have already been mapping events", you mean that you have implemented event tracking on your site for these form submissions.
You can either build a custom report in Google Analytics that includes the Campaign dimension and the event dimensions (Event Category, Event Action, Event Label), or you can add Campaign as a secondary dimension to an events report. For example, in the Behavior > Events > Top Events report, choose "Secondary Dimension" and then select the "Campaign" dimension. That would break up the event numbers by which campaign the session was acquired from.
Similarly, you can look at the Acquisition > Campaigns > All Campaigns report and add one of the event dimensions as a secondary dimension there, to see campaigns broken down by events that they resulted in.

Firebase Dynamic Links Marketing Campaign dynamic_link_first_open filter event by parameter

I have created two Firebase Dynamic Links which has utm_source=twitter and utm_source=facebook.
After clicked the dynamic links, I able to see the dynamic_link_first_open events being logged, but the predefined audiences (dynamic_link_first_open count > 0, source = facebook / source = twitter) do not have any value (after one day).
Is this the correct way to filter the dynamic_link_first_open event by parameter?
Any steps I have missed?
The audience result should show up when the number of users that satisfy the audience filter is more than 10. Otherwise, it will show that there are < 10.

GTM Ecommerce Tracking Issue

I am expecting someone to help me on the below. Below is the scenario
We are planning to track revenue, products sold etc and we have setup standard ecommerce tracking using GTM on my test domain. If the ecommerce tracking works fine on the test domain then, we have planned to move it to live.
Trigger I have setup
enter image description here
Tag I have setup
enter image description here
Data layer code placed on Confirmation page above the GTM container immediately after opening the tag
<script>
window.dataLayer = window.dataLayer || []
dataLayer.push({
'transactionId': 'XYZ',
'transactionTotal': 123,
'currencyCode': 'SAR',
'transactionProducts': [{
'sku': 'abcd',
'name': 'iphone',
'category': 'Mobile',
'price': 999,
'quantity': 1
}]
});
</script>
Here the problems are
1) Whenever someone lands on confirmation page in real time goal conversion visitors are showing as
two instead of 1 for that confirmation page.
2) I did continuously 4 bookings but only one booking is showing in goal conversions option and also
ecommerce tracking is also showing for that one booking only. But for all the 4 bookings GTM tag
triggered and also in real time conversions it showed for that 4 bookings.
3) After 15 mins again I made a booking then, that booking is tracking in analytics and showing
under conversions option.
I just want to know why does this happen. Why analytics is not tracking goal conversions if I do
bookings continuously from my system. Why it is tracking after that 15 mins of time.
2) Goals are registered only once per session, so unless you wait 30 minutes or remove the cookie the goal will be completed only once. Also if you re-use the transaction id this will be merged into a single row in the reports (try and set minutes as secondary dimension, that should break up transactions into different rows). Better use different transaction ids for testing (maybe random strings).
3) It seems by then your session has ended (unusual, session should be 30 minutes by default, or until a change of traffic source) and so conversions are recorded again.
As to 1) no idea really - if two users show up that would mean you create two GA sessons with different client ids, but there is nothing wrong with your trigger. I don't think this can be diagnosed without looking at your page.

How do you drill in to Google Analytics custom event data?

What do people use to dig in to Google Analytics data?
For example, I have a web page that tracks a custom event on it. I'd like to track a couple metrics:
1) What percent of users on that page successfully call the event at least once?
2) How do I see a bucket of the number of times a user called the event while they're on the page (or in a session, whatever), such as:
0 times -> 800 visitors
1 times -> 200 visitors
2 times -> 150 visitors
etc
Ideally I'd get this data emailed to me on a regular basis, maybe with a chart for the second part. Suggestions?
Let's say that the event is a Video Play.
You must keep track of how many videos the user played. For that create a session cookie with that number, and increment it at each video play.
Then you can fire a CustomVariable (Page Scoped) to send the number of events the user performed at that page.
Something like this:
window.onunload = function(){_gaq.push(['_setCustomVar', 1, 'Video Plays', cookie_value, 3]);}
http://code.google.com/apis/analytics/docs/gaJS/gaJSApiBasicConfiguration.html#_gat.GA_Tracker_._setCustomVar
That should get you a nice report

Resources