Google Analytics Implementation Guide
Google Analytics Implementation Guide
Complete setup for BlackBox UFO Research site tracking---
Your Analytics Codes
- Primary GA4 Code: G-EZRQC9L6ST
- Additional Tracking: GT-MJKSKS46
- [ ] Analytics code loads on all pages
- [ ] Both tracking codes (G-EZRQC9L6ST and GT-MJKSKS46) are firing
- [ ] Custom events are tracking properly
- [ ] Page views are registering correctly
- [ ] No console errors related to analytics
- [ ] Privacy compliance measures active
---
Implementation Methods
Method 1: Google Tag Manager (Recommended)
#### Step 1: Add GTM Container Code
Add this code to the `
` of all pages:```html
```
Add this code immediately after opening `
` tag:```html
```
Method 2: Direct GA4 Implementation
Add this code to the `
` section of all pages:```html
```
Method 3: WordPress Plugin Implementation
If using WordPress, add this to your theme's `functions.php`:
```php
// Google Analytics 4 for BlackBox UFO Research
function blackbox_ufo_analytics() {
?>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-EZRQC9L6ST', {
page_title: document.title,
site_name: 'BlackBox UFO Research'
});
gtag('config', 'GT-MJKSKS46');
}
add_action('wp_head', 'blackbox_ufo_analytics');
```
---
Enhanced Tracking for UFO Research Site
Custom Event Tracking
Add this enhanced tracking code for UFO-specific events:
```javascript
// UFO Content Engagement Tracking
function trackUFOEngagement(eventName, parameters) {
gtag('event', eventName, {
event_category: 'UFO_Research',
event_label: parameters.label || '',
custom_parameter_1: parameters.content_type || 'general',
custom_parameter_2: parameters.case_category || 'unknown',
value: parameters.value || 1
});
}
// Track UFO case study views
function trackCaseStudyView(caseStudy, category) {
trackUFOEngagement('case_study_view', {
label: caseStudy,
content_type: 'case_study',
case_category: category
});
}
// Track 5 Observables guide engagement
function trackObservablesEngagement(observable, section) {
trackUFOEngagement('observables_section_view', {
label: `Observable_${observable}_${section}`,
content_type: '5_observables',
case_category: 'technical_analysis'
});
}
// Track document downloads
function trackDocumentDownload(documentName, documentType) {
gtag('event', 'file_download', {
event_category: 'UFO_Documents',
event_label: documentName,
file_extension: documentType.split('.').pop(),
file_name: documentName
});
}
// Track email signups
function trackNewsletterSignup(source) {
gtag('event', 'sign_up', {
event_category: 'Lead_Generation',
event_label: source,
method: 'email'
});
}```
Page-Specific Tracking
#### For Case Study Pages
```html
```
#### For Technical Analysis Pages
```html
```
---
SEO and Analytics Integration
Enhanced Page Tracking
```html
```
Conversion Tracking
```html
```
---
Privacy Compliance (GDPR/CCPA)
Cookie Consent Integration
```html
```
---
Testing and Verification
Test Your Implementation
1. Real-Time Reports: Check Google Analytics Real-Time reports
2. Tag Assistant: Use Google Tag Assistant browser extension
3. Debug Mode: Enable GA4 debug mode:
```html
```
Verification Checklist
---
WordPress-Specific Implementation
If your site uses WordPress, here's the complete setup:
Theme Integration (header.php)
Add before closing `` tag:
```php
```
Functions.php Addition
```php
// BlackBox UFO Research Analytics
function blackbox_ufo_analytics_setup() {
if (!is_admin() && !is_preview()) {
wp_enqueue_script('google-analytics', 'https://www.googletagmanager.com/gtag/js?id=G-EZRQC9L6ST', array(), null, false);
wp_add_inline_script('google-analytics', '
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag("js", new Date());
gtag("config", "G-EZRQC9L6ST");
gtag("config", "GT-MJKSKS46");
');
}
}add_action('wp_enqueue_scripts', 'blackbox_ufo_analytics_setup');
```
---
Next Steps
1. Choose Implementation Method: Select the method that works best for your site platform
2. Add the Code: Insert the tracking code in your site's header
3. Test the Implementation: Verify both codes are working
4. Set Up Goals: Configure conversion goals in Google Analytics
5. Monitor Performance: Check analytics regularly for insights
Your analytics are now ready to track the success of your UFO research site's SEO domination strategy!